All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH qemu 2/5] vfio: Skip PCI BARs in memory listener
Date: Mon, 13 Jul 2015 11:08:40 -0600	[thread overview]
Message-ID: <1436807320.1391.354.camel@redhat.com> (raw)
In-Reply-To: <1436525028-23963-3-git-send-email-aik@ozlabs.ru>

On Fri, 2015-07-10 at 20:43 +1000, Alexey Kardashevskiy wrote:
> In some cases PCI BARs are registered as RAM via
> memory_region_init_ram_ptr() and the vfio_memory_listener will be called
> on them too. However DMA will not be performed to/from these regions so
> just skip them.


Who says?  What about peer-to-peer DMA?  We have all sorts of FUD about
whether the hardware handles this correctly, but mapping PCI MMIO BARs
into the IOMMU allows the possibility of supporting p2p DMA between
devices in the guest.  Thanks,

Alex


> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  hw/vfio/common.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index d115ec9..225cdc7 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
> @@ -248,7 +248,8 @@ static bool vfio_listener_skipped_section(MemoryRegionSection *section)
>              * are never accessed by the CPU and beyond the address width of
>              * some IOMMU hardware.  TODO: VFIO should tell us the IOMMU width.
>              */
> -           section->offset_within_address_space & (1ULL << 63);
> +           section->offset_within_address_space & (1ULL << 63) ||
> +           memory_region_is_skip_dump(section->mr);
>  }
>  
>  static void vfio_iommu_map_notify(Notifier *n, void *data)

  reply	other threads:[~2015-07-13 17:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 10:43 [Qemu-devel] [PATCH qemu 0/5] vfio: SPAPR IOMMU v2 (memory preregistration support) Alexey Kardashevskiy
2015-07-10 10:43 ` [Qemu-devel] [PATCH qemu 1/5] vfio: Switch from TARGET_PAGE_MASK to qemu_real_host_page_mask Alexey Kardashevskiy
2015-07-13  6:15   ` David Gibson
2015-07-13  7:24     ` Alexey Kardashevskiy
2015-07-14  3:46       ` David Gibson
2015-07-13 20:32     ` Peter Crosthwaite
2015-07-14  7:08       ` Alexey Kardashevskiy
2015-07-10 10:43 ` [Qemu-devel] [PATCH qemu 2/5] vfio: Skip PCI BARs in memory listener Alexey Kardashevskiy
2015-07-13 17:08   ` Alex Williamson [this message]
2015-07-10 10:43 ` [Qemu-devel] [PATCH qemu 3/5] vfio: Store IOMMU type in container Alexey Kardashevskiy
2015-07-10 10:43 ` [Qemu-devel] [PATCH qemu 4/5] vfio: Refactor memory listener to accommodate more IOMMU types Alexey Kardashevskiy
2015-07-10 10:43 ` [Qemu-devel] [PATCH qemu 5/5] vfio: spapr: Add SPAPR IOMMU v2 support (DMA memory preregistering) Alexey Kardashevskiy

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=1436807320.1391.354.camel@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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.