920f Page table representation in the virtual address space of FreeBSD - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > FreeBSD Development

FreeBSD Development Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Reply
 
Thread Tools Display Modes
  #1  
Old December 5th, 2011, 15:53
nav143 nav143 is offline
Junior Member
 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page table representation in the virtual address space of FreeBSD

The following echoes the way page tables are represented in the virtual address for FreeBSD (amd64)

Code:
// start by moving entries we care about to the bottom
  vpn_table_entry = vpn >> (9*level);

  // clear out any high order bits (sign extension)
  vpn_table_entry &= (1ul << ((4 - level) * 9)) - 1;

  // now, add in the right number of recursive PML4 entries
  for (i=4; i>=(4-level); i--) {
    vpn_table_entry |= (RECURSIVE << (9*i));
  }

  // shift up to account for size of PTE (64 bits).
  table_entry = (vpn_table_entry << 3);

  // add the sign extension back
  table_entry |= (unsigned long)-1 << 47;
Can someone help me with what does RECURSIVE mean and what values it generally takes? It would be very helpful if someone can explain with an example. I tried figuring it out but was not very clear. The kernel source is also not that clear. This is part of simulator that logs the virtual address of the faulting address in the event of a MMU cache miss.

Last edited by DutchDaemon; December 6th, 2011 at 03:26. Reason: Please format your posts!
Reply With Quote
  #2  
Old December 5th, 2011, 15:59
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by nav143 View Post
Can someone help me with what does RECURSIVE mean and what values it generally takes?
I haven't looked at the code but it looks like a macro.

Also, you should be familiar with recursion
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] How to get mac-address-table in bridge mode? spartacus Networking 3 April 22nd, 2011 16:25
[Solved] White page problem with PHP page after upgrade to php5-5.3.5 soylentgreen Web & Network Services 7 February 17th, 2011 21:57
ARP Table in Freebsd ssg Userland Programming & Scripting 7 August 31st, 2010 15:03
HDD representation in /dev Seeker System Hardware 3 November 27th, 2009 10:10
what are the static table and the dynamic table in ffs? coopci General 0 October 26th, 2009 03:39


All times are GMT +1. The time now is 18:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0