From: David Hildenbrand <david@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring
Date: Mon, 23 Jul 2018 19:53:22 +0200 [thread overview]
Message-ID: <1b31dbfd-c1c0-8f18-f82b-f044e1a88c5b@redhat.com> (raw)
In-Reply-To: <20180723162355.55212c75@redhat.com>
On 23.07.2018 16:23, Igor Mammedov wrote:
> On Thu, 5 Jul 2018 13:59:32 +0200
> David Hildenbrand <david@redhat.com> wrote:
>
>> This is another part of the original series
>> [PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers
>> And is based on
>> [PATCH v3 0/4] pc-dimm: pre_plug "slot" and "addr" assignment
>>
>> This series completes refactoring of pre_plug, plug and unplug logic of
>> memory devices. With this as a basis, one can easily have e.g. virtio
>> based memory devices (virtio-mem, virtio-pmem, virtio-fs?) with minor
>> modifications on e.g. x86 and s390x.
>>
>> Unfortunately, the "addr" property is already used for virtio devices, so
>> we will have to deal with device specific properties. So
>> set_addr() for memory devices is introduced to handle that (we already
>> have get_addr()).
>>
>> The only way I see to avoid that would be for virtio based devices to
>> introduce an indirection:
>>
>> E.g. right now for my virtio-mem prototype:
>> ... -object memory-backend-ram,id=mem0,size=8G \
>> -device virtio-mem-pci,id=vm0,memdev=mem0,node=0,phys-addr=0x12345
> Though it seems inconvenient to have different property name,
> it is not dimm device (even though it shares GPA resource)
> so it is fine for it to have it's own set of properties.
> (might make error reporting a bit ugly)
Same opinion here, that's why I prefer this approach.
>
> Also what about usecase of mmio based virtio (ARM)?
Can you elaborate?
>
>
>> To something like:
>> ... -object memory-backend-ram,id=mem0,size=8G \
>> -object virtio-mem-backend,id=vmb0,memdev=mem0,addr=0x12345 \
>> -device virtio-mem-pci,id=vm0,vmem=vmb0 \
> it's broken conceptually,
> backends should deal only with host resource allocation while
> 'addr' is device model property and belongs to a frontend.
Agreed.
>
>> Or something like (that might be interesting for virtio-pmem):
>> ... -device virtio-mem-pci \ /* a virtio-mem bus */
>> -object memory-backend-ram,id=mem0,size=8G \
>> -device virtio-mem-backend,memdev=mem0,addr=0x12345 \
> did you mean ^^^^ virtio-pmem device?
>
> Is it a separate controller and memory resource design
> connected together somehow?
Yes, for this example s/mem/pmem/ of course (copy paste). virtio-mem and
virtio-pmem are two separate device types with their own set of
controllers (if any).
I favor the original approach (above).
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2018-07-23 17:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 11:59 [Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 01/11] memory-device: fix error message when hinted address is too small David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 02/11] memory-device: introduce separate config option David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 03/11] memory-device: get_region_size()/get_plugged_size() might fail David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 04/11] memory-device: convert get_region_size() to get_memory_region() David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 05/11] memory-device: document MemoryDeviceClass David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 06/11] memory-device: add device class function set_addr() David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 07/11] pc-dimm: implement memory " David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 08/11] memory-device: complete factoring out pre_plug handling David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 09/11] memory-device: complete factoring out plug handling David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 10/11] memory-device: complete factoring out unplug handling David Hildenbrand
2018-07-05 11:59 ` [Qemu-devel] [PATCH v1 11/11] memory-device: trace when pre_assigning/assigning/unassigning addresses David Hildenbrand
2018-07-23 14:23 ` [Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring Igor Mammedov
2018-07-23 17:53 ` 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=1b31dbfd-c1c0-8f18-f82b-f044e1a88c5b@redhat.com \
--to=david@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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).