From: Anthony Liguori <anthony@codemonkey.ws>
To: Alexander Graf <agraf@suse.de>
Cc: Blue Swirl <blauwirbel@gmail.com>,
qemu-devel Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 01/13] [S390] Add hotplug support
Date: Sun, 13 Nov 2011 11:14:03 -0600 [thread overview]
Message-ID: <4EBFFADB.8070201@codemonkey.ws> (raw)
In-Reply-To: <1321198434-2347-2-git-send-email-agraf@suse.de>
On 11/13/2011 09:33 AM, Alexander Graf wrote:
> I just submitted a few patches that enable the s390 virtio bus to receive
> a hotplug add event. This patch implements the qemu side of it, so that new
> hotplug events can be submitted to the guest.
>
> Signed-off-by: Alexander Graf<agraf@suse.de>
How is this not a feature? This is adding hot plug support for virtio-s390, no?
Regards,
Anthony Liguori
>
> ---
>
> v1 -> v2:
>
> - make s390 virtio hoplug code emulate-capable
> ---
> hw/s390-virtio-bus.c | 24 +++++++++++++++++++-----
> hw/s390-virtio-bus.h | 5 +++++
> 2 files changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
> index 0ce6406..3760561 100644
> --- a/hw/s390-virtio-bus.c
> +++ b/hw/s390-virtio-bus.c
> @@ -82,12 +82,24 @@ VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
> bus->dev_offs = bus->dev_page;
> bus->next_ring = bus->dev_page + TARGET_PAGE_SIZE;
>
> + /* Enable hotplugging */
> + _bus->allow_hotplug = 1;
> +
> /* Allocate RAM for VirtIO device pages (descriptors, queues, rings) */
> *ram_size += S390_DEVICE_PAGES * TARGET_PAGE_SIZE;
>
> return bus;
> }
>
> +static void s390_virtio_irq(CPUState *env, int config_change, uint64_t token)
> +{
> + if (kvm_enabled()) {
> + kvm_s390_virtio_irq(env, config_change, token);
> + } else {
> + cpu_inject_ext(env, VIRTIO_EXT_CODE, config_change, token);
> + }
> +}
> +
> static int s390_virtio_device_init(VirtIOS390Device *dev, VirtIODevice *vdev)
> {
> VirtIOS390Bus *bus;
> @@ -109,6 +121,11 @@ static int s390_virtio_device_init(VirtIOS390Device *dev, VirtIODevice *vdev)
> dev->host_features = vdev->get_features(vdev, dev->host_features);
> s390_virtio_device_sync(dev);
>
> + if (dev->qdev.hotplugged) {
> + CPUState *env = s390_cpu_addr2state(0);
> + s390_virtio_irq(env, VIRTIO_PARAM_DEV_ADD, dev->dev_offs);
> + }
> +
> return 0;
> }
>
> @@ -313,11 +330,7 @@ static void virtio_s390_notify(void *opaque, uint16_t vector)
> uint64_t token = s390_virtio_device_vq_token(dev, vector);
> CPUState *env = s390_cpu_addr2state(0);
>
> - if (kvm_enabled()) {
> - kvm_s390_virtio_irq(env, 0, token);
> - } else {
> - cpu_inject_ext(env, VIRTIO_EXT_CODE, 0, token);
> - }
> + s390_virtio_irq(env, 0, token);
> }
>
> static unsigned virtio_s390_get_features(void *opaque)
> @@ -385,6 +398,7 @@ static void s390_virtio_bus_register_withprop(VirtIOS390DeviceInfo *info)
> {
> info->qdev.init = s390_virtio_busdev_init;
> info->qdev.bus_info =&s390_virtio_bus_info;
> + info->qdev.unplug = qdev_simple_unplug_cb;
>
> assert(info->qdev.size>= sizeof(VirtIOS390Device));
> qdev_register(&info->qdev);
> diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h
> index f1bece7..d02a907 100644
> --- a/hw/s390-virtio-bus.h
> +++ b/hw/s390-virtio-bus.h
> @@ -35,6 +35,11 @@
> #define VIRTIO_RING_LEN (TARGET_PAGE_SIZE * 3)
> #define S390_DEVICE_PAGES 512
>
> +#define VIRTIO_PARAM_MASK 0xff
> +#define VIRTIO_PARAM_VRING_INTERRUPT 0x0
> +#define VIRTIO_PARAM_CONFIG_CHANGED 0x1
> +#define VIRTIO_PARAM_DEV_ADD 0x2
> +
> typedef struct VirtIOS390Device {
> DeviceState qdev;
> ram_addr_t dev_offs;
next prev parent reply other threads:[~2011-11-13 17:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-13 15:33 [Qemu-devel] [PULL 00/13] s390 patch queue 2011-11-13 1.0 Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 01/13] [S390] Add hotplug support Alexander Graf
2011-11-13 17:14 ` Anthony Liguori [this message]
2011-11-13 17:23 ` Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 02/13] s390x: add ldeb instruction Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 03/13] s390x: make ipte 31-bit aware Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 04/13] s390x: update R and C bits in storage key Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 05/13] s390x: implement rrbe instruction properly Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 06/13] s390x: implement SIGP restart and shutdown Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 07/13] s390: fix reset hypercall to reset the status Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 08/13] s390: fix short kernel command lines Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 09/13] s390: Fix cpu shutdown for KVM Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 10/13] s390x: Add shutdown for TCG s390-virtio machine Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 11/13] tcg: Standardize on TCGReg as the enum for hard registers Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 12/13] tcg: Use TCGReg for standard tcg-target entry points Alexander Graf
2011-11-13 15:33 ` [Qemu-devel] [PATCH 13/13] s390x: initialize virtio dev region Alexander Graf
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=4EBFFADB.8070201@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=agraf@suse.de \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/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).