aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>2013-08-06 05:25:41 -0400
committerIngo Molnar <mingo@kernel.org>2013-08-14 07:12:35 -0400
commit92b75202e5e8790905f9441ccaea2456cc4621a5 (patch)
treec683864840122de1b5490a70bcffd29bfd6af683 /arch/x86/include/asm
parent1e20eb8557cdabf76473b09572be8aa8a2bb9bc0 (diff)
kvm: Paravirtual ticketlocks support for linux guests running on KVM hypervisor
During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_PV_UNHALT) to support pv-ticketlocks. If so, support for pv-ticketlocks is registered via pv_lock_ops. Use KVM_HC_KICK_CPU hypercall to wakeup waiting/halted vcpu. Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20130810193849.GA25260@linux.vnet.ibm.com Signed-off-by: Suzuki Poulose <suzuki@in.ibm.com> [Raghu: check_zero race fix, enum for kvm_contention_stat, jumplabel related changes, addition of safe_halt for irq enabled case, bailout spinning in nmi case(Gleb)] Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Acked-by: Gleb Natapov <gleb@redhat.com> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/kvm_para.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index 695399f2d5eb..427afcbf3d55 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -118,10 +118,20 @@ void kvm_async_pf_task_wait(u32 token);
118void kvm_async_pf_task_wake(u32 token); 118void kvm_async_pf_task_wake(u32 token);
119u32 kvm_read_and_reset_pf_reason(void); 119u32 kvm_read_and_reset_pf_reason(void);
120extern void kvm_disable_steal_time(void); 120extern void kvm_disable_steal_time(void);
121#else 121
122#define kvm_guest_init() do { } while (0) 122#ifdef CONFIG_PARAVIRT_SPINLOCKS
123void __init kvm_spinlock_init(void);
124#else /* !CONFIG_PARAVIRT_SPINLOCKS */
125static inline void kvm_spinlock_init(void)
126{
127}
128#endif /* CONFIG_PARAVIRT_SPINLOCKS */
129
130#else /* CONFIG_KVM_GUEST */
131#define kvm_guest_init() do {} while (0)
123#define kvm_async_pf_task_wait(T) do {} while(0) 132#define kvm_async_pf_task_wait(T) do {} while(0)
124#define kvm_async_pf_task_wake(T) do {} while(0) 133#define kvm_async_pf_task_wake(T) do {} while(0)
134
125static inline u32 kvm_read_and_reset_pf_reason(void) 135static inline u32 kvm_read_and_reset_pf_reason(void)
126{ 136{
127 return 0; 137 return 0;