From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Fam Zheng" <fam@euphon.net>,
"Collin Walling" <walling@linux.ibm.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Edgar Iglesias" <edgar.iglesias@xilinx.com>,
"Hannes Reinecke" <hare@suse.com>,
Qemu-block <qemu-block@nongnu.org>,
"David Hildenbrand" <david@redhat.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Alistair Francis" <alistair@alistair23.me>,
qemu-s390x <qemu-s390x@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>, "Cédric Le Goater" <clg@kaod.org>,
"John Snow" <jsnow@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
"Damien Hedde" <damien.hedde@greensocs.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Mark Burton" <mark.burton@greensocs.com>,
qemu-ppc <qemu-ppc@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 05/33] Switch to new api in qdev/bus
Date: Mon, 12 Aug 2019 20:34:19 +1000 [thread overview]
Message-ID: <20190812103419.GK3947@umbus.fritz.box> (raw)
In-Reply-To: <CAFEAcA-6GfpYPpafai1XX3u7d3RdTweEUqVwafcX+p6PvQJQpw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4051 bytes --]
On Fri, Aug 09, 2019 at 12:08:43PM +0100, Peter Maydell wrote:
> On Fri, 9 Aug 2019 at 01:10, David Gibson <david@gibson.dropbear.id.au> wrote:
> >
> > On Wed, Jul 31, 2019 at 01:31:28PM +0200, Philippe Mathieu-Daudé wrote:
> > > On 7/31/19 11:29 AM, Damien Hedde wrote:
> > > > On 7/31/19 8:05 AM, David Gibson wrote:
> > > >> On Mon, Jul 29, 2019 at 04:56:26PM +0200, Damien Hedde wrote:
> > > >>> @@ -922,7 +906,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
> > > >>> }
> > > >>> }
> > > >>> if (dev->hotplugged) {
> > > >>> - device_legacy_reset(dev);
> > > >>> + device_reset(dev, true);
> > > >>
> > > >> So.. is this change in the device_reset() signature really necessary?
> > > >> Even if there are compelling reasons to handle warm reset in the new
> > > >> API, that doesn't been you need to change device_reset() itself from
> > > >> its established meaning of a cold (i.e. as per power cycle) reset.
>
> So, I don't think that actually is the established meaning of
> device_reset(). I think our current semantics for this function are
> "reset of some sort, probably cold, but in practice called in
> lots of places which really wanted some other kind of reset,
> because our current reset semantics are not well-defined".
>
> For instance in s390-pci-inst.c the handling of CLP_SET_DISABLE_PCI_FN
> calls device_reset() on a device. I bet that's not really intentionally
> trying to model "we powered it off and on again".
> hw/scsi/vmw_pvscsi.c uses device_reset() in its handling of
> the guest "reset the SCSI bus" command. I know that isn't literally
> powering off the SCSI disks and powering them on again.
>
> The advantage of an actual API change here is that it means we go
> and look at all the call sites and find out what the semantics
> they actually wanted were, and hopefully that then feeds into the
> design of the new API and we make sure we can handle those
> semantics in a non-confused way.
That's a fair point.
> > > >> Warm resets are generally called in rather more specific circumstances
> > > >> (often under guest software direction) so it seems likely that users
> > > >> would want to engage with the new reset API directly. Or we could
> > > >> just create a device_warm_reset() wrapper. That would also avoid the
> > > >> bare boolean parameter, which is not great for readability (you have
> > > >> to look up the signature to have any idea what it means).
> > >
> > > If the boolean is not meaningful, we can use an enum...
> >
> > That's certainly better, but I'm not seeing a compelling reason not to
> > have separate function names. It's just as clear and means less churn.
>
> One advantage of an enum is that we have an extendable API,
> so we could say something like "all devices support reset types
> 'cold' and 'warm', but individual devices or families of devices
> can also support other kinds of reset". So the relevant s390
> devices could directly support the kinds of reset currently
> enumerated by the enum s390_reset, and then if you know you're
> dealing with an s390 device you can ask it to reset with the
> right semantics rather than fudging it with one of the generic ones.
> Or devices with "if I'm reset by the guest writing to a register then
> I reset less stuff than a reset via external reset line" have a
> way to model that.
Ok, I can see the value in that. I guess the way I'd prefer to
approach it though, is to start out with just a single-value enum for
(roughly) a cold reset. Then when we find a subset of devices for
which we can consistently define a warm reset of some type, we add an
enum value for it.
I guess we'd also need some way of introspecting what reset types are
supported by a device.
--
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 --]
next prev parent reply other threads:[~2019-08-12 13:57 UTC|newest]
Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 14:56 [Qemu-devel] [PATCH v3 00/33] Multi-phase reset mechanism Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 01/33] Create Resettable QOM interface Damien Hedde
2019-07-30 13:42 ` Cornelia Huck
2019-07-30 13:44 ` Peter Maydell
2019-07-30 13:55 ` Cornelia Huck
2019-07-30 13:59 ` Peter Maydell
2019-07-30 14:08 ` Damien Hedde
2019-07-30 15:47 ` Cornelia Huck
2019-07-31 5:46 ` David Gibson
2019-08-01 9:35 ` Damien Hedde
2019-08-12 10:27 ` David Gibson
2019-07-31 10:17 ` Christophe de Dinechin
2019-08-01 9:19 ` Damien Hedde
2019-08-01 9:30 ` Christophe de Dinechin
2019-08-07 14:20 ` Peter Maydell
2019-08-07 15:03 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 02/33] add temporary device_legacy_reset function to replace device_reset Damien Hedde
2019-08-07 14:27 ` Peter Maydell
2019-08-09 9:20 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 03/33] Replace all call to device_reset by call to device_legacy_reset Damien Hedde
2019-07-31 5:52 ` David Gibson
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 04/33] make Device and Bus Resettable Damien Hedde
2019-07-31 5:56 ` David Gibson
2019-07-31 9:09 ` Damien Hedde
2019-08-06 0:35 ` David Gibson
2019-08-07 7:55 ` Damien Hedde
2019-08-12 10:28 ` David Gibson
2019-08-07 14:41 ` Peter Maydell
2019-08-07 15:23 ` Damien Hedde
2019-08-07 15:28 ` Peter Maydell
2019-08-12 9:08 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 05/33] Switch to new api in qdev/bus Damien Hedde
2019-07-31 6:05 ` David Gibson
2019-07-31 9:29 ` Damien Hedde
2019-07-31 11:31 ` Philippe Mathieu-Daudé
2019-08-08 6:47 ` David Gibson
2019-08-09 11:08 ` Peter Maydell
2019-08-12 10:34 ` David Gibson [this message]
2019-08-08 6:48 ` David Gibson
2019-08-09 11:39 ` Cédric Le Goater
2019-08-12 10:36 ` David Gibson
2019-08-07 14:48 ` Peter Maydell
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 06/33] add the vmstate description for device reset state Damien Hedde
2019-07-31 6:08 ` David Gibson
2019-07-31 11:04 ` Damien Hedde
2019-08-07 14:53 ` Peter Maydell
2019-08-07 14:54 ` Peter Maydell
2019-08-07 15:27 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in devices Damien Hedde
2019-08-07 15:07 ` Peter Maydell
2019-08-07 17:22 ` Damien Hedde
2019-08-08 15:42 ` Dr. David Alan Gilbert
2019-08-09 10:07 ` Peter Maydell
2019-08-09 10:29 ` Damien Hedde
2019-08-09 10:32 ` Peter Maydell
2019-08-09 10:46 ` Damien Hedde
2019-08-09 13:02 ` Juan Quintela
2019-08-09 13:01 ` Juan Quintela
2019-08-09 13:50 ` Dr. David Alan Gilbert
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 08/33] Add function to control reset with gpio inputs Damien Hedde
2019-07-31 6:11 ` David Gibson
2019-07-31 10:09 ` Damien Hedde
2019-08-07 10:37 ` Peter Maydell
2019-08-09 5:51 ` David Gibson
2019-08-09 8:45 ` Damien Hedde
2019-08-12 10:29 ` David Gibson
2019-08-07 15:18 ` Peter Maydell
2019-08-07 16:56 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 09/33] add doc about Resettable interface Damien Hedde
2019-07-31 6:30 ` David Gibson
2019-07-31 10:05 ` Damien Hedde
2019-08-07 10:34 ` Peter Maydell
2019-08-08 6:49 ` David Gibson
2019-08-07 16:01 ` Peter Maydell
2019-08-12 10:15 ` David Gibson
2019-08-07 15:58 ` Peter Maydell
2019-08-07 16:02 ` Peter Maydell
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 10/33] vl.c: remove qbus_reset_all registration Damien Hedde
2019-08-07 15:20 ` Peter Maydell
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 11/33] hw/s390x/ipl.c: " Damien Hedde
2019-08-07 15:24 ` Peter Maydell
2019-08-08 10:25 ` Cornelia Huck
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 12/33] hw/pci/: remove qdev/qbus_reset_all call Damien Hedde
2019-08-07 15:31 ` Peter Maydell
2019-08-09 9:47 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 13/33] hw/scsi/: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 14/33] hw/s390x/s390-virtio-ccw.c: remove qdev_reset_all call Damien Hedde
2019-08-08 10:50 ` Cornelia Huck
2019-08-09 8:31 ` Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 15/33] hw/ide/piix.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 16/33] hw/input/adb.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 17/33] hw/usb/dev-uas.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 18/33] hw/audio/intel-hda.c: remove device_legacy_reset call Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 19/33] hw/sd/pl181.c & omap_mmc.c: " Damien Hedde
2019-07-31 15:48 ` Philippe Mathieu-Daudé
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 20/33] hw/hyperv/hyperv.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 21/33] hw/intc/spapr_xive.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 22/33] hw/ppc/pnv_psi.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 23/33] hw/scsi/vmw_pvscsi.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 24/33] hw/ppc/spapr: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 25/33] hw/i386/pc.c: " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 26/33] hw/s390x/s390-pci-inst.c: " Damien Hedde
2019-08-08 10:52 ` Cornelia Huck
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 27/33] hw/ide/microdrive.c: remove device_legacy_reset calls Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 28/33] qdev: Remove unused deprecated reset functions Damien Hedde
2019-08-07 15:29 ` Peter Maydell
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 29/33] hw/misc/zynq_slcr: use standard register definition Damien Hedde
2019-08-07 15:33 ` Peter Maydell
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 30/33] convert cadence_uart to 3-phases reset Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 31/33] Convert zynq's slcr " Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 32/33] Add uart reset support in zynq_slcr Damien Hedde
2019-07-29 14:56 ` [Qemu-devel] [PATCH v3 33/33] Connect the uart reset gpios in the zynq platform Damien Hedde
2019-07-30 10:14 ` [Qemu-devel] [PATCH v3 00/33] Multi-phase reset mechanism Cornelia Huck
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=20190812103419.GK3947@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=alistair@alistair23.me \
--cc=berrange@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=clg@kaod.org \
--cc=cohuck@redhat.com \
--cc=damien.hedde@greensocs.com \
--cc=david@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=hare@suse.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.burton@greensocs.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
--cc=walling@linux.ibm.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).