aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-05-30 20:24:27 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-02 07:24:40 -0400
commite2426cf85f8db5891fb5831323d2d0c176c4dadc (patch)
tree630dbc2032df606566f7249aa326c1e2a120c1ce /arch/x86/xen/enlighten.c
parent15ce60056b24a65b65e28de973a9fd8ac0750a2f (diff)
xen: avoid hypercalls when updating unpinned pud/pmd
When operating on an unpinned pagetable (ie, one under construction or destruction), it isn't necessary to use a hypercall to update a pud/pmd entry. Jan Beulich observed that a similar optimisation avoided many thousands of hypercalls while doing a kernel build. One tricky part is that early in the kernel boot there's no page structure, so we can't check to see if the page is pinned. In that case, we just always use the hypercall. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Jan Beulich <jbeulich@novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b94f63ac228b..ed9f04b3836d 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -901,6 +901,14 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
901 pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(base))); 901 pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(base)));
902} 902}
903 903
904static __init void xen_post_allocator_init(void)
905{
906 pv_mmu_ops.set_pmd = xen_set_pmd;
907 pv_mmu_ops.set_pud = xen_set_pud;
908
909 xen_mark_init_mm_pinned();
910}
911
904/* This is called once we have the cpu_possible_map */ 912/* This is called once we have the cpu_possible_map */
905void xen_setup_vcpu_info_placement(void) 913void xen_setup_vcpu_info_placement(void)
906{ 914{
@@ -988,7 +996,7 @@ static const struct pv_init_ops xen_init_ops __initdata = {
988 .banner = xen_banner, 996 .banner = xen_banner,
989 .memory_setup = xen_memory_setup, 997 .memory_setup = xen_memory_setup,
990 .arch_setup = xen_arch_setup, 998 .arch_setup = xen_arch_setup,
991 .post_allocator_init = xen_mark_init_mm_pinned, 999 .post_allocator_init = xen_post_allocator_init,
992}; 1000};
993 1001
994static const struct pv_time_ops xen_time_ops __initdata = { 1002static const struct pv_time_ops xen_time_ops __initdata = {
@@ -1100,7 +1108,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1100 1108
1101 .set_pte = NULL, /* see xen_pagetable_setup_* */ 1109 .set_pte = NULL, /* see xen_pagetable_setup_* */
1102 .set_pte_at = xen_set_pte_at, 1110 .set_pte_at = xen_set_pte_at,
1103 .set_pmd = xen_set_pmd, 1111 .set_pmd = xen_set_pmd_hyper,
1104 1112
1105 .pte_val = xen_pte_val, 1113 .pte_val = xen_pte_val,
1106 .pte_flags = native_pte_val, 1114 .pte_flags = native_pte_val,
@@ -1111,7 +1119,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1111 1119
1112 .set_pte_atomic = xen_set_pte_atomic, 1120 .set_pte_atomic = xen_set_pte_atomic,
1113 .set_pte_present = xen_set_pte_at, 1121 .set_pte_present = xen_set_pte_at,
1114 .set_pud = xen_set_pud, 1122 .set_pud = xen_set_pud_hyper,
1115 .pte_clear = xen_pte_clear, 1123 .pte_clear = xen_pte_clear,
1116 .pmd_clear = xen_pmd_clear, 1124 .pmd_clear = xen_pmd_clear,
1117 1125