All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init()
@ 2021-05-28 20:16 Daniel Henrique Barboza
  2021-05-28 21:22 ` Ram Pai
  2021-05-29  5:48 ` David Gibson
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2021-05-28 20:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: linuxram, Daniel Henrique Barboza, qemu-ppc, groug, david

QEMU is failing to launch a CGS pSeries guest in a host that has PEF
support:

qemu-system-ppc64: ../softmmu/vl.c:2585: qemu_machine_creation_done: Assertion `machine->cgs->ready' failed.
Aborted

This is happening because we're not setting the cgs->ready flag that is
asserted in qemu_machine_creation_done() during machine start.

cgs->ready is set in s390_pv_kvm_init() and sev_kvm_init(). Let's set it
in kvmppc_svm_init() as well.

Reported-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/pef.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
index 573be3ed79..cc44d5e339 100644
--- a/hw/ppc/pef.c
+++ b/hw/ppc/pef.c
@@ -41,7 +41,7 @@ struct PefGuest {
     ConfidentialGuestSupport parent_obj;
 };
 
-static int kvmppc_svm_init(Error **errp)
+static int kvmppc_svm_init(ConfidentialGuestSupport *cgs, Error **errp)
 {
 #ifdef CONFIG_KVM
     static Error *pef_mig_blocker;
@@ -65,6 +65,8 @@ static int kvmppc_svm_init(Error **errp)
     /* NB: This can fail if --only-migratable is used */
     migrate_add_blocker(pef_mig_blocker, &error_fatal);
 
+    cgs->ready = true;
+
     return 0;
 #else
     g_assert_not_reached();
@@ -102,7 +104,7 @@ int pef_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
         return -1;
     }
 
-    return kvmppc_svm_init(errp);
+    return kvmppc_svm_init(cgs, errp);
 }
 
 int pef_kvm_reset(ConfidentialGuestSupport *cgs, Error **errp)
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init()
  2021-05-28 20:16 [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init() Daniel Henrique Barboza
@ 2021-05-28 21:22 ` Ram Pai
  2021-05-29  5:48 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Ram Pai @ 2021-05-28 21:22 UTC (permalink / raw)
  To: Daniel Henrique Barboza; +Cc: groug, qemu-ppc, qemu-devel, david

On Fri, May 28, 2021 at 05:16:19PM -0300, Daniel Henrique Barboza wrote:
> QEMU is failing to launch a CGS pSeries guest in a host that has PEF
> support:
> 
> qemu-system-ppc64: ../softmmu/vl.c:2585: qemu_machine_creation_done: Assertion `machine->cgs->ready' failed.
> Aborted
> 
> This is happening because we're not setting the cgs->ready flag that is
> asserted in qemu_machine_creation_done() during machine start.
> 
> cgs->ready is set in s390_pv_kvm_init() and sev_kvm_init(). Let's set it
> in kvmppc_svm_init() as well.
> 
> Reported-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>


Acked-by: Ram Pai <linuxram@us.ibm.com>

> ---
>  hw/ppc/pef.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
> index 573be3ed79..cc44d5e339 100644
..snip..


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init()
  2021-05-28 20:16 [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init() Daniel Henrique Barboza
  2021-05-28 21:22 ` Ram Pai
@ 2021-05-29  5:48 ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2021-05-29  5:48 UTC (permalink / raw)
  To: Daniel Henrique Barboza; +Cc: linuxram, qemu-ppc, qemu-devel, groug

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

On Fri, May 28, 2021 at 05:16:19PM -0300, Daniel Henrique Barboza wrote:
> QEMU is failing to launch a CGS pSeries guest in a host that has PEF
> support:
> 
> qemu-system-ppc64: ../softmmu/vl.c:2585: qemu_machine_creation_done: Assertion `machine->cgs->ready' failed.
> Aborted
> 
> This is happening because we're not setting the cgs->ready flag that is
> asserted in qemu_machine_creation_done() during machine start.
> 
> cgs->ready is set in s390_pv_kvm_init() and sev_kvm_init(). Let's set it
> in kvmppc_svm_init() as well.
> 
> Reported-by: Ram Pai <linuxram@us.ibm.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Oops, that's an embarrasing omission.  Applied to ppc-for-6.1.

> ---
>  hw/ppc/pef.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c
> index 573be3ed79..cc44d5e339 100644
> --- a/hw/ppc/pef.c
> +++ b/hw/ppc/pef.c
> @@ -41,7 +41,7 @@ struct PefGuest {
>      ConfidentialGuestSupport parent_obj;
>  };
>  
> -static int kvmppc_svm_init(Error **errp)
> +static int kvmppc_svm_init(ConfidentialGuestSupport *cgs, Error **errp)
>  {
>  #ifdef CONFIG_KVM
>      static Error *pef_mig_blocker;
> @@ -65,6 +65,8 @@ static int kvmppc_svm_init(Error **errp)
>      /* NB: This can fail if --only-migratable is used */
>      migrate_add_blocker(pef_mig_blocker, &error_fatal);
>  
> +    cgs->ready = true;
> +
>      return 0;
>  #else
>      g_assert_not_reached();
> @@ -102,7 +104,7 @@ int pef_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
>          return -1;
>      }
>  
> -    return kvmppc_svm_init(errp);
> +    return kvmppc_svm_init(cgs, errp);
>  }
>  
>  int pef_kvm_reset(ConfidentialGuestSupport *cgs, Error **errp)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-29  6:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 20:16 [PATCH 1/1] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init() Daniel Henrique Barboza
2021-05-28 21:22 ` Ram Pai
2021-05-29  5:48 ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.