qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr: Only report host/guest IOMMU page size mismatches on KVM
@ 2017-07-04 13:54 David Gibson
  2017-07-04 14:04 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: David Gibson @ 2017-07-04 13:54 UTC (permalink / raw)
  To: peter.maydell, agraf, aik, thuth; +Cc: qemu-devel, qemu-ppc, David Gibson

We print a warning if the spapr IOMMU isn't configured to support a page
size matching the host page size backing RAM.  When that's the case we need
more complex logic to translate VFIO mappings, which is slower.

But, it's not so slow that it would be at all noticeable against the
general slowness of TCG.  So, only warn when using KVM.  This removes some
noisy and unhelpful warnings from make check on hosts with page sizes
which typically differ from those on POWER (e.g. Sparc).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index cc1588d..a52dcf8 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1745,7 +1745,8 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
     }
 
     /* DMA setup */
-    if ((sphb->page_size_mask & qemu_getrampagesize()) == 0) {
+    if (((sphb->page_size_mask & qemu_getrampagesize()) == 0)
+        && kvm_enabled()) {
         error_report("System page size 0x%lx is not enabled in page_size_mask "
                      "(0x%"PRIx64"). Performance may be slow",
                      qemu_getrampagesize(), sphb->page_size_mask);
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr: Only report host/guest IOMMU page size mismatches on KVM
  2017-07-04 13:54 [Qemu-devel] [PATCH] spapr: Only report host/guest IOMMU page size mismatches on KVM David Gibson
@ 2017-07-04 14:04 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2017-07-04 14:04 UTC (permalink / raw)
  To: David Gibson, peter.maydell, agraf, aik; +Cc: qemu-devel, qemu-ppc

On 04.07.2017 15:54, David Gibson wrote:
> We print a warning if the spapr IOMMU isn't configured to support a page
> size matching the host page size backing RAM.  When that's the case we need
> more complex logic to translate VFIO mappings, which is slower.
> 
> But, it's not so slow that it would be at all noticeable against the
> general slowness of TCG.  So, only warn when using KVM.  This removes some
> noisy and unhelpful warnings from make check on hosts with page sizes
> which typically differ from those on POWER (e.g. Sparc).
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  hw/ppc/spapr_pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index cc1588d..a52dcf8 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1745,7 +1745,8 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
>      }
>  
>      /* DMA setup */
> -    if ((sphb->page_size_mask & qemu_getrampagesize()) == 0) {
> +    if (((sphb->page_size_mask & qemu_getrampagesize()) == 0)
> +        && kvm_enabled()) {

Since you've put me on CC: ... too much parenthesis for my taste ;-)

Apart from that,

Reviewed-by: Thomas Huth <thuth@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-04 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 13:54 [Qemu-devel] [PATCH] spapr: Only report host/guest IOMMU page size mismatches on KVM David Gibson
2017-07-04 14:04 ` Thomas Huth

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).