diff options
27 files changed, 79 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/kvm_para.h b/arch/alpha/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/alpha/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/arm/include/asm/kvm_para.h b/arch/arm/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/arm/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/avr32/include/asm/kvm_para.h b/arch/avr32/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/avr32/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/blackfin/include/asm/kvm_para.h b/arch/blackfin/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/blackfin/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/c6x/include/asm/kvm_para.h b/arch/c6x/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/c6x/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/frv/include/asm/kvm_para.h b/arch/frv/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/frv/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/h8300/include/asm/kvm_para.h b/arch/h8300/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/h8300/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/hexagon/include/asm/kvm_para.h b/arch/hexagon/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/hexagon/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/ia64/include/asm/kvm_para.h b/arch/ia64/include/asm/kvm_para.h index 1588aee781a2..2019cb99335e 100644 --- a/arch/ia64/include/asm/kvm_para.h +++ b/arch/ia64/include/asm/kvm_para.h | |||
@@ -26,6 +26,11 @@ static inline unsigned int kvm_arch_para_features(void) | |||
26 | return 0; | 26 | return 0; |
27 | } | 27 | } |
28 | 28 | ||
29 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
30 | { | ||
31 | return false; | ||
32 | } | ||
33 | |||
29 | #endif | 34 | #endif |
30 | 35 | ||
31 | #endif | 36 | #endif |
diff --git a/arch/m68k/include/asm/kvm_para.h b/arch/m68k/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/m68k/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/microblaze/include/asm/kvm_para.h b/arch/microblaze/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/microblaze/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/mips/include/asm/kvm_para.h b/arch/mips/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/mips/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/mn10300/include/asm/kvm_para.h b/arch/mn10300/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/mn10300/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/openrisc/include/asm/kvm_para.h b/arch/openrisc/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/openrisc/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/parisc/include/asm/kvm_para.h b/arch/parisc/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/parisc/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index 7b754e743003..c18916bff689 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h | |||
@@ -206,6 +206,11 @@ static inline unsigned int kvm_arch_para_features(void) | |||
206 | return r; | 206 | return r; |
207 | } | 207 | } |
208 | 208 | ||
209 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
210 | { | ||
211 | return false; | ||
212 | } | ||
213 | |||
209 | #endif /* __KERNEL__ */ | 214 | #endif /* __KERNEL__ */ |
210 | 215 | ||
211 | #endif /* __POWERPC_KVM_PARA_H__ */ | 216 | #endif /* __POWERPC_KVM_PARA_H__ */ |
diff --git a/arch/s390/include/asm/kvm_para.h b/arch/s390/include/asm/kvm_para.h index 6964db226f83..a98832961035 100644 --- a/arch/s390/include/asm/kvm_para.h +++ b/arch/s390/include/asm/kvm_para.h | |||
@@ -149,6 +149,11 @@ static inline unsigned int kvm_arch_para_features(void) | |||
149 | return 0; | 149 | return 0; |
150 | } | 150 | } |
151 | 151 | ||
152 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
153 | { | ||
154 | return false; | ||
155 | } | ||
156 | |||
152 | #endif | 157 | #endif |
153 | 158 | ||
154 | #endif /* __S390_KVM_PARA_H */ | 159 | #endif /* __S390_KVM_PARA_H */ |
diff --git a/arch/score/include/asm/kvm_para.h b/arch/score/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/score/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/sh/include/asm/kvm_para.h b/arch/sh/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/sh/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/sparc/include/asm/kvm_para.h b/arch/sparc/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/sparc/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/tile/include/asm/kvm_para.h b/arch/tile/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/tile/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/um/include/asm/kvm_para.h b/arch/um/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/um/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/unicore32/include/asm/kvm_para.h b/arch/unicore32/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/unicore32/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 734c3767cfac..99c4bbe0cca2 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h | |||
@@ -95,6 +95,14 @@ struct kvm_vcpu_pv_apf_data { | |||
95 | extern void kvmclock_init(void); | 95 | extern void kvmclock_init(void); |
96 | extern int kvm_register_clock(char *txt); | 96 | extern int kvm_register_clock(char *txt); |
97 | 97 | ||
98 | #ifdef CONFIG_KVM_CLOCK | ||
99 | bool kvm_check_and_clear_guest_paused(void); | ||
100 | #else | ||
101 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
102 | { | ||
103 | return false; | ||
104 | } | ||
105 | #endif /* CONFIG_KVMCLOCK */ | ||
98 | 106 | ||
99 | /* This instruction is vmcall. On non-VT architectures, it will generate a | 107 | /* This instruction is vmcall. On non-VT architectures, it will generate a |
100 | * trap that we will then rewrite to the appropriate instruction. | 108 | * trap that we will then rewrite to the appropriate instruction. |
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index f8492da65bfc..4ba090ca689d 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/msr.h> | 22 | #include <asm/msr.h> |
23 | #include <asm/apic.h> | 23 | #include <asm/apic.h> |
24 | #include <linux/percpu.h> | 24 | #include <linux/percpu.h> |
25 | #include <linux/hardirq.h> | ||
25 | 26 | ||
26 | #include <asm/x86_init.h> | 27 | #include <asm/x86_init.h> |
27 | #include <asm/reboot.h> | 28 | #include <asm/reboot.h> |
@@ -114,6 +115,26 @@ static void kvm_get_preset_lpj(void) | |||
114 | preset_lpj = lpj; | 115 | preset_lpj = lpj; |
115 | } | 116 | } |
116 | 117 | ||
118 | bool kvm_check_and_clear_guest_paused(void) | ||
119 | { | ||
120 | bool ret = false; | ||
121 | struct pvclock_vcpu_time_info *src; | ||
122 | |||
123 | /* | ||
124 | * per_cpu() is safe here because this function is only called from | ||
125 | * timer functions where preemption is already disabled. | ||
126 | */ | ||
127 | WARN_ON(!in_atomic()); | ||
128 | src = &__get_cpu_var(hv_clock); | ||
129 | if ((src->flags & PVCLOCK_GUEST_STOPPED) != 0) { | ||
130 | __this_cpu_and(hv_clock.flags, ~PVCLOCK_GUEST_STOPPED); | ||
131 | ret = true; | ||
132 | } | ||
133 | |||
134 | return ret; | ||
135 | } | ||
136 | EXPORT_SYMBOL_GPL(kvm_check_and_clear_guest_paused); | ||
137 | |||
117 | static struct clocksource kvm_clock = { | 138 | static struct clocksource kvm_clock = { |
118 | .name = "kvm-clock", | 139 | .name = "kvm-clock", |
119 | .read = kvm_clock_get_cycles, | 140 | .read = kvm_clock_get_cycles, |
diff --git a/arch/xtensa/include/asm/kvm_para.h b/arch/xtensa/include/asm/kvm_para.h new file mode 100644 index 000000000000..14fab8f0b957 --- /dev/null +++ b/arch/xtensa/include/asm/kvm_para.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/kvm_para.h> | |||
diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h new file mode 100644 index 000000000000..05ef7e705939 --- /dev/null +++ b/include/asm-generic/kvm_para.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_GENERIC_KVM_PARA_H | ||
2 | #define _ASM_GENERIC_KVM_PARA_H | ||
3 | |||
4 | |||
5 | /* | ||
6 | * This function is used by architectures that support kvm to avoid issuing | ||
7 | * false soft lockup messages. | ||
8 | */ | ||
9 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
10 | { | ||
11 | return false; | ||
12 | } | ||
13 | |||
14 | #endif | ||