All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/smmuv3: fix smmu emulation when guest smmu is in passthrough mode
@ 2018-06-07 13:38 Jia He
  2018-06-07 13:39 ` Peter Maydell
  2018-06-07 17:06 ` Auger Eric
  0 siblings, 2 replies; 4+ messages in thread
From: Jia He @ 2018-06-07 13:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel, Jia He, jia.he

There is an exception when I passes iommu.passthrough=1 to guest's
kernel boot parameter(host QDF2400 kernel 4.17, guest kernel 4.14).
The guest will be hang when booting up.

When guest smmu is in passthrough mode, entry.perm will not be assigned
to flag in smmuv3_translate. It seems not be correct.

After this patch, I have tested in 4 cases and all passed.
host smmu on/passthrough + guest smmu on/passthrough

Signed-off-by: jia.he@hxt-semitech.com
---
 hw/arm/smmuv3.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 42dc521..5c46102 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -560,6 +560,12 @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr,
     }
 
     ret = smmuv3_decode_config(mr, &cfg, &event);
+
+    if (cfg.bypassed) {
+        ret = 0;
+        goto out;
+    }
+
     if (ret) {
         goto out;
     }
-- 
1.8.3.1

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

end of thread, other threads:[~2018-06-08  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 13:38 [Qemu-devel] [PATCH] hw/arm/smmuv3: fix smmu emulation when guest smmu is in passthrough mode Jia He
2018-06-07 13:39 ` Peter Maydell
2018-06-07 17:06 ` Auger Eric
2018-06-08  1:12   ` Jia He

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.