All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, Cornelia Huck <cohuck@redhat.com>,
	Collin Walling <walling@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 1/2] s390x/pci: Introduce unplug requests and split unplug handler
Date: Tue, 29 Jan 2019 14:31:24 +0100	[thread overview]
Message-ID: <7f7d8582-b6d2-b120-c768-8cc8350b416c@linux.ibm.com> (raw)
In-Reply-To: <20190121134249.16615-2-david@redhat.com>

On 21/01/2019 14:42, David Hildenbrand wrote:
> PCI on s390x is really weird and how it was modeled in QEMU might not have
> been the right choice. Anyhow, right now it is the case that:
> - Hotplugging a PCI device will silently create a zPCI device
>    (if none is provided)
> - Hotunplugging a zPCI device will unplug the PCI device (if any)
> - Hotunplugging a PCI device will unplug also the zPCI device
> As far as I can see, we can no longer change this behavior. But we
> should fix it.

hum, is it really a problem per se?

> 
> Both device types are handled via a single hotplug handler call. This
> is problematic for various reasons:
> 1. Unplugging via the zPCI device allows to unplug PCI bridges as
>     checks are not performed - bad.

bad

> 2. Unplugging via the zPCI device allows to unplug devices that are not
>     hot removable. (check performed in qdev_unplug()) - bad.

bad

> 3. Hotplug handler chains are not possible for the unplug case. In the
>     future, the machine might want to override hotplug handlers, to
>     process device specific stuff and to then branch off to the actual
>     hotplug handler. We need separate hotplug handler calls for both the
>     PCI and zPCI device to make this work reliably. All other PCI
>     implementations are already prepared to handle this correctly, only
>     s390x is missing.

ok

> 
> Therefore, introduce the unplug_request handler and properly perform
> unplug checks by redirecting to the separate unplug_request handlers.
> When finally unplugging, perform two separate hotplug_handler_unplug()
> calls, first for the PCI device, followed by the zPCI device. This now
> nicely splits unplugging paths for both devices.

hum, PCI device handle the backend, host side, while zPCI handle the 
front end, guest side.
So unplugging PCI first will deny the guest any possibility to smoothly 
relinquish a device.


Is it possible the other way around?

Regards,
Pierre

-- 
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany

  parent reply	other threads:[~2019-01-29 13:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 13:42 [Qemu-devel] [PATCH v3 0/2] s390x/pci: hotplug handler fixes and reworks David Hildenbrand
2019-01-21 13:42 ` [Qemu-devel] [PATCH v3 1/2] s390x/pci: Introduce unplug requests and split unplug handler David Hildenbrand
2019-01-23 11:03   ` Cornelia Huck
2019-01-23 11:08     ` David Hildenbrand
2019-01-28 11:27       ` Cornelia Huck
2019-01-29 13:31   ` Pierre Morel [this message]
2019-01-29 15:14     ` David Hildenbrand
2019-01-29 16:54       ` Pierre Morel
2019-01-29 20:27         ` David Hildenbrand
2019-01-30 19:52   ` [Qemu-devel] [qemu-s390x] " Collin Walling
2019-01-31  9:31     ` David Hildenbrand
2019-01-21 13:42 ` [Qemu-devel] [PATCH v3 2/2] s390x/pci: Unplug remaining devices on pcihost reset David Hildenbrand
2019-01-23 11:05   ` Cornelia Huck
2019-01-28 11:28     ` Cornelia Huck
2019-01-29  0:09       ` [Qemu-devel] [qemu-s390x] " Collin Walling
2019-01-29 10:24         ` David Hildenbrand
2019-01-29 13:50           ` Pierre Morel
2019-01-29 15:11             ` David Hildenbrand
2019-01-29 16:50               ` Pierre Morel
2019-01-29 18:20                 ` David Hildenbrand
2019-01-29 18:37                   ` Cornelia Huck
2019-01-29 18:42                   ` Collin Walling

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=7f7d8582-b6d2-b120-c768-8cc8350b416c@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@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 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.