qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Li Qiang <liq3ea@gmail.com>, Alexander Bulekov <alxndr@bu.edu>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Daniel P. Berrange" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	"Li Qiang" <liq3ea@163.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Qemu Developers" <qemu-devel@nongnu.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [RFC 1/4] memory: add memory_region_init_io_with_dev interface
Date: Mon, 14 Sep 2020 10:37:38 +0800	[thread overview]
Message-ID: <9b4546b1-d138-2110-0b18-dea7f2e8b188@redhat.com> (raw)
In-Reply-To: <CAKXe6SKfm8otRMHW5p+u_evr_XoctyM_HO42ouXhM11DbWbaCA@mail.gmail.com>


On 2020/9/10 下午10:37, Li Qiang wrote:
> Alexander Bulekov <alxndr@bu.edu> 于2020年9月9日周三 下午10:28写道:
>> On 200909 1258, Li Qiang wrote:
>>> Gerd Hoffmann <kraxel@redhat.com> 于2020年9月9日周三 下午12:49写道:
>>>> On Wed, Sep 09, 2020 at 10:15:47AM +0800, Jason Wang wrote:
>>>>> On 2020/9/9 上午12:41, Li Qiang wrote:
>>>>>> Currently the MR is not explicitly connecting with its device instead of
>>>>>> a opaque. In most situation this opaque is the deivce but it is not an
>>>>>> enforcement. This patch adds a DeviceState member of to MemoryRegion
>>>>>> we will use it in later patch.
>>>>>
>>>>> I don't have a deep investigation. But I wonder whether we could make sure
>>>>> of owner instead of adding a new field here.
>>>> Should be possible.  There is object_dynamic_cast() which can be used to
>>>> figure whenever a given owner object is a device.
>>>>
>>> I found most caller of 'memory_region_init_io' will set the owner to
>>> the device object.
>>> But some of them will just set it to NULL. Do will have a clear rule
>>> that the device's MR
>>> 'owner' should be the device object? If yes, we can use this field.
>>>
>> Those seem to be devices that havent't been QOM-imfied yet?  Maybe those
>> devices are unlikely to be affected by these issues, though...
>>
> No it seems not related QOM-ified.
>
>> For i386, it seems like parallel, port80, portF0, pckbd, and xen_pvdevice .. ?
>> I'm guessing none of these do DMA.
>>
> In fact xen_pvdevice is MMIO but the handlers does nothing.
>
> There are some other example than i386 such as the riscv in
> hw/riscv/sifive_uart.c
>
> If we have a rule to force the 'MR's owner to the device then we can
> fix these NULL owner MR.
>
> Thanks,
> Li Qiang


I guess maybe we can start from the ones whose owner is a device and 
convert the rest on top (if necessary)?

Thanks


>
>> +CC Stefan, since he replied to the other thread.
>>
>>> Thanks,
>>> Li Qiang
>>>
>>>> take care,
>>>>    Gerd
>>>>



  reply	other threads:[~2020-09-14  2:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 16:41 [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO Li Qiang
2020-09-08 16:41 ` [RFC 1/4] memory: add memory_region_init_io_with_dev interface Li Qiang
2020-09-09  2:15   ` Jason Wang
2020-09-09  4:45     ` Li Qiang
2020-09-09  4:48     ` Gerd Hoffmann
2020-09-09  4:58       ` Li Qiang
2020-09-09 14:28         ` Alexander Bulekov
2020-09-10 14:37           ` Li Qiang
2020-09-14  2:37             ` Jason Wang [this message]
2020-09-20  7:55   ` Paolo Bonzini
2020-09-08 16:41 ` [RFC 2/4] memory: avoid reenter the device's MMIO handler while processing MMIO Li Qiang
2020-09-08 16:41 ` [RFC 3/4] e1000e: use the new memory_region_init_io_with_dev interface Li Qiang
2020-09-08 16:41 ` [RFC 4/4] hcd-xhci: " Li Qiang
2020-09-09  2:16 ` [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO Jason Wang
2020-09-09  4:39   ` Li Qiang
2020-09-20  7:56 ` Paolo Bonzini
2020-09-20 20:24   ` Peter Maydell
2020-09-21  4:39   ` Li Qiang

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=9b4546b1-d138-2110-0b18-dea7f2e8b188@redhat.com \
    --to=jasowang@redhat.com \
    --cc=alxndr@bu.edu \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=kraxel@redhat.com \
    --cc=liq3ea@163.com \
    --cc=liq3ea@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).