aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2018-03-01 17:37:58 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-03-06 13:16:29 +1100
commitcb931c2108a59db0b4a22f0c439ee7362c4f95ab (patch)
treed41e46c6a11bc87c814f6a92a45e0bfa2a680960
parentb6712ea39117c87de87b687ec4055e6ddbde9b37 (diff)
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>
-rw-r--r--target/ppc/kvm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 9842b3bb12..2c183f61e2 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;
}
}