Skip to contentSkip to conversation

spapr: Only report host/guest IOMMU page size mismatches on KVM

PATCH In review David Gibson 2 participants 2 messages Jul 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr: Only report host/guest IOMMU page size mismatches on KVM

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

---
 hw/ppc/spapr_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/spapr_pci.c +2 -1
index cc1588d..a52dcf8 100644
@@ -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);
Signature · 1 line
2.9.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · 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).

---
 hw/ppc/spapr_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/spapr_pci.c +0 -0
index cc1588d..a52dcf8 100644

hw/ppc/spapr_pci.c static void spapr_phb_realize(DeviceState *dev, Error **errp) · line 1749

Quoted 6 lines
hw/ppc/spapr_pci.c +2 -1
@@ -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,