Skip to content

Commit

Permalink
target/ppc: Check mask when setting cap_ppc_safe_indirect_branch
Browse files Browse the repository at this point in the history
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: 8acc2ae (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>
  • Loading branch information
sjitindarsingh authored and dgibson committed Mar 6, 2018
1 parent b6712ea commit cb931c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/ppc/kvm.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit cb931c2

Please sign in to comment.