diff options
author | Suraj Jitindar Singh <sjitindarsingh@gmail.com> | 2018-03-01 17:37:58 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-03-06 13:16:29 +1100 |
commit | cb931c2108a59db0b4a22f0c439ee7362c4f95ab (patch) | |
tree | d41e46c6a11bc87c814f6a92a45e0bfa2a680960 /target/ppc/kvm.c | |
parent | b6712ea39117c87de87b687ec4055e6ddbde9b37 (diff) | |
download | qemu-cb931c2108a59db0b4a22f0c439ee7362c4f95ab.zip qemu-cb931c2108a59db0b4a22f0c439ee7362c4f95ab.tar.gz qemu-cb931c2108a59db0b4a22f0c439ee7362c4f95ab.tar.bz2 |
target/ppc: Check mask when setting cap_ppc_safe_indirect_branch
Check the character and character_mask field when setting
cap_ppc_safe_indirect_branch based on the hypervisor response
to KVM_PPC_GET_CPU_CHAR. Previously the mask field wasn't checked
which was incorrect.
Fixes: 8acc2ae5 (target/ppc/kvm: Add cap_ppc_safe_[cache/bounds_check/indirect_branch])
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/kvm.c')
-rw-r--r-- | target/ppc/kvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 9842b3b..2c183f6 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2494,7 +2494,7 @@ static void kvmppc_get_cpu_characteristics(KVMState *s) cap_ppc_safe_bounds_check = 1; } /* Parse and set cap_ppc_safe_indirect_branch */ - if (c.character & H_CPU_CHAR_BCCTRL_SERIALISED) { + if (c.character & c.character_mask & H_CPU_CHAR_BCCTRL_SERIALISED) { cap_ppc_safe_indirect_branch = 2; } } |