* [PATCH] spapr/xive: remove redundant check in spapr_match_nvt()
@ 2020-01-06 16:32 Cédric Le Goater
2020-01-06 17:29 ` Greg Kurz
2020-01-07 0:00 ` David Gibson
0 siblings, 2 replies; 4+ messages in thread
From: Cédric Le Goater @ 2020-01-06 16:32 UTC (permalink / raw)
To: David Gibson; +Cc: Cédric Le Goater, qemu-ppc, Greg Kurz, qemu-devel
spapr_match_nvt() is a XIVE operation and it used by the machine to
look for a matching target when an event notification is being
delivered. An assert checks that spapr_match_nvt() is called only when
the machine has selected the XIVE interrupt mode but it is redundant
with the XIVE_PRESENTER() dynamic cast.
Apply the cast to spapr->active_intc and remove the assert.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/spapr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e62c89b3dd40..5008b7563173 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4198,19 +4198,19 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
}
+/*
+ * This is a XIVE only operation
+ */
static int spapr_match_nvt(XiveFabric *xfb, uint8_t format,
uint8_t nvt_blk, uint32_t nvt_idx,
bool cam_ignore, uint8_t priority,
uint32_t logic_serv, XiveTCTXMatch *match)
{
SpaprMachineState *spapr = SPAPR_MACHINE(xfb);
- XivePresenter *xptr = XIVE_PRESENTER(spapr->xive);
+ XivePresenter *xptr = XIVE_PRESENTER(spapr->active_intc);
XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr);
int count;
- /* This is a XIVE only operation */
- assert(spapr->active_intc == SPAPR_INTC(spapr->xive));
-
count = xpc->match_nvt(xptr, format, nvt_blk, nvt_idx, cam_ignore,
priority, logic_serv, match);
if (count < 0) {
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spapr/xive: remove redundant check in spapr_match_nvt()
2020-01-06 16:32 [PATCH] spapr/xive: remove redundant check in spapr_match_nvt() Cédric Le Goater
@ 2020-01-06 17:29 ` Greg Kurz
2020-01-07 0:00 ` David Gibson
2020-01-07 0:00 ` David Gibson
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2020-01-06 17:29 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Mon, 6 Jan 2020 17:32:07 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> spapr_match_nvt() is a XIVE operation and it used by the machine to
... and it "is" used by the machine...
> look for a matching target when an event notification is being
> delivered. An assert checks that spapr_match_nvt() is called only when
> the machine has selected the XIVE interrupt mode but it is redundant
> with the XIVE_PRESENTER() dynamic cast.
>
> Apply the cast to spapr->active_intc and remove the assert.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/spapr.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index e62c89b3dd40..5008b7563173 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -4198,19 +4198,19 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
> kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
> }
>
> +/*
> + * This is a XIVE only operation
> + */
> static int spapr_match_nvt(XiveFabric *xfb, uint8_t format,
> uint8_t nvt_blk, uint32_t nvt_idx,
> bool cam_ignore, uint8_t priority,
> uint32_t logic_serv, XiveTCTXMatch *match)
> {
> SpaprMachineState *spapr = SPAPR_MACHINE(xfb);
> - XivePresenter *xptr = XIVE_PRESENTER(spapr->xive);
> + XivePresenter *xptr = XIVE_PRESENTER(spapr->active_intc);
> XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr);
> int count;
>
> - /* This is a XIVE only operation */
> - assert(spapr->active_intc == SPAPR_INTC(spapr->xive));
> -
> count = xpc->match_nvt(xptr, format, nvt_blk, nvt_idx, cam_ignore,
> priority, logic_serv, match);
> if (count < 0) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spapr/xive: remove redundant check in spapr_match_nvt()
2020-01-06 16:32 [PATCH] spapr/xive: remove redundant check in spapr_match_nvt() Cédric Le Goater
2020-01-06 17:29 ` Greg Kurz
@ 2020-01-07 0:00 ` David Gibson
1 sibling, 0 replies; 4+ messages in thread
From: David Gibson @ 2020-01-07 0:00 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, Greg Kurz, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]
On Mon, Jan 06, 2020 at 05:32:07PM +0100, Cédric Le Goater wrote:
> spapr_match_nvt() is a XIVE operation and it used by the machine to
> look for a matching target when an event notification is being
> delivered. An assert checks that spapr_match_nvt() is called only when
> the machine has selected the XIVE interrupt mode but it is redundant
> with the XIVE_PRESENTER() dynamic cast.
>
> Apply the cast to spapr->active_intc and remove the assert.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Applied to ppc-for-5.0.
> ---
> hw/ppc/spapr.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index e62c89b3dd40..5008b7563173 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -4198,19 +4198,19 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
> kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
> }
>
> +/*
> + * This is a XIVE only operation
> + */
> static int spapr_match_nvt(XiveFabric *xfb, uint8_t format,
> uint8_t nvt_blk, uint32_t nvt_idx,
> bool cam_ignore, uint8_t priority,
> uint32_t logic_serv, XiveTCTXMatch *match)
> {
> SpaprMachineState *spapr = SPAPR_MACHINE(xfb);
> - XivePresenter *xptr = XIVE_PRESENTER(spapr->xive);
> + XivePresenter *xptr = XIVE_PRESENTER(spapr->active_intc);
> XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr);
> int count;
>
> - /* This is a XIVE only operation */
> - assert(spapr->active_intc == SPAPR_INTC(spapr->xive));
> -
> count = xpc->match_nvt(xptr, format, nvt_blk, nvt_idx, cam_ignore,
> priority, logic_serv, match);
> if (count < 0) {
--
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/xive: remove redundant check in spapr_match_nvt()
2020-01-06 17:29 ` Greg Kurz
@ 2020-01-07 0:00 ` David Gibson
0 siblings, 0 replies; 4+ messages in thread
From: David Gibson @ 2020-01-07 0:00 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, Cédric Le Goater, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2281 bytes --]
On Mon, Jan 06, 2020 at 06:29:31PM +0100, Greg Kurz wrote:
> On Mon, 6 Jan 2020 17:32:07 +0100
> Cédric Le Goater <clg@kaod.org> wrote:
>
> > spapr_match_nvt() is a XIVE operation and it used by the machine to
>
> ... and it "is" used by the machine...
Adjusted in my tree.
>
> > look for a matching target when an event notification is being
> > delivered. An assert checks that spapr_match_nvt() is called only when
> > the machine has selected the XIVE interrupt mode but it is redundant
> > with the XIVE_PRESENTER() dynamic cast.
> >
> > Apply the cast to spapr->active_intc and remove the assert.
> >
> > Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > ---
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
>
> > hw/ppc/spapr.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index e62c89b3dd40..5008b7563173 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -4198,19 +4198,19 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj,
> > kvm_irqchip_in_kernel() ? "in-kernel" : "emulated");
> > }
> >
> > +/*
> > + * This is a XIVE only operation
> > + */
> > static int spapr_match_nvt(XiveFabric *xfb, uint8_t format,
> > uint8_t nvt_blk, uint32_t nvt_idx,
> > bool cam_ignore, uint8_t priority,
> > uint32_t logic_serv, XiveTCTXMatch *match)
> > {
> > SpaprMachineState *spapr = SPAPR_MACHINE(xfb);
> > - XivePresenter *xptr = XIVE_PRESENTER(spapr->xive);
> > + XivePresenter *xptr = XIVE_PRESENTER(spapr->active_intc);
> > XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr);
> > int count;
> >
> > - /* This is a XIVE only operation */
> > - assert(spapr->active_intc == SPAPR_INTC(spapr->xive));
> > -
> > count = xpc->match_nvt(xptr, format, nvt_blk, nvt_idx, cam_ignore,
> > priority, logic_serv, match);
> > if (count < 0) {
>
--
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:[~2020-01-07 0:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 16:32 [PATCH] spapr/xive: remove redundant check in spapr_match_nvt() Cédric Le Goater
2020-01-06 17:29 ` Greg Kurz
2020-01-07 0:00 ` David Gibson
2020-01-07 0:00 ` 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.