ia64/xen-unstable
changeset 11323:78a25a7eac1f
Fix shadow mode 32/PAE linux writable heuristic and add 64-bit version.
Signed-off-by: Steven Hand <steven@xensource.com>
Signed-off-by: Steven Hand <steven@xensource.com>
author | Steven Hand <steven@xensource.com> |
---|---|
date | Mon Aug 28 21:40:42 2006 +0100 (2006-08-28) |
parents | 28824bd2701c |
children | 7210b62802be |
files | xen/arch/x86/mm/shadow/common.c |
line diff
1.1 --- a/xen/arch/x86/mm/shadow/common.c Mon Aug 28 21:25:13 2006 +0100 1.2 +++ b/xen/arch/x86/mm/shadow/common.c Mon Aug 28 21:40:42 2006 +0100 1.3 @@ -1898,16 +1898,16 @@ int shadow_remove_write_access(struct vc 1.4 } while (0) 1.5 1.6 1.7 - /* Linux lowmem: first 1GB is mapped 1-to-1 above 0xC0000000 */ 1.8 - if ( v == current 1.9 - && (gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x40000000 ) 1.10 - GUESS(0xC0000000 + (gfn << PAGE_SHIFT), 4); 1.11 - 1.12 if ( v->arch.shadow.mode->guest_levels == 2 ) 1.13 { 1.14 if ( level == 1 ) 1.15 /* 32bit non-PAE w2k3: linear map at 0xC0000000 */ 1.16 GUESS(0xC0000000UL + (fault_addr >> 10), 1); 1.17 + 1.18 + /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */ 1.19 + if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) 1.20 + GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4); 1.21 + 1.22 } 1.23 #if CONFIG_PAGING_LEVELS >= 3 1.24 else if ( v->arch.shadow.mode->guest_levels == 3 ) 1.25 @@ -1918,6 +1918,10 @@ int shadow_remove_write_access(struct vc 1.26 case 1: GUESS(0xC0000000UL + (fault_addr >> 9), 2); break; 1.27 case 2: GUESS(0xC0600000UL + (fault_addr >> 18), 2); break; 1.28 } 1.29 + 1.30 + /* Linux lowmem: first 896MB is mapped 1-to-1 above 0xC0000000 */ 1.31 + if ((gfn = sh_mfn_to_gfn(v->domain, gmfn)) < 0x38000 ) 1.32 + GUESS(0xC0000000UL + (gfn << PAGE_SHIFT), 4); 1.33 } 1.34 #if CONFIG_PAGING_LEVELS >= 4 1.35 else if ( v->arch.shadow.mode->guest_levels == 4 ) 1.36 @@ -1929,6 +1933,10 @@ int shadow_remove_write_access(struct vc 1.37 case 2: GUESS(0x70380000000UL + (fault_addr >> 18), 3); break; 1.38 case 3: GUESS(0x70381C00000UL + (fault_addr >> 27), 3); break; 1.39 } 1.40 + 1.41 + /* Linux direct map at 0xffff810000000000 */ 1.42 + gfn = sh_mfn_to_gfn(v->domain, gmfn); 1.43 + GUESS(0xffff810000000000UL + (gfn << PAGE_SHIFT), 4); 1.44 } 1.45 #endif /* CONFIG_PAGING_LEVELS >= 4 */ 1.46 #endif /* CONFIG_PAGING_LEVELS >= 3 */ 1.47 @@ -2185,7 +2193,7 @@ void sh_remove_shadows(struct vcpu *v, m 1.48 1.49 pg = mfn_to_page(gmfn); 1.50 1.51 - /* Bale out now if the page is not shadowed */ 1.52 + /* Bail out now if the page is not shadowed */ 1.53 if ( (pg->count_info & PGC_page_table) == 0 ) 1.54 return; 1.55