[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/11] hw/arm/smmu-common: Fix devfn computation in s
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 01/11] hw/arm/smmu-common: Fix devfn computation in smmu_iommu_mr |
Date: |
Mon, 9 Jul 2018 14:54:25 +0100 |
From: Eric Auger <address@hidden>
smmu_iommu_mr() aims at returning the IOMMUMemoryRegion corresponding
to a given sid. The function extracts both the PCIe bus number and
the devfn to return this data. Current computation of devfn is wrong
as it only returns the PCIe function instead of slot | function.
Fixes 32cfd7f39e08 ("hw/arm/smmuv3: Cache/invalidate config data")
Signed-off-by: Eric Auger <address@hidden>
Message-id: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
include/hw/arm/smmu-common.h | 1 +
hw/arm/smmu-common.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h
index 50e2912a95e..b07cadd0ef9 100644
--- a/include/hw/arm/smmu-common.h
+++ b/include/hw/arm/smmu-common.h
@@ -24,6 +24,7 @@
#define SMMU_PCI_BUS_MAX 256
#define SMMU_PCI_DEVFN_MAX 256
+#define SMMU_PCI_DEVFN(sid) (sid & 0xFF)
#define SMMU_MAX_VA_BITS 48
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index 3098915d07c..55c75d65d2e 100644
--- a/hw/arm/smmu-common.c
+++ b/hw/arm/smmu-common.c
@@ -351,7 +351,7 @@ IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid)
bus_n = PCI_BUS_NUM(sid);
smmu_bus = smmu_find_smmu_pcibus(s, bus_n);
if (smmu_bus) {
- devfn = sid & 0x7;
+ devfn = SMMU_PCI_DEVFN(sid);
smmu = smmu_bus->pbdev[devfn];
if (smmu) {
return &smmu->iommu;
--
2.17.1
- [Qemu-devel] [PULL 00/11] target-arm queue, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 03/11] hw/timer/cmsdk-apb-timer: Correct ptimer policy settings, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 02/11] ptimer: Add TRIGGER_ONLY_ON_DECREMENT policy option, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 01/11] hw/arm/smmu-common: Fix devfn computation in smmu_iommu_mr,
Peter Maydell <=
- [Qemu-devel] [PULL 04/11] hw/timer/cmsdk-apb-timer: Correctly identify and set one-shot mode, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 05/11] hw/timer/cmsdk-apb-timer: run or stop timer on writes to RELOAD and VALUE, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 06/11] target/arm: Suppress Coverity warning for PRF, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 07/11] tcg: Restrict check_size_impl to multiples of the line size, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 10/11] boards.h: Remove doc comment reference to nonexistent function, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 08/11] target/arm: Fix do_predset for large VL, Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 11/11] hw/net/dp8393x: don't make prom region 'nomigrate', Peter Maydell, 2018/07/09
- [Qemu-devel] [PULL 09/11] hw/sd/omap_mmc: Split 'pseudo-reset' from 'power-on-reset', Peter Maydell, 2018/07/09
- Re: [Qemu-devel] [PULL 00/11] target-arm queue, Peter Maydell, 2018/07/09