[Qemu-devel] [PATCH] ppc/pnv: fix StoreEOI activation

Cédric Le Goater posted 1 patch 2 weeks ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190612162357.29566-1-clg@kaod.org
Maintainers: "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>
hw/intc/pnv_xive.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

[Qemu-devel] [PATCH] ppc/pnv: fix StoreEOI activation

Posted by Cédric Le Goater 2 weeks ago
The firmware (skiboot) of the PowerNV machines can configure the XIVE
interrupt controller to activate StoreEOI on the ESB pages of the
interrupts. This feature lets software do an EOI with a store instead
of a load. It is not activated today on P9 for rare race condition
issues but it should be on future processors.

Nevertheless, QEMU has a model for StoreEOI which can be used today by
experimental firmwares. But, the use of object_property_set_int() in
the PnvXive model is incorrect and crashes QEMU. Replace it with a
direct access to the ESB flags of the XiveSource object modeling the
internal sources of the interrupt controller.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/intc/pnv_xive.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index bb0877cbdf3b..12c91adcd27e 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -780,8 +780,7 @@ static void pnv_xive_ic_reg_write(void *opaque, hwaddr offset,
          * support recently though)
          */
         if (val & (VC_SBC_CONF_CPLX_CIST | VC_SBC_CONF_CIST_BOTH)) {
-            object_property_set_int(OBJECT(&xive->ipi_source),
-                                    XIVE_SRC_STORE_EOI, "flags", &error_fatal);
+            xive->ipi_source.esb_flags |= XIVE_SRC_STORE_EOI;
         }
         break;
 
-- 
2.21.0


Re: [Qemu-devel] [PATCH] ppc/pnv: fix StoreEOI activation

Posted by David Gibson 2 weeks ago
On Wed, Jun 12, 2019 at 06:23:57PM +0200, Cédric Le Goater wrote:
> The firmware (skiboot) of the PowerNV machines can configure the XIVE
> interrupt controller to activate StoreEOI on the ESB pages of the
> interrupts. This feature lets software do an EOI with a store instead
> of a load. It is not activated today on P9 for rare race condition
> issues but it should be on future processors.
> 
> Nevertheless, QEMU has a model for StoreEOI which can be used today by
> experimental firmwares. But, the use of object_property_set_int() in
> the PnvXive model is incorrect and crashes QEMU. Replace it with a
> direct access to the ESB flags of the XiveSource object modeling the
> internal sources of the interrupt controller.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied, thanks.

> ---
>  hw/intc/pnv_xive.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
> index bb0877cbdf3b..12c91adcd27e 100644
> --- a/hw/intc/pnv_xive.c
> +++ b/hw/intc/pnv_xive.c
> @@ -780,8 +780,7 @@ static void pnv_xive_ic_reg_write(void *opaque, hwaddr offset,
>           * support recently though)
>           */
>          if (val & (VC_SBC_CONF_CPLX_CIST | VC_SBC_CONF_CIST_BOTH)) {
> -            object_property_set_int(OBJECT(&xive->ipi_source),
> -                                    XIVE_SRC_STORE_EOI, "flags", &error_fatal);
> +            xive->ipi_source.esb_flags |= XIVE_SRC_STORE_EOI;
>          }
>          break;
>  

-- 
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