From: David Hildenbrand <david@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Pankaj Gupta <pagupta@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Cornelia Huck <cohuck@redhat.com>, Alexander Graf <agraf@suse.de>,
Markus Armbruster <armbru@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
qemu-s390x@nongnu.org, qemu-ppc@nongnu.org,
Marcel Apfelbaum <marcel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers
Date: Fri, 8 Jun 2018 11:57:00 +0200 [thread overview]
Message-ID: <2072bd49-adc5-77e2-ef02-d2580911a50f@redhat.com> (raw)
In-Reply-To: <20180601141341.2d0f7ee0@redhat.com>
On 01.06.2018 14:13, Igor Mammedov wrote:
> On Fri, 25 May 2018 14:43:39 +0200
> David Hildenbrand <david@redhat.com> wrote:
>
>> On 17.05.2018 10:15, David Hildenbrand wrote:
>>> We can have devices that need certain other resources that are e.g.
>>> system resources managed by the machine. We need a clean way to assign
>>> these resources (without violating layers as brought up by Igor).
>>>
>>> One example is virtio-mem/virtio-pmem. Both device types need to be
>>> assigned some region in guest physical address space. This device memory
>>> belongs to the machine and is managed by it. However, virito devices are
>>> hotplugged using the hotplug handler their proxy device implements. So we
>>> could trigger e.g. a PCI hotplug handler for virtio-pci or a CSS/CCW
>>> hotplug handler for virtio-ccw. But definetly not the machine.
>>>
>>> Now, we can route other devices through the machine hotplug handler, to
>>> properly assign/unassign resources - like a portion in guest physical
>>> address space.
>
> To sum up review:
> Some comments apply to several patches even though I commented only once.
>
> I'd suggest to restructure and split series into several:
> * unplug cleanups 08/14 & co
> * generic _preplug refactoring so we won't have to go back to that question again
Looking into the details, I don't think this is possible and should be
done for address asignment. It can be done for the node. Here is the
reason why:
In pre_plug(), we acccess a device before it has been realized. This is
okay, as long as we are using "direct properties" like the "node", that
won't be touched during realize.
However, for address detection we need access to the memory region. This
is a "derived property", as it is based on the "memdev" property.
While we can easily verify the validity of "memdev" in the pc_dimm
pre_plug handler (instead of doing that in pc_dimm_realize()), we cannot
access the memory region itself before the device has been realized
using get_memory_region() in all cases.
While this works for PC_DIMM (pc_dimm_get_memory_region() is only based
on dimm->hostmem, which we can verify as stated), we cannot do the same
thing for NVDIMM, because nvdimm_get_memory_region() relies on "realize"
already being called and setting up "nvdimm->nvdimm_mr".
In short: we should call device functions only after realize(),
therefore address assignment is not possible during pre_plug.
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2018-06-08 9:57 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 8:15 [Qemu-devel] [PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 01/14] memory-device: drop assert related to align and start of address space David Hildenbrand
2018-05-29 13:27 ` Igor Mammedov
2018-05-29 16:02 ` David Hildenbrand
2018-05-30 12:57 ` Igor Mammedov
2018-05-30 14:06 ` David Hildenbrand
2018-05-31 13:54 ` Igor Mammedov
2018-06-04 10:53 ` David Hildenbrand
2018-06-07 13:26 ` Igor Mammedov
2018-06-07 14:12 ` David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 02/14] memory-device: introduce separate config option David Hildenbrand
2018-05-30 12:58 ` Igor Mammedov
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 03/14] qdev: let machine hotplug handler to override bus hotplug handler David Hildenbrand
2018-06-05 1:02 ` David Gibson
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 04/14] pc: prepare for multi stage hotplug handlers David Hildenbrand
2018-05-30 13:08 ` Igor Mammedov
2018-05-30 14:13 ` David Hildenbrand
2018-05-31 14:13 ` Igor Mammedov
2018-06-04 11:27 ` David Hildenbrand
2018-06-07 13:44 ` Igor Mammedov
2018-06-07 14:00 ` David Hildenbrand
2018-06-08 12:24 ` Igor Mammedov
2018-06-08 12:32 ` David Hildenbrand
2018-06-08 12:55 ` Michael S. Tsirkin
2018-06-08 13:07 ` David Hildenbrand
2018-06-08 15:12 ` Michael S. Tsirkin
2018-06-13 10:58 ` David Hildenbrand
2018-06-13 15:48 ` Igor Mammedov
2018-06-13 15:51 ` David Hildenbrand
2018-06-13 18:32 ` Michael S. Tsirkin
2018-06-13 19:37 ` David Hildenbrand
2018-06-13 22:05 ` Michael S. Tsirkin
2018-06-14 6:14 ` David Hildenbrand
2018-06-14 9:16 ` Igor Mammedov
2018-06-14 9:20 ` Igor Mammedov
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 05/14] pc: route all memory devices through the machine hotplug handler David Hildenbrand
2018-05-30 13:12 ` Igor Mammedov
2018-05-30 14:08 ` David Hildenbrand
2018-05-30 14:27 ` Paolo Bonzini
2018-05-30 14:31 ` David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 06/14] spapr: prepare for multi stage hotplug handlers David Hildenbrand
2018-05-17 12:43 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2018-06-01 10:33 ` [Qemu-devel] " Igor Mammedov
2018-06-05 1:08 ` David Gibson
2018-06-05 7:51 ` David Hildenbrand
2018-06-07 14:26 ` Igor Mammedov
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 07/14] spapr: route all memory devices through the machine hotplug handler David Hildenbrand
2018-06-05 1:09 ` David Gibson
2018-06-05 7:51 ` David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 08/14] spapr: handle pc-dimm unplug via hotplug handler chain David Hildenbrand
2018-06-01 10:53 ` Igor Mammedov
2018-06-05 1:12 ` David Gibson
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 09/14] spapr: handle cpu core " David Hildenbrand
2018-06-01 10:57 ` Igor Mammedov
2018-06-05 1:13 ` David Gibson
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 10/14] memory-device: new functions to handle plug/unplug David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 11/14] pc-dimm: implement new memory device functions David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 12/14] memory-device: factor out pre-plug into hotplug handler David Hildenbrand
2018-06-01 11:17 ` Igor Mammedov
2018-06-04 11:45 ` David Hildenbrand
2018-06-07 15:00 ` Igor Mammedov
2018-06-07 15:10 ` David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 13/14] memory-device: factor out unplug " David Hildenbrand
2018-06-01 11:31 ` Igor Mammedov
2018-06-04 15:54 ` David Hildenbrand
2018-05-17 8:15 ` [Qemu-devel] [PATCH v4 14/14] memory-device: factor out plug " David Hildenbrand
2018-06-01 11:39 ` Igor Mammedov
2018-06-04 11:47 ` David Hildenbrand
2018-06-07 10:44 ` [Qemu-devel] [qemu-s390x] " David Hildenbrand
2018-05-25 12:43 ` [Qemu-devel] [qemu-s390x] [PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers David Hildenbrand
2018-05-30 14:03 ` Paolo Bonzini
2018-05-31 11:47 ` Igor Mammedov
2018-05-31 11:50 ` Paolo Bonzini
2018-06-01 12:13 ` Igor Mammedov
2018-06-04 10:03 ` David Hildenbrand
2018-06-08 9:57 ` David Hildenbrand [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=2072bd49-adc5-77e2-ef02-d2580911a50f@redhat.com \
--to=david@redhat.com \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=pagupta@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
/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).