From: David Gibson <david@gibson.dropbear.id.au>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Greg Kurz <groug@kaod.org>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
David Hildenbrand <david@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] spapr: Simulate CAS for qtest
Date: Mon, 4 Mar 2019 11:35:06 +1100 [thread overview]
Message-ID: <20190304003506.GD7792@umbus.fritz.box> (raw)
In-Reply-To: <155147961832.30057.4167728683124961502@sif>
[-- Attachment #1: Type: text/plain, Size: 3023 bytes --]
On Fri, Mar 01, 2019 at 04:33:38PM -0600, Michael Roth wrote:
> Quoting Greg Kurz (2019-03-01 13:32:37)
> > The RTAS event hotplug code for machine types 2.8 and newer depends on
> > the CAS negotiated ov5 in order to work properly. However, there's no
> > CAS when running under qtest. There has been a tentative to trick the
> > code by faking the OV5_HP_EVT bit, but it turned out to break other
> > assumptions in the code and the change got reverted.
> >
> > Go for a more general approach and simulate a CAS when running under
> > qtest. For simplicity, this pseudo CAS simple simulates the case where
> > the guest supports the same features as the machine. It is done at
> > reset time, just before we reset the DRCs, which could potentially
> > exercise the unplug code.
> >
> > This allows to test unplug on spapr with both older and newer machine
> > types.
> >
> > Suggested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > Signed-off-by: Greg Kurz <groug@kaod.org>
>
> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
>
> Thanks for sending this!
>
> Just now realizing we should probably apply the revert after this patch
> however, since the commit we're reverting fixes a `make check` test that
> is run by default, whereas this patch fixes one that only gets run if we
> run the tests with -m=slow specified.
>
> Maybe David can do that on his end?
Applied in reverse order as suggested to ppc-for-4.0. Thanks.
>
> > ---
> > hw/ppc/spapr.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index b6a571b6f184..6da64ef7ee2b 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -29,6 +29,7 @@
> > #include "qapi/visitor.h"
> > #include "sysemu/sysemu.h"
> > #include "sysemu/numa.h"
> > +#include "sysemu/qtest.h"
> > #include "hw/hw.h"
> > #include "qemu/log.h"
> > #include "hw/fw-path-provider.h"
> > @@ -1711,6 +1712,16 @@ static void spapr_machine_reset(void)
> > */
> > spapr_irq_reset(spapr, &error_fatal);
> >
> > + /*
> > + * There is no CAS under qtest. Simulate one to please the code that
> > + * depends on spapr->ov5_cas. This is especially needed to test device
> > + * unplug, so we do that before resetting the DRCs.
> > + */
> > + if (qtest_enabled()) {
> > + spapr_ovec_cleanup(spapr->ov5_cas);
> > + spapr->ov5_cas = spapr_ovec_clone(spapr->ov5);
> > + }
> > +
> > /* DRC reset may cause a device to be unplugged. This will cause troubles
> > * if this device is used by another device (eg, a running vhost backend
> > * will crash QEMU if the DIMM holding the vring goes away). To avoid such
> >
>
--
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 --]
prev parent reply other threads:[~2019-03-04 1:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 19:32 [Qemu-devel] [PATCH 0/2] spapr: Fix CPU unplug tests Greg Kurz
2019-03-01 19:32 ` [Qemu-devel] [PATCH 1/2] Revert "spapr: support memory unplug for qtest" Greg Kurz
2019-03-01 19:32 ` [Qemu-devel] [PATCH 2/2] spapr: Simulate CAS for qtest Greg Kurz
2019-03-01 22:33 ` Michael Roth
2019-03-04 0:35 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190304003506.GD7792@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=groug@kaod.org \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).