ia64/xen-unstable
changeset 5640:4b06e1c365fc
Other than native x86-64 code, the XEN guest *does* use 4k mappings for
the contiguous kernel mapping of (physical) memory. Thus the code in
change_page_attr needs to work like on i386 (where large pages are used
only conditionally) rather than like native x86-64. Patch below/attached.
Not doing so triggered the BUG_ON during load of intel-agp on machines
with i915 chipset.
Signed-off-by: Jan Beulich <JBeulich@novell.com>
the contiguous kernel mapping of (physical) memory. Thus the code in
change_page_attr needs to work like on i386 (where large pages are used
only conditionally) rather than like native x86-64. Patch below/attached.
Not doing so triggered the BUG_ON during load of intel-agp on machines
with i915 chipset.
Signed-off-by: Jan Beulich <JBeulich@novell.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Fri Jul 01 15:47:46 2005 +0000 (2005-07-01) |
parents | adda79dcd0e3 |
children | 374ff557a88f |
files | linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/pageattr.c |
line diff
1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/pageattr.c Fri Jul 01 15:46:41 2005 +0000 1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/pageattr.c Fri Jul 01 15:47:46 2005 +0000 1.3 @@ -166,16 +166,23 @@ static int 1.4 BUG(); 1.5 1.6 /* on x86-64 the direct mapping set at boot is not using 4k pages */ 1.7 - BUG_ON(PageReserved(kpte_page)); 1.8 - 1.9 - switch (page_count(kpte_page)) { 1.10 - case 1: 1.11 - save_page(address, kpte_page); 1.12 - revert_page(address, ref_prot); 1.13 - break; 1.14 - case 0: 1.15 - BUG(); /* memleak and failed 2M page regeneration */ 1.16 - } 1.17 +// BUG_ON(PageReserved(kpte_page)); 1.18 + /* 1.19 + * ..., but the XEN guest kernels (currently) do: 1.20 + * If the pte was reserved, it means it was created at boot 1.21 + * time (not via split_large_page) and in turn we must not 1.22 + * replace it with a large page. 1.23 + */ 1.24 + if (!PageReserved(kpte_page)) { 1.25 + switch (page_count(kpte_page)) { 1.26 + case 1: 1.27 + save_page(address, kpte_page); 1.28 + revert_page(address, ref_prot); 1.29 + break; 1.30 + case 0: 1.31 + BUG(); /* memleak and failed 2M page regeneration */ 1.32 + } 1.33 + } 1.34 return 0; 1.35 } 1.36