diff options
Diffstat (limited to 'arch/x86/kernel/vmi_32.c')
-rw-r--r-- | arch/x86/kernel/vmi_32.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index d430e4c30193..7dd599deca4a 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> |
@@ -266,30 +267,6 @@ static void vmi_nop(void) | |||
266 | { | 267 | { |
267 | } | 268 | } |
268 | 269 | ||
269 | #ifdef CONFIG_HIGHPTE | ||
270 | static void *vmi_kmap_atomic_pte(struct page *page, enum km_type type) | ||
271 | { | ||
272 | void *va = kmap_atomic(page, type); | ||
273 | |||
274 | /* | ||
275 | * Internally, the VMI ROM must map virtual addresses to physical | ||
276 | * addresses for processing MMU updates. By the time MMU updates | ||
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 | */ | ||
286 | BUG_ON(type != KM_PTE0 && type != KM_PTE1); | ||
287 | vmi_ops.set_linear_mapping((type - KM_PTE0)+1, va, 1, page_to_pfn(page)); | ||
288 | |||
289 | return va; | ||
290 | } | ||
291 | #endif | ||
292 | |||
293 | static void vmi_allocate_pte(struct mm_struct *mm, unsigned long pfn) | 270 | static void vmi_allocate_pte(struct mm_struct *mm, unsigned long pfn) |
294 | { | 271 | { |
295 | vmi_ops.allocate_page(pfn, VMI_PAGE_L1, 0, 0, 0); | 272 | vmi_ops.allocate_page(pfn, VMI_PAGE_L1, 0, 0, 0); |
@@ -640,6 +617,12 @@ static inline int __init activate_vmi(void) | |||
640 | u64 reloc; | 617 | u64 reloc; |
641 | const struct vmi_relocation_info *rel = (struct vmi_relocation_info *)&reloc; | 618 | const struct vmi_relocation_info *rel = (struct vmi_relocation_info *)&reloc; |
642 | 619 | ||
620 | /* | ||
621 | * Prevent page tables from being allocated in highmem, even if | ||
622 | * CONFIG_HIGHPTE is enabled. | ||
623 | */ | ||
624 | __userpte_alloc_gfp &= ~__GFP_HIGHMEM; | ||
625 | |||
643 | if (call_vrom_func(vmi_rom, vmi_init) != 0) { | 626 | if (call_vrom_func(vmi_rom, vmi_init) != 0) { |
644 | printk(KERN_ERR "VMI ROM failed to initialize!"); | 627 | printk(KERN_ERR "VMI ROM failed to initialize!"); |
645 | return 0; | 628 | return 0; |
@@ -778,10 +761,6 @@ static inline int __init activate_vmi(void) | |||
778 | 761 | ||
779 | /* Set linear is needed in all cases */ | 762 | /* Set linear is needed in all cases */ |
780 | vmi_ops.set_linear_mapping = vmi_get_function(VMI_CALL_SetLinearMapping); | 763 | vmi_ops.set_linear_mapping = vmi_get_function(VMI_CALL_SetLinearMapping); |
781 | #ifdef CONFIG_HIGHPTE | ||
782 | if (vmi_ops.set_linear_mapping) | ||
783 | pv_mmu_ops.kmap_atomic_pte = vmi_kmap_atomic_pte; | ||
784 | #endif | ||
785 | 764 | ||
786 | /* | 765 | /* |
787 | * These MUST always be patched. Don't support indirect jumps | 766 | * These MUST always be patched. Don't support indirect jumps |