53 lines
1.7 KiB
Diff
53 lines
1.7 KiB
Diff
|
|
From d4d0d15716a3f4c89ca9532e6b598b14db76ae0c Mon Sep 17 00:00:00 2001
|
||
|
|
From: Zhangfei Gao <zhangfei.gao@linaro.org>
|
||
|
|
Date: Sat, 26 Oct 2024 08:40:11 +0000
|
||
|
|
Subject: [PATCH] smmuv3: realize get_pasid_cap and set ssidsize with pasid
|
||
|
|
|
||
|
|
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
|
||
|
|
---
|
||
|
|
hw/arm/smmu-common.c | 9 +++++++++
|
||
|
|
hw/arm/smmuv3.c | 3 +--
|
||
|
|
2 files changed, 10 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
|
||
|
|
index e7028bd4ec..3a257a5b0e 100644
|
||
|
|
--- a/hw/arm/smmu-common.c
|
||
|
|
+++ b/hw/arm/smmu-common.c
|
||
|
|
@@ -831,10 +831,19 @@ static void smmu_dev_unset_iommu_device(PCIBus *bus, void *opaque, int devfn)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
+static bool smmu_dev_get_pasid_cap(PCIBus *bus,
|
||
|
|
+ void *opaque, int devfn)
|
||
|
|
+{
|
||
|
|
+ assert(0 <= devfn && devfn < PCI_DEVFN_MAX);
|
||
|
|
+
|
||
|
|
+ return true;
|
||
|
|
+}
|
||
|
|
+
|
||
|
|
static const PCIIOMMUOps smmu_ops = {
|
||
|
|
.get_address_space = smmu_find_add_as,
|
||
|
|
.set_iommu_device = smmu_dev_set_iommu_device,
|
||
|
|
.unset_iommu_device = smmu_dev_unset_iommu_device,
|
||
|
|
+ .get_pasid_cap = smmu_dev_get_pasid_cap,
|
||
|
|
};
|
||
|
|
|
||
|
|
SMMUDevice *smmu_find_sdev(SMMUState *s, uint32_t sid)
|
||
|
|
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
|
||
|
|
index 0ca0e96fcc..6964ab000d 100644
|
||
|
|
--- a/hw/arm/smmuv3.c
|
||
|
|
+++ b/hw/arm/smmuv3.c
|
||
|
|
@@ -312,8 +312,7 @@ out:
|
||
|
|
|
||
|
|
val = FIELD_EX32(sdev->info.idr[1], IDR1, SIDSIZE);
|
||
|
|
s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SIDSIZE, val);
|
||
|
|
- val = FIELD_EX32(sdev->info.idr[1], IDR1, SSIDSIZE);
|
||
|
|
- s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE, val);
|
||
|
|
+ s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE, pasid);
|
||
|
|
|
||
|
|
val = FIELD_EX32(sdev->info.idr[3], IDR3, HAD);
|
||
|
|
s->idr[3] = FIELD_DP32(s->idr[3], IDR3, HAD, val);
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|