diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/vmi_32.c | 23 |
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; |