From: kfraser@localhost.localdomain Date: Tue, 15 Aug 2006 15:21:12 +0000 (+0100) Subject: [HVM] Ensure the read-only M2P table is mapped without _PAGE_GLOBAL X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15710^2~101 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2a053e21d20545bd0894720f77a2a0d1185f584b;p=xen.git [HVM] Ensure the read-only M2P table is mapped without _PAGE_GLOBAL otherwise context switch to shadow-mode-translate guests does not work properly (they reuse that area of virtual address space). Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_32/mm.c b/xen/arch/x86/x86_32/mm.c index cc438a7017..868140e586 100644 --- a/xen/arch/x86/x86_32/mm.c +++ b/xen/arch/x86/x86_32/mm.c @@ -104,6 +104,7 @@ void __init paging_init(void) panic("Not enough memory to bootstrap Xen.\n"); idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i] = l2e_from_page(pg, PAGE_HYPERVISOR | _PAGE_PSE); + /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this area. */ idle_pg_table_l2[l2_linear_offset(RO_MPT_VIRT_START) + i] = l2e_from_page(pg, (__PAGE_HYPERVISOR | _PAGE_PSE) & ~_PAGE_RW); } diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 87ff181b82..1379be6f1e 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -113,8 +113,9 @@ void __init paging_init(void) PAGE_HYPERVISOR); memset((void *)(RDWR_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT)), 0x55, 1UL << L2_PAGETABLE_SHIFT); + /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this area. */ *l2_ro_mpt++ = l2e_from_page( - pg, _PAGE_GLOBAL|_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT); + pg, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT); BUG_ON(((unsigned long)l2_ro_mpt & ~PAGE_MASK) == 0); }