yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch

a83cc2
From e496360f627cdc4202f185b63175ced08c8b1f07 Mon Sep 17 00:00:00 2001
a83cc2
From: Daniel Henrique Barboza <danielhb413@gmail.com>
a83cc2
Date: Wed, 23 Jun 2021 19:39:32 -0400
a83cc2
Subject: [PATCH 3/6] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init()
a83cc2
a83cc2
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
RH-MergeRequest: 22: Synchronize with RHEL-AV 8.5 release 23 to RHEL 9
a83cc2
RH-Commit: [2/5] b204f898d2333686e30b14c050ac7a9289670f23 (mrezanin/centos-src-qemu-kvm)
a83cc2
RH-Bugzilla: 1957194
a83cc2
a83cc2
QEMU is failing to launch a CGS pSeries guest in a host that has PEF
a83cc2
support:
a83cc2
a83cc2
qemu-system-ppc64: ../softmmu/vl.c:2585: qemu_machine_creation_done: Assertion `machine->cgs->ready' failed.
a83cc2
Aborted
a83cc2
a83cc2
This is happening because we're not setting the cgs->ready flag that is
a83cc2
asserted in qemu_machine_creation_done() during machine start.
a83cc2
a83cc2
cgs->ready is set in s390_pv_kvm_init() and sev_kvm_init(). Let's set it
a83cc2
in kvmppc_svm_init() as well.
a83cc2
a83cc2
Reported-by: Ram Pai <linuxram@us.ibm.com>
a83cc2
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
a83cc2
Message-Id: <20210528201619.52363-1-danielhb413@gmail.com>
a83cc2
Acked-by: Ram Pai <linuxram@us.ibm.com>
a83cc2
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
a83cc2
(cherry picked from commit b873ed83311d96644b544b10f6869a430660585a)
a83cc2
Signed-off-by: Daniel Henrique Barboza <dbarboza@redhat.com>
a83cc2
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 hw/ppc/pef.c | 6 ++++--
a83cc2
 1 file changed, 4 insertions(+), 2 deletions(-)
a83cc2
a83cc2
diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
a83cc2
index 573be3ed79..cc44d5e339 100644
a83cc2
--- a/hw/ppc/pef.c
a83cc2
+++ b/hw/ppc/pef.c
a83cc2
@@ -41,7 +41,7 @@ struct PefGuest {
a83cc2
     ConfidentialGuestSupport parent_obj;
a83cc2
 };
a83cc2
 
a83cc2
-static int kvmppc_svm_init(Error **errp)
a83cc2
+static int kvmppc_svm_init(ConfidentialGuestSupport *cgs, Error **errp)
a83cc2
 {
a83cc2
 #ifdef CONFIG_KVM
a83cc2
     static Error *pef_mig_blocker;
a83cc2
@@ -65,6 +65,8 @@ static int kvmppc_svm_init(Error **errp)
a83cc2
     /* NB: This can fail if --only-migratable is used */
a83cc2
     migrate_add_blocker(pef_mig_blocker, &error_fatal);
a83cc2
 
a83cc2
+    cgs->ready = true;
a83cc2
+
a83cc2
     return 0;
a83cc2
 #else
a83cc2
     g_assert_not_reached();
a83cc2
@@ -102,7 +104,7 @@ int pef_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
a83cc2
         return -1;
a83cc2
     }
a83cc2
 
a83cc2
-    return kvmppc_svm_init(errp);
a83cc2
+    return kvmppc_svm_init(cgs, errp);
a83cc2
 }
a83cc2
 
a83cc2
 int pef_kvm_reset(ConfidentialGuestSupport *cgs, Error **errp)
a83cc2
-- 
a83cc2
2.27.0
a83cc2