WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xen and cr0,cr3,cr4

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] xen and cr0,cr3,cr4
From: Adam Sulmicki <adam@xxxxxxxxxxxx>
Date: Sun, 28 Nov 2004 23:07:19 -0500 (EST)
Cc: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 29 Nov 2004 06:10:46 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: <E1CYXx8-0006PJ-00@xxxxxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
On Sun, 28 Nov 2004, Ian Pratt wrote:

> Nope, that's the initial page table when the machine boots.
>
> Even if it were possible from ring 1, reading cr3 directly
> wouldn't necessary give you want you want e.g. if you 're in one
> of the shadow page table modes.
>
> The easiest way to get the base within Linux is current->mm->pgd
> (modulo lazy switching).

I must be missing something obvious.

Using 4MB pages, under xenolinux, when I try to print the Page Directory I
Get output like this.

PD 0x020-0x020[0x04965067]V:0128M-0132M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x100-0x100[0x04191067]V:1024M-1028M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x2FF-0x2FF[0x04b54067]V:3068M-3072M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x300-0x30F[0x02c0f067]V:3072M-3136M-1>P:++++M-++++M-1 S:0064MB F:PK
PD 0x312-0x312[0x06b00067]V:3144M-3148M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3EF-0x3EF[0x02c10067]V:4028M-4032M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3F0-0x3F0[0x00c001e1]V:4032M-4036M-1>P:0012M-0016M-1 S:0004MB F:PM
PD 0x3F1-0x3FA[0x024001e3]V:4036M-4076M-1>P:0000M-0040M-1 S:0040MB F:PM
PD 0x3FB-0x3FB[0x040cf063]V:4076M-4080M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3FD-0x3FD[0x001ef063]V:4084M-4088M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3FE-0x3FF[0x0017d063]V:4088M-4096M-1>P:++++M-++++M-1 S:0008MB F:PK

This _seems_ mostly correct since those 4032M-4036 and 4036M-4076
(repeated below) seem to match original setup from x86_32.S

PD 0x3F0-0x3F0[0x00c001e1]V:4032M-4036M-1>P:0012M-0016M-1 S:0004MB F:PM
PD 0x3F1-0x3FA[0x024001e3]V:4036M-4076M-1>P:0000M-0040M-1 S:0040MB F:PM

I can also repeat the said output using 4kb pages setup.

PD 0x020-0x020[0x03a12067]V:0128M-0132M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x100-0x100[0x03a13067]V:1024M-1028M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x2FF-0x2FF[0x03a11067]V:3068M-3072M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x300-0x30F[0x02c0f067]V:3072M-3136M-1>P:++++M-++++M-1 S:0064MB F:PK
PD 0x312-0x312[0x03cfc067]V:3144M-3148M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3EF-0x3EF[0x02c10067]V:4028M-4032M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3F0-0x3F0[0x004f9021]V:4032M-4036M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3F1-0x3FA[0x004ff023]V:4036M-4076M-1>P:++++M-++++M-1 S:0040MB F:PK
PD 0x3FB-0x3FB[0x05540063]V:4076M-4080M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3FD-0x3FD[0x005ed063]V:4084M-4088M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3FE-0x3FF[0x0057f063]V:4088M-4096M-1>P:++++M-++++M-1 S:0008MB F:PK

once again I get 4032M-4036 and 4036M-4076, and the "PK" instead of "PM"
indicates that it is using 4kb pages instead of 4mb pages.

PD 0x3F0-0x3F0[0x004f9021]V:4032M-4036M-1>P:++++M-++++M-1 S:0004MB F:PK
PD 0x3F1-0x3FA[0x004ff023]V:4036M-4076M-1>P:++++M-++++M-1 S:0040MB F:PK

All dandy and nice. now the weird part is that if I try to list Page Table
entries referenced by by Page Directory in either setup I get an ooops
saying that the referneced Page Table is not in memory.

No such problems in linux classic... weird.




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel