Selaa lähdekoodia

lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET

We still assume the Guest and Host have the same PAGE_OFFSET settings,
but now we don't assume 0xC0000000.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Matias Zabaljauregui <zabaljauregui@gmail.com>
Rusty Russell 15 vuotta sitten
vanhempi
commit
fb100d78c0
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      drivers/lguest/page_tables.c

+ 2 - 4
drivers/lguest/page_tables.c

@@ -996,11 +996,9 @@ static unsigned long setup_pagetables(struct lguest *lg,
 	if (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)))
 		return -EFAULT;
 #else
 	/*