aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2015-03-27 23:21:09 -0400
committerAlexander Graf <agraf@suse.de>2015-04-21 09:21:33 -0400
commit7d6c40da198ac18bd5dd2cd18628d5b4c615d842 (patch)
tree2c2e25ea051d2a569ae8332742fb27f59dff5eb3 /arch/powerpc/include
parentfd6d53b12410b4b73e3996629350dee3f4a7994f (diff)
KVM: PPC: Book3S HV: Use bitmap of active threads rather than count
Currently, the entry_exit_count field in the kvmppc_vcore struct contains two 8-bit counts, one of the threads that have started entering the guest, and one of the threads that have started exiting the guest. This changes it to an entry_exit_map field which contains two bitmaps of 8 bits each. The advantage of doing this is that it gives us a bitmap of which threads need to be signalled when exiting the guest. That means that we no longer need to use the trick of setting the HDEC to 0 to pull the other threads out of the guest, which led in some cases to a spurious HDEC interrupt on the next guest entry. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/kvm_host.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 1517faac9b98..d67a83830bd1 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -263,15 +263,15 @@ struct kvm_arch {
263 263
264/* 264/*
265 * Struct for a virtual core. 265 * Struct for a virtual core.
266 * Note: entry_exit_count combines an entry count in the bottom 8 bits 266 * Note: entry_exit_map combines a bitmap of threads that have entered
267 * and an exit count in the next 8 bits. This is so that we can 267 * in the bottom 8 bits and a bitmap of threads that have exited in the
268 * atomically increment the entry count iff the exit count is 0 268 * next 8 bits. This is so that we can atomically set the entry bit
269 * without taking the lock. 269 * iff the exit map is 0 without taking a lock.
270 */ 270 */
271struct kvmppc_vcore { 271struct kvmppc_vcore {
272 int n_runnable; 272 int n_runnable;
273 int num_threads; 273 int num_threads;
274 int entry_exit_count; 274 int entry_exit_map;
275 int napping_threads; 275 int napping_threads;
276 int first_vcpuid; 276 int first_vcpuid;
277 u16 pcpu; 277 u16 pcpu;
@@ -296,8 +296,9 @@ struct kvmppc_vcore {
296 ulong conferring_threads; 296 ulong conferring_threads;
297}; 297};
298 298
299#define VCORE_ENTRY_COUNT(vc) ((vc)->entry_exit_count & 0xff) 299#define VCORE_ENTRY_MAP(vc) ((vc)->entry_exit_map & 0xff)
300#define VCORE_EXIT_COUNT(vc) ((vc)->entry_exit_count >> 8) 300#define VCORE_EXIT_MAP(vc) ((vc)->entry_exit_map >> 8)
301#define VCORE_IS_EXITING(vc) (VCORE_EXIT_MAP(vc) != 0)
301 302
302/* Values for vcore_state */ 303/* Values for vcore_state */
303#define VCORE_INACTIVE 0 304#define VCORE_INACTIVE 0