From 3ded270a2697852a71961b45291519ae044f25e3 Mon Sep 17 00:00:00 2001 From: Janosch Frank Date: Thu, 22 Oct 2020 06:31:35 -0400 Subject: s390x: pv: Fix diag318 PV fencing Diag318 fencing needs to be determined on the current VM PV state and not on the state that the VM has when we create the CPU model. Fixes: fabdada935 ("s390: guest support for diagnose 0x318") Reported-by: Marc Hartmayer Signed-off-by: Janosch Frank Tested-by: Marc Hartmayer Reviewed-by: Christian Borntraeger Reviewed-by: Collin Walling Acked-by: David Hildenbrand Message-Id: <20201022103135.126033-3-frankja@linux.ibm.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'target/s390x/cpu_models.c') diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index ca484bfda7..461e0b8f4a 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #endif #include "qapi/qapi-commands-machine-target.h" +#include "hw/s390x/pv.h" #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ { \ @@ -238,6 +239,9 @@ bool s390_has_feat(S390Feat feat) } return 0; } + if (feat == S390_FEAT_DIAG_318 && s390_is_pv()) { + return false; + } return test_bit(feat, cpu->model->features); } -- cgit v1.2.3-55-g7522