[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version.
# HG changeset patch # User Steven Hand <steven@xxxxxxxxxxxxx> # Node ID 78a25a7eac1f9b415f24234c6d243025cee17169 # Parent 28824bd2701c59ae6d6ecda80043986f73d199f2 Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version. Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx> --- xen/arch/x86/mm/shadow/common.c | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff -r 28824bd2701c -r 78a25a7eac1f xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Mon Aug 28 21:25:13 2006 +0100 +++ b/xen/arch/x86/mm/shadow/common.c Mon Aug 28 21:40:42 2006 +0100 @@ -1898,16 +1898,16 @@ int shadow_remove_write_access(struct vc } while (0) - /* Linux lowmem: first 1GB is mapped 1-to-1 above 0xC0000000 */ - if ( v == current - && (gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x40000000 ) - GUESS(0xC0000000 + (gfn << PAGE_SHIFT), 4); - if ( v->arch.shadow.mode->guest_levels == 2 ) { if ( level == 1 ) /* 32bit non-PAE w2k3: linear map at 0xC0000000 */ GUESS(0xC0000000UL + (fault_addr >> 10), 1); + + /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */ + if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) + GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4); + } #if CONFIG_PAGING_LEVELS >= 3 else if ( v->arch.shadow.mode->guest_levels == 3 ) @@ -1918,6 +1918,10 @@ int shadow_remove_write_access(struct vc case 1: GUESS(0xC0000000UL + (fault_addr >> 9), 2); break; case 2: GUESS(0xC0600000UL + (fault_addr >> 18), 2); break; } + + /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */ + if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) + GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4); } #if CONFIG_PAGING_LEVELS >= 4 else if ( v->arch.shadow.mode->guest_levels == 4 ) @@ -1929,6 +1933,10 @@ int shadow_remove_write_access(struct vc case 2: GUESS(0x70380000000UL + (fault_addr >> 18), 3); break; case 3: GUESS(0x70381C00000UL + (fault_addr >> 27), 3); break; } + + /* Linux direct map at 0xffff810000000000 */ + gfn = sh_mfn_to_gfn(v->domain, gmfn); + GUESS(0xffff810000000000UL + (gfn << PAGE_SHIFT), 4); } #endif /* CONFIG_PAGING_LEVELS >= 4 */ #endif /* CONFIG_PAGING_LEVELS >= 3 */ @@ -2185,7 +2193,7 @@ void sh_remove_shadows(struct vcpu *v, m pg = mfn_to_page(gmfn); - /* Bale out now if the page is not shadowed */ + /* Bail out now if the page is not shadowed */ if ( (pg->count_info & PGC_page_table) == 0 ) return; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |