lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines · Rusty Russell
We still assume the Guest and Host have the same
PAGE_OFFSETsettings, but now we don't assume0xC0000000.Signed-off-by Rusty Russell <[email protected]>Cc Matias Zabaljauregui <[email protected]>--- drivers/lguest/page_tables.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/lguest/page_tables.c static unsigned long setup_pagetables(st · line 1001
Quoted 10 lines
drivers/lguest/page_tables.c +2
-4@@ -996,11 +996,9 @@ static unsigned long setup_pagetables(stif (copy_to_user (&pgdir[0 ], &pgd,sizeof (pgd)) !=0 )return -EFAULT ;/* -* And the third PGD entry (ie. addresses 3G-4G). -* -* FIXME: This assumes that PAGE_OFFSET for the Guest is 0xC0000000. +* And the other PGD entry to make the linear mapping at PAGE_OFFSET */ -if (copy_to_user (&pgdir[3 ], &pgd,sizeof (pgd)) !=0 ) +if (copy_to_user (&pgdir[KERNEL_PGD_BOUNDARY ], &pgd,sizeof (pgd)))
How about this:
+ if (!!copy_to_user(&pgdir[KERNEL_PGD_BOUNDARY], &pgd, sizeof(pgd)))
:)
Thanks,
-L
Quoted 8 lines
drivers/lguest/page_tables.c +0
-0return -EFAULT ;#else /* _______________________________________________
Lguest mailing list
[email protected]
https://lists.ozlabs.org/listinfo/lguest