All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spapr/irq: Fix migration of older machine types with XIVE
@ 2019-09-25 16:07 Greg Kurz
  2019-09-26  1:38 ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2019-09-25 16:07 UTC (permalink / raw)
  To: David Gibson, Cédric Le Goater
  Cc: qemu-ppc, Satheesh Rajendran, qemu-devel

Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level"
broke migration of older machine types started with ic-mode=xive:

qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001300: Invalid argument
qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr'
qemu-system-ppc64: load of migration failed: Operation not permitted

This is because we should set the interrupt source in KVM at post load,
since we no longer do it unconditionaly at reset time for all interrupts.

Signed-off-by: Greg Kurz <groug@kaod.org>
---

David,

I guess you should probably fold this fix directly into Cedric's
patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid
bisection breakage.
---
 hw/intc/spapr_xive_kvm.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index 71b88d7797bc..2006f96aece1 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id)
             continue;
         }
 
+        /*
+         * We can only restore the source config if the source has been
+         * previously set in KVM. Since we don't do that for all interrupts
+         * at reset time anymore, let's do it now.
+         */
+        kvmppc_xive_source_reset_one(&xive->source, i, &local_err);
+        if (local_err) {
+            error_report_err(local_err);
+            return -1;
+        }
+
         kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err);
         if (local_err) {
             error_report_err(local_err);



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

* Re: [PATCH] spapr/irq: Fix migration of older machine types with XIVE
  2019-09-25 16:07 [PATCH] spapr/irq: Fix migration of older machine types with XIVE Greg Kurz
@ 2019-09-26  1:38 ` David Gibson
  2019-09-26  8:13   ` Greg Kurz
  0 siblings, 1 reply; 4+ messages in thread
From: David Gibson @ 2019-09-26  1:38 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-ppc, Satheesh Rajendran, Cédric Le Goater, qemu-devel

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

On Wed, Sep 25, 2019 at 06:07:40PM +0200, Greg Kurz wrote:
> Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level"
> broke migration of older machine types started with ic-mode=xive:
> 
> qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001300: Invalid argument
> qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr'
> qemu-system-ppc64: load of migration failed: Operation not permitted
> 
> This is because we should set the interrupt source in KVM at post load,
> since we no longer do it unconditionaly at reset time for all interrupts.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> 
> David,
> 
> I guess you should probably fold this fix directly into Cedric's
> patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid
> bisection breakage.

Done.

> ---
>  hw/intc/spapr_xive_kvm.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> index 71b88d7797bc..2006f96aece1 100644
> --- a/hw/intc/spapr_xive_kvm.c
> +++ b/hw/intc/spapr_xive_kvm.c
> @@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id)
>              continue;
>          }
>  
> +        /*
> +         * We can only restore the source config if the source has been
> +         * previously set in KVM. Since we don't do that for all interrupts
> +         * at reset time anymore, let's do it now.
> +         */
> +        kvmppc_xive_source_reset_one(&xive->source, i, &local_err);
> +        if (local_err) {
> +            error_report_err(local_err);
> +            return -1;
> +        }
> +
>          kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err);
>          if (local_err) {
>              error_report_err(local_err);
> 

-- 
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] 4+ messages in thread

* Re: [PATCH] spapr/irq: Fix migration of older machine types with XIVE
  2019-09-26  1:38 ` David Gibson
@ 2019-09-26  8:13   ` Greg Kurz
  2019-09-26 11:21     ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2019-09-26  8:13 UTC (permalink / raw)
  To: David Gibson
  Cc: qemu-ppc, Satheesh Rajendran, Cédric Le Goater, qemu-devel

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

On Thu, 26 Sep 2019 11:38:08 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Wed, Sep 25, 2019 at 06:07:40PM +0200, Greg Kurz wrote:
> > Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level"
> > broke migration of older machine types started with ic-mode=xive:
> > 
> > qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001300: Invalid argument
> > qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr'
> > qemu-system-ppc64: load of migration failed: Operation not permitted
> > 
> > This is because we should set the interrupt source in KVM at post load,
> > since we no longer do it unconditionaly at reset time for all interrupts.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > 
> > David,
> > 
> > I guess you should probably fold this fix directly into Cedric's
> > patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid
> > bisection breakage.
> 
> Done.
> 

Ok, I see it in ppc-for-4.2. Just one cosmetic nit, missing ']' in
the updated changelog:

[dwg: Folded in fix up from Greg Kurz

> > ---
> >  hw/intc/spapr_xive_kvm.c |   11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> > index 71b88d7797bc..2006f96aece1 100644
> > --- a/hw/intc/spapr_xive_kvm.c
> > +++ b/hw/intc/spapr_xive_kvm.c
> > @@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id)
> >              continue;
> >          }
> >  
> > +        /*
> > +         * We can only restore the source config if the source has been
> > +         * previously set in KVM. Since we don't do that for all interrupts
> > +         * at reset time anymore, let's do it now.
> > +         */
> > +        kvmppc_xive_source_reset_one(&xive->source, i, &local_err);
> > +        if (local_err) {
> > +            error_report_err(local_err);
> > +            return -1;
> > +        }
> > +
> >          kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err);
> >          if (local_err) {
> >              error_report_err(local_err);
> > 
> 


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

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

* Re: [PATCH] spapr/irq: Fix migration of older machine types with XIVE
  2019-09-26  8:13   ` Greg Kurz
@ 2019-09-26 11:21     ` David Gibson
  0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2019-09-26 11:21 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-ppc, Satheesh Rajendran, Cédric Le Goater, qemu-devel

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

On Thu, Sep 26, 2019 at 10:13:00AM +0200, Greg Kurz wrote:
65;5603;1c> On Thu, 26 Sep 2019 11:38:08 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Wed, Sep 25, 2019 at 06:07:40PM +0200, Greg Kurz wrote:
> > > Recent patch "spapr/irq: Only claim VALID interrupts at the KVM level"
> > > broke migration of older machine types started with ic-mode=xive:
> > > 
> > > qemu-system-ppc64: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001300: Invalid argument
> > > qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr'
> > > qemu-system-ppc64: load of migration failed: Operation not permitted
> > > 
> > > This is because we should set the interrupt source in KVM at post load,
> > > since we no longer do it unconditionaly at reset time for all interrupts.
> > > 
> > > Signed-off-by: Greg Kurz <groug@kaod.org>
> > > ---
> > > 
> > > David,
> > > 
> > > I guess you should probably fold this fix directly into Cedric's
> > > patch (currently SHA1 966d526cdfd9 in ppc-for-4.2) to avoid
> > > bisection breakage.
> > 
> > Done.
> > 
> 
> Ok, I see it in ppc-for-4.2. Just one cosmetic nit, missing ']' in
> the updated changelog:
> 
> [dwg: Folded in fix up from Greg Kurz

Fixed, thanks.
> 
> > > ---
> > >  hw/intc/spapr_xive_kvm.c |   11 +++++++++++
> > >  1 file changed, 11 insertions(+)
> > > 
> > > diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> > > index 71b88d7797bc..2006f96aece1 100644
> > > --- a/hw/intc/spapr_xive_kvm.c
> > > +++ b/hw/intc/spapr_xive_kvm.c
> > > @@ -678,6 +678,17 @@ int kvmppc_xive_post_load(SpaprXive *xive, int version_id)
> > >              continue;
> > >          }
> > >  
> > > +        /*
> > > +         * We can only restore the source config if the source has been
> > > +         * previously set in KVM. Since we don't do that for all interrupts
> > > +         * at reset time anymore, let's do it now.
> > > +         */
> > > +        kvmppc_xive_source_reset_one(&xive->source, i, &local_err);
> > > +        if (local_err) {
> > > +            error_report_err(local_err);
> > > +            return -1;
> > > +        }
> > > +
> > >          kvmppc_xive_set_source_config(xive, i, &xive->eat[i], &local_err);
> > >          if (local_err) {
> > >              error_report_err(local_err);
> > > 
> > 
> 



-- 
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] 4+ messages in thread

end of thread, other threads:[~2019-09-26 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25 16:07 [PATCH] spapr/irq: Fix migration of older machine types with XIVE Greg Kurz
2019-09-26  1:38 ` David Gibson
2019-09-26  8:13   ` Greg Kurz
2019-09-26 11:21     ` 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.