gned-off-by: Jason Gunthorpe
---
drivers/iommu/exynos-iommu.c | 79 +---
1 file changed, 38 insertions(+), 41 deletions(-)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 2c6e9094f1e979..c301aa87fe0ff0 100644
--- a/drivers/iomm
iort_iommu_get_resv_regions() needs access to the parsed id array that is
currently stored in the iommu_fwspec.
Instead of getting this from the fwspec inside the iort code have the
caller pass it in.
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/arm64/iort.c | 88
patch.
Keep things basically the same, but rely on the core code to discover the
iommu_device and stop confusingly using dev_iommu_priv to join SIDs into
the same master when processing the assumed-to-be-sorted iommus list.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/msm_iommu.c
.
Place this in a new header "iommu-driver.h" which is intended to help
isolate APIs that are only for use by the drivers away from the consumers
of the IOMMU API.
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/scan.c | 7 +-
drivers/iommu/iommu.c
-device data
not the iommu.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/ipmmu-vmsa.c | 96 +-
1 file changed, 42 insertions(+), 54 deletions(-)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index ace1fc4bd34b0f..ba984017065f98 100644
populate it.
Convert the rest of the funcs from calling dev_iommu_fwspec_get() to using
he per-device data and remove all use of fwspec.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/virtio-iommu.c | 67 +---
1 file changed, 23 insertions(+), 44 deletions(-)
diff
Take the existing machinery that was wired to invoking of_xlate on each id
through the various maps and aliases and allow it to call a function
pointer with an opaque.
Call of_iommu_xlate() using the existing of_iommu_for_each_id().
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/of_iommu.c
dev_iommu_priv_get() to use the per-device data
not the iommu.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/tegra-smmu.c | 154 +++--
1 file changed, 47 insertions(+), 107 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index
() instead.
Move the declaration of of_iommu_get_resv_regions() to iommu-driver.h
since it is now intended to be called by drivers.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/apple-dart.c | 5 ++---
drivers/iommu/dma-iommu.c| 5 ++---
drivers/iommu/of_iommu.c | 3 +++
drivers
populate it.
Convert the rest of the funcs from calling dev_iommu_fwspec_get() to using
the per-device data and remove all use of fwspec.
Directly call iort_iommu_get_resv_regions() and pass in the internal id
array instead of getting it from the fwspec.
Signed-off-by: Jason Gunthorpe
---
drivers
the cache.
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/scan.c | 1 +
drivers/iommu/Makefile | 1 +
drivers/iommu/viot_iommu.c | 70
include/linux/iommu-driver.h | 25 +
4 files changed, 97 insertions(+)
create mode 100644
() rely on iommu_find_init_device() for
everything.
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/arm64/iort.c | 76
drivers/acpi/scan.c | 52 +--
drivers/acpi/viot.c | 32 ---
drivers/iommu/apple
ch_device unless dev->iommu is
set and has an ops. This can only happen if probe_device was done. Remove
the checks.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/rockchip-iommu.c | 74 +++---
1 file changed, 24 insertions(+), 50 deletions(-)
diff --git a/drivers/i
This API is basically the same as iommu_of_get_single_iommu(), except that
it will try to parse the ACPI IORT table if it is available.
The ACPI IORT table can return a flags value to indicate
IOMMU_FWSPEC_PCI_RC_ATS, return this through an output flags pointer.
Signed-off-by: Jason Gunthorpe
sprd suports a single iommu instance and only a single id. Parse it
directly using iommu_of_get_single_iommu() and remove
sprd_iommu_of_xlate().
It stores the iommu, not a per-driver struct in the dev_iommu_priv(), keep
it that way for now.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/sprd
)) return ERR_CAST(smmu_device);
[..]
dev_iommu_priv_set(dev, data);
return &iommu->iommu;
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c| 21 ++
drivers/iommu/of_iommu.c | 21 +-
include/linux/iom
ERR_PTR(-ENOMEM);
ret = iommu_of_xlate(pinf, &apple_dart_iommu_ops, 1,
&apple_dart_of_xlate, cfg);
if (ret) goto err_free;
dev_iommu_priv_set(dev, cfg);
return &??->iommu; // The first iommu_device parsed
Signed-off-by:
Similar to of_iommu_for_each_id() this parses the IORT ACPI description
and invokes a function over each entry in the table.
Have iort_iommu_configure_id() use the new function to call
iort_iommu_xlate().
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/arm64/iort.c | 118
mmu probe info' that will do this step and then we can fully
execute probe outside the *_dma_configure() context.
The big win here is the extensive cleaning of the driver's probe
paths. There is alot of "creative" stuff there, this cleans almost all of
it away.
This is on g
v_get() to use the per-device data
not the iommu.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/mtk_iommu.c | 116 --
1 file changed, 62 insertions(+), 54 deletions(-)
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
index 7abe9e85a
the iommu.
Remove to_iommu().
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 161
1 file changed, 81 insertions(+), 80 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index
ossible error flows.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/apple-dart.c | 58 +-
1 file changed, 32 insertions(+), 26 deletions(-)
diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index bb0e5a4577fc03..b796c68ae45ad8 100644
--- a/
with
generic_single_device_group(). Since there is a single translation the ID
presumably doesn't matter.
Allocate a sun50i_iommu_device struct during probe to be like all the
other drivers.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/sun50i-iommu.c | 60 +---
1 file c
ion only supports tegra-smmu and
arm-smmu, so implement the function there.
This makes way to moving the id list into the private memory of the
driver.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/arm/arm-smmu/arm-smmu.c | 11 +++
drivers/iommu/of_iommu.c |
f the funcs from calling dev_iommu_fwspec_get() to using
the per-device data and remove all use of fwspec.
Convert the places using dev_iommu_priv_get() to use the per-device data
not the iommu.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/mtk_iommu_v1.c | 162 +++--
from the other places in the driver.
Directly call iort_iommu_get_resv_regions() and pass in the internal id
array instead of getting it from the fwspec.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 6 +-
drivers/iommu/arm/arm-smmu/arm-smmu.c
Similar to of_iommu_for_each_id() this parses the VIOT ACPI description
and invokes a function over each entry in the table.
Have viot_iommu_configure() use the new function to call
viot_dev_iommu_init().
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/viot.c | 54
pointless. Remove it.
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/arm64/iort.c| 12 +++-
drivers/acpi/viot.c | 9 +
drivers/iommu/iommu.c| 20 +---
drivers/iommu/of_iommu.c | 16 ++--
include/linux/iommu-driver.h | 3
R(-ENOMEM);
[..]
dev_iommu_priv_set(dev, data);
return &iommu->iommu;
Signed-off-by: Jason Gunthorpe
---
drivers/acpi/scan.c | 1 +
drivers/iommu/iommu.c| 52 ++
drivers/iommu/of_iommu.c | 59 +
include/linu
ingle op
in the system to probe each device. If there are multiple ops we invoke
each one once, and drivers that don't understand the struct device should
return -ENODEV.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c | 59 +++
1 file changed,
NODEV and we are under a
dma_configure then ensure that all the applicable FW parsers are given a
chance to run.
Keep track of any parsers that may have run during the probe ops call and
don't do them again.
Signed-off-by: Jason Gunthorpe
---
drivers/iommu/iommu.c
On Mon, Feb 12, 2024 at 10:30:17AM -0800, Kees Cook wrote:
> I might suggest doing a binary difference comparison[1], as it's possible
> that "real_sz" is being used to try to avoid trailing padding on
> structs. I wasn't able to trivially construct an example, so maybe I'm
> not understanding its
On Sat, Feb 17, 2024 at 03:29:13PM +0100, Erick Archer wrote:
> When a struct containing a flexible array is included in another struct,
> and there is a member after the struct-with-flex-array, there is a
> possibility of memory overlap. These cases must be audited [1]. See:
>
> struct inner {
>
On Mon, Mar 25, 2024 at 02:24:07PM -0600, Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
> ready to enable it globally.
>
> Use the `struct_group_tagged()` helper to separate the flexible array
> from the rest of the members in flexible `struct
34 matches
Mail list logo