From 97905eb55273dac61e4d6ff300638c0b133e0f06 Mon Sep 17 00:00:00 2001 From: Suraj Jitindar Singh Date: Tue, 13 Mar 2018 05:21:31 +0100 Subject: [PATCH 09/17] target/ppc: Check mask when setting cap_ppc_safe_indirect_branch RH-Author: Suraj Jitindar Singh Message-id: <1520918499-27663-4-git-send-email-sursingh@redhat.com> Patchwork-id: 79249 O-Subject: [RHEL7.5 qemu-kvm-rhev PATCH 03/11] target/ppc: Check mask when setting cap_ppc_safe_indirect_branch Bugzilla: 1554957 RH-Acked-by: David Gibson RH-Acked-by: Laurent Vivier RH-Acked-by: Miroslav Rezanina From: Suraj Jitindar Singh 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 Signed-off-by: David Gibson (cherry picked from commit cb931c2108a59db0b4a22f0c439ee7362c4f95ab) Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1548919 Signed-off-by: Suraj Jitindar Singh Signed-off-by: Miroslav Rezanina --- target/ppc/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 7a7bc3b..4383953 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2511,7 +2511,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; } } -- 1.8.3.1