From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Sergio Lopez <slp@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v3 1/3] hw/pci: Introduce pci_dma_memory_region() helper
Date: Thu, 26 Aug 2021 21:45:34 +0100 [thread overview]
Message-ID: <a85f1c5a-8b4e-161f-4df2-1bdffc3ad04d@ilande.co.uk> (raw)
In-Reply-To: <20210826200720.2196827-2-philmd@redhat.com>
On 26/08/2021 21:07, Philippe Mathieu-Daudé wrote:
> pci_get_address_space() returns an AddressSpace. In some
> cases we want a MemoryRegion. Add the pci_dma_memory_region()
> equivalent helper.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> include/hw/pci/pci.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index d0f4266e372..5860f42e400 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -786,6 +786,11 @@ static inline AddressSpace *pci_get_address_space(PCIDevice *dev)
> return &dev->bus_master_as;
> }
>
> +static inline MemoryRegion *pci_dma_memory_region(PCIDevice *dev)
> +{
> + return &dev->bus_master_container_region;
> +}
> +
> /**
> * pci_dma_rw: Read from or write to an address space from PCI device.
> *
This patch doesn't quite feel right: there are already a number of devices that have
been using pci_get_address_space() for some time without requiring access to the
underlying MemoryRegion. So then the first question I ask myself when I see this
patch is why do we suddenly need it now?
ATB,
Mark.
next prev parent reply other threads:[~2021-08-26 20:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 20:07 [PATCH v3 0/3] hw/usb: Always expect 'dma' link property to be set to simplify Philippe Mathieu-Daudé
2021-08-26 20:07 ` [PATCH v3 1/3] hw/pci: Introduce pci_dma_memory_region() helper Philippe Mathieu-Daudé
2021-08-26 20:45 ` Mark Cave-Ayland [this message]
2021-08-26 20:07 ` [PATCH v3 2/3] hw/usb/hcd-xhci-pci: Abort if setting link property failed Philippe Mathieu-Daudé
2021-08-26 20:46 ` Mark Cave-Ayland
2021-08-26 20:07 ` [PATCH v3 3/3] hw/usb/xhci: Always expect 'dma' link property to be set Philippe Mathieu-Daudé
2021-08-26 21:15 ` Mark Cave-Ayland
2021-08-27 8:54 ` Peter Maydell
2021-08-27 9:14 ` Mark Cave-Ayland
2021-08-27 10:14 ` Peter Maydell
2021-08-27 11:03 ` Mark Cave-Ayland
2021-08-27 12:13 ` Philippe Mathieu-Daudé
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=a85f1c5a-8b4e-161f-4df2-1bdffc3ad04d@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=ehabkost@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=slp@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).