diff options
author | Zachary Amsden <zach@vmware.com> | 2007-03-05 03:30:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-05 10:57:52 -0500 |
commit | 9a1c13e91f100c12dcad3a1be1b12890bf32f6ff (patch) | |
tree | 9c132900f5b331570d91df515167776586fb2960 /arch/i386/kernel/vmi.c | |
parent | 1182d8528b620c23d043bccbbef092b42062960a (diff) |
[PATCH] vmi: fix highpte
Provide a PT map hook for HIGHPTE kernels to designate where they are mapping
page tables. This information is required so the physical address of PTE
updates can be determined; otherwise, the mm layer would have to carry the
physical address all the way to each PTE modification callsite, which is even
more hideous that the macros required to provide the proper hooks.
So lets not mess up arch neutral code to achieve this, but keep the horror in
an #ifdef HIGHPTE in include/asm-i386/pgtable.h. I had to use macros here
because some types are not yet defined in all the include paths for this
header.
This patch is absolutely required for HIGHPTE kernels to operate properly with
VMI.
Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386/kernel/vmi.c')
-rw-r--r-- | arch/i386/kernel/vmi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c index acdfe69fb7ad..bd1037bd124b 100644 --- a/arch/i386/kernel/vmi.c +++ b/arch/i386/kernel/vmi.c | |||
@@ -370,6 +370,24 @@ static void vmi_check_page_type(u32 pfn, int type) | |||
370 | #define vmi_check_page_type(p,t) do { } while (0) | 370 | #define vmi_check_page_type(p,t) do { } while (0) |
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | static void vmi_map_pt_hook(int type, pte_t *va, u32 pfn) | ||
374 | { | ||
375 | /* | ||
376 | * Internally, the VMI ROM must map virtual addresses to physical | ||
377 | * addresses for processing MMU updates. By the time MMU updates | ||
378 | * are issued, this information is typically already lost. | ||
379 | * Fortunately, the VMI provides a cache of mapping slots for active | ||
380 | * page tables. | ||
381 | * | ||
382 | * We use slot zero for the linear mapping of physical memory, and | ||
383 | * in HIGHPTE kernels, slot 1 and 2 for KM_PTE0 and KM_PTE1. | ||
384 | * | ||
385 | * args: SLOT VA COUNT PFN | ||
386 | */ | ||
387 | BUG_ON(type != KM_PTE0 && type != KM_PTE1); | ||
388 | vmi_ops.set_linear_mapping((type - KM_PTE0)+1, (u32)va, 1, pfn); | ||
389 | } | ||
390 | |||
373 | static void vmi_allocate_pt(u32 pfn) | 391 | static void vmi_allocate_pt(u32 pfn) |
374 | { | 392 | { |
375 | vmi_set_page_type(pfn, VMI_PAGE_L1); | 393 | vmi_set_page_type(pfn, VMI_PAGE_L1); |
@@ -813,6 +831,7 @@ static inline int __init activate_vmi(void) | |||
813 | vmi_ops.allocate_page = vmi_get_function(VMI_CALL_AllocatePage); | 831 | vmi_ops.allocate_page = vmi_get_function(VMI_CALL_AllocatePage); |
814 | vmi_ops.release_page = vmi_get_function(VMI_CALL_ReleasePage); | 832 | vmi_ops.release_page = vmi_get_function(VMI_CALL_ReleasePage); |
815 | 833 | ||
834 | paravirt_ops.map_pt_hook = vmi_map_pt_hook; | ||
816 | paravirt_ops.alloc_pt = vmi_allocate_pt; | 835 | paravirt_ops.alloc_pt = vmi_allocate_pt; |
817 | paravirt_ops.alloc_pd = vmi_allocate_pd; | 836 | paravirt_ops.alloc_pd = vmi_allocate_pd; |
818 | paravirt_ops.alloc_pd_clone = vmi_allocate_pd_clone; | 837 | paravirt_ops.alloc_pd_clone = vmi_allocate_pd_clone; |