aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/vmi_32.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-02-26 12:16:01 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-27 17:41:16 -0500
commit3249b7e1df6380e9d7bb3238f64f445bf614f787 (patch)
tree59672f302da25305202f10c696d19db509e8f8b9 /arch/x86/kernel/vmi_32.c
parent817a824b75b1475f1b067c8cee318c7b4d66fcde (diff)
x86, vmi: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y
Preventing HIGHPTE allocations under VMI will allow us to remove the kmap_atomic_pte paravirt op. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> LKML-Reference: <1267204562-11844-2-git-send-email-ian.campbell@citrix.com> Acked-by: Alok Kataria <akataria@vmware.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/vmi_32.c')
-rw-r--r--arch/x86/kernel/vmi_32.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index d430e4c30193..58aca86193e5 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -33,6 +33,7 @@
33#include <asm/fixmap.h> 33#include <asm/fixmap.h>
34#include <asm/apicdef.h> 34#include <asm/apicdef.h>
35#include <asm/apic.h> 35#include <asm/apic.h>
36#include <asm/pgalloc.h>
36#include <asm/processor.h> 37#include <asm/processor.h>
37#include <asm/timer.h> 38#include <asm/timer.h>
38#include <asm/vmi_time.h> 39#include <asm/vmi_time.h>
@@ -272,19 +273,11 @@ static void *vmi_kmap_atomic_pte(struct page *page, enum km_type type)
272 void *va = kmap_atomic(page, type); 273 void *va = kmap_atomic(page, type);
273 274
274 /* 275 /*
275 * Internally, the VMI ROM must map virtual addresses to physical 276 * We disable highmem allocations for page tables so we should never
276 * addresses for processing MMU updates. By the time MMU updates 277 * see any calls to kmap_atomic_pte on a highmem page.
277 * are issued, this information is typically already lost.
278 * Fortunately, the VMI provides a cache of mapping slots for active
279 * page tables.
280 *
281 * We use slot zero for the linear mapping of physical memory, and
282 * in HIGHPTE kernels, slot 1 and 2 for KM_PTE0 and KM_PTE1.
283 *
284 * args: SLOT VA COUNT PFN
285 */ 278 */
286 BUG_ON(type != KM_PTE0 && type != KM_PTE1); 279
287 vmi_ops.set_linear_mapping((type - KM_PTE0)+1, va, 1, page_to_pfn(page)); 280 BUG_ON(PageHighmem(page));
288 281
289 return va; 282 return va;
290} 283}
@@ -640,6 +633,12 @@ static inline int __init activate_vmi(void)
640 u64 reloc; 633 u64 reloc;
641 const struct vmi_relocation_info *rel = (struct vmi_relocation_info *)&reloc; 634 const struct vmi_relocation_info *rel = (struct vmi_relocation_info *)&reloc;
642 635
636 /*
637 * Prevent page tables from being allocated in highmem, even if
638 * CONFIG_HIGHPTE is enabled.
639 */
640 __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
641
643 if (call_vrom_func(vmi_rom, vmi_init) != 0) { 642 if (call_vrom_func(vmi_rom, vmi_init) != 0) {
644 printk(KERN_ERR "VMI ROM failed to initialize!"); 643 printk(KERN_ERR "VMI ROM failed to initialize!");
645 return 0; 644 return 0;