Thu, 9 Mar 2017, 00:50


My students,

As promised, a diagram is attached which hopefully will clear up any
ambiguities with respect to the x86 extension to 3 page sizes discussed
in class today.

Recall the extension is for 64 bit addresses.  Bits [63:48] are at the moment
not used.  The remaining bits are partitioned into four nine-bit fields and
one 12-bit field as shown on the figure.

A, B, C, and D refer to 4K pages, each made up of 512 8-byte entries that
are used for accessing pages of physical memory.

The base address of A is the CR3 register, which (as we pointed out in class)
is part of the Task State Segment of the process that is executing.  It 
contains a physical address so A is resident.  Bits[47:39] indexes into that 
table, yielding an 8-byte descriptor.  Even though we could have 512 valid
entries, most processes do not need them all, so not all are used.  For those
that are used, the 8-byte descriptor is the equivalent of the PTE we have 
talked about ad nauseum and contains protection and translation information.  
It points you to the base address of Table B, assuming B is in physical memory.
If not, you take a page fault and the O/S will bring the 4K page B into 
physical memory.  

Bits [38-30] provide an index into B.  The entries of B are of two types, 
which I have designated 0 and 1 on the figure.  (I actually do not know, 
and frankly do not care, which Intel assigned to 0 and which to 1.  What is 
relevant is the descriptors of B are used for two purposes.  One purpose is 
for the descriptor to be the descriptor of a 1GB page.  If so, then we use 
bits [29:0] for the offset bits of the 1 GB page.  ...or the descriptor can
point to the base address of page C, which is a 4KB page table of 8 byte 
descriptors.  If page C is not resident, we take a page fault and let the 
O/S bring in Table C.

Bits [29:21] index into entries in Table C. Table C entries are like entries 
in Table B.  Entries are of two types.  Each either provides the PFN of a 2MB
page, with bits [20:0] providing the offset into that 2MB page.  ...or, it
points to the base address of Table D, which is yet another 4KB page table
of 8 byte descriptors.

Bits [20:12] index into entries in Table D.  Each corresponding descriptor
provides the PFN of a 4K page.  Bits [11:0] provides the offset for the 4KB
page.

Hope this all makes sense.  If not, ask your TA, ask me after Spring break,
or send me email.

Enjoy Spring break and make sure you get the third lab done.  I look forward
to seeing you when you get back from Spring break.

Yale Patt




-IrhDeMKUP4DT/M7F
Content-Type: application/pdf
Content-Disposition: attachment; filename="x86_3_page.sizes.pdf"
Content-Transfer-Encoding: base64


-IrhDeMKUP4DT/M7F-