aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/paravirt.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-22 03:06:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-22 03:06:21 -0400
commit76c3bb15d6786a0b8da0ad0090e0c9c3672fc08b (patch)
tree3824e008db9d554229a70c85fbbc13238276bd7a /arch/x86/kernel/paravirt.c
parent7be42004065ce4df193aeef5befd26805267d0d9 (diff)
parent93ded9b8fd42abe2c3607097963d8de6ad9117eb (diff)
Merge branch 'linus' into x86/x2apic
Diffstat (limited to 'arch/x86/kernel/paravirt.c')
-rw-r--r--arch/x86/kernel/paravirt.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index e0f139106c7e..00c53a049756 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -29,6 +29,7 @@
29#include <asm/desc.h> 29#include <asm/desc.h>
30#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/arch_hooks.h> 31#include <asm/arch_hooks.h>
32#include <asm/pgtable.h>
32#include <asm/time.h> 33#include <asm/time.h>
33#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
@@ -123,6 +124,7 @@ static void *get_call_destination(u8 type)
123 .pv_irq_ops = pv_irq_ops, 124 .pv_irq_ops = pv_irq_ops,
124 .pv_apic_ops = pv_apic_ops, 125 .pv_apic_ops = pv_apic_ops,
125 .pv_mmu_ops = pv_mmu_ops, 126 .pv_mmu_ops = pv_mmu_ops,
127 .pv_lock_ops = pv_lock_ops,
126 }; 128 };
127 return *((void **)&tmpl + type); 129 return *((void **)&tmpl + type);
128} 130}
@@ -266,6 +268,17 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
266 return __get_cpu_var(paravirt_lazy_mode); 268 return __get_cpu_var(paravirt_lazy_mode);
267} 269}
268 270
271void __init paravirt_use_bytelocks(void)
272{
273#ifdef CONFIG_SMP
274 pv_lock_ops.spin_is_locked = __byte_spin_is_locked;
275 pv_lock_ops.spin_is_contended = __byte_spin_is_contended;
276 pv_lock_ops.spin_lock = __byte_spin_lock;
277 pv_lock_ops.spin_trylock = __byte_spin_trylock;
278 pv_lock_ops.spin_unlock = __byte_spin_unlock;
279#endif
280}
281
269struct pv_info pv_info = { 282struct pv_info pv_info = {
270 .name = "bare hardware", 283 .name = "bare hardware",
271 .paravirt_enabled = 0, 284 .paravirt_enabled = 0,
@@ -370,6 +383,9 @@ struct pv_mmu_ops pv_mmu_ops = {
370#ifndef CONFIG_X86_64 383#ifndef CONFIG_X86_64
371 .pagetable_setup_start = native_pagetable_setup_start, 384 .pagetable_setup_start = native_pagetable_setup_start,
372 .pagetable_setup_done = native_pagetable_setup_done, 385 .pagetable_setup_done = native_pagetable_setup_done,
386#else
387 .pagetable_setup_start = paravirt_nop,
388 .pagetable_setup_done = paravirt_nop,
373#endif 389#endif
374 390
375 .read_cr2 = native_read_cr2, 391 .read_cr2 = native_read_cr2,
@@ -443,6 +459,18 @@ struct pv_mmu_ops pv_mmu_ops = {
443 .set_fixmap = native_set_fixmap, 459 .set_fixmap = native_set_fixmap,
444}; 460};
445 461
462struct pv_lock_ops pv_lock_ops = {
463#ifdef CONFIG_SMP
464 .spin_is_locked = __ticket_spin_is_locked,
465 .spin_is_contended = __ticket_spin_is_contended,
466
467 .spin_lock = __ticket_spin_lock,
468 .spin_trylock = __ticket_spin_trylock,
469 .spin_unlock = __ticket_spin_unlock,
470#endif
471};
472EXPORT_SYMBOL_GPL(pv_lock_ops);
473
446EXPORT_SYMBOL_GPL(pv_time_ops); 474EXPORT_SYMBOL_GPL(pv_time_ops);
447EXPORT_SYMBOL (pv_cpu_ops); 475EXPORT_SYMBOL (pv_cpu_ops);
448EXPORT_SYMBOL (pv_mmu_ops); 476EXPORT_SYMBOL (pv_mmu_ops);