[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] hw/arm/smmuv3: fix smmu emulation when guest smmu
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH] hw/arm/smmuv3: fix smmu emulation when guest smmu is in passthrough mode |
Date: |
Thu, 7 Jun 2018 14:39:38 +0100 |
On 7 June 2018 at 14:38, Jia He <address@hidden> wrote:
> 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: address@hidden
> ---
> 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
>
Ccing Eric as the author of the smmuv3 code.
thanks
-- PMM