* [PATCH 5.10 0/1] iommu/amd: Prepare for multiple DMA domain types
@ 2024-10-18 9:51 Daniil Dulov
2024-10-18 9:51 ` [PATCH 5.10 1/1] " Daniil Dulov
0 siblings, 1 reply; 3+ messages in thread
From: Daniil Dulov @ 2024-10-18 9:51 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: Daniil Dulov, Joerg Roedel, Will Deacon,
open list:AMD IOMMU (AMD-VI), linux-kernel, lvc-project
Svacer reports possible dereference of a NULL-pointer in
amd_iommu_probe_finalize(). The problem is present in 5.10 stable release
and can be fixed by the following upstream patch. In order to apply this
patch, the incoming changes had to be manually accepted. This action was
necessary due to some differences in the code of amd_iommu_probe_finalize()
of the upstream version and 5.10 version of the kernel.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 5.10 1/1] iommu/amd: Prepare for multiple DMA domain types
2024-10-18 9:51 [PATCH 5.10 0/1] iommu/amd: Prepare for multiple DMA domain types Daniil Dulov
@ 2024-10-18 9:51 ` Daniil Dulov
2024-10-18 9:52 ` kernel test robot
0 siblings, 1 reply; 3+ messages in thread
From: Daniil Dulov @ 2024-10-18 9:51 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: Daniil Dulov, Joerg Roedel, Will Deacon,
open list:AMD IOMMU (AMD-VI), linux-kernel, lvc-project,
Robin Murphy, Joerg Roedel
From: Robin Murphy <robin.murphy@arm.com>
commit 6d596039392bac2a0160fb71300d314943411e2a upstream.
The DMA ops reset/setup can simply be unconditional, since
iommu-dma already knows only to touch DMA domains.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/6450b4f39a5a086d505297b4a53ff1e4a7a0fe7c.1628682049.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
---
drivers/iommu/amd/iommu.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 0a061a196b53..16a1c2a44bce 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2257,12 +2257,9 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
static void amd_iommu_probe_finalize(struct device *dev)
{
- struct iommu_domain *domain;
-
/* Domains are initialized for this device - have a look what we ended up with */
- domain = iommu_get_domain_for_dev(dev);
- if (domain->type == IOMMU_DOMAIN_DMA)
- iommu_setup_dma_ops(dev, IOVA_START_PFN << PAGE_SHIFT, 0);
+ set_dma_ops(dev, NULL);
+ iommu_setup_dma_ops(dev, 0, U64_MAX);
}
static void amd_iommu_release_device(struct device *dev)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 5.10 1/1] iommu/amd: Prepare for multiple DMA domain types
2024-10-18 9:51 ` [PATCH 5.10 1/1] " Daniil Dulov
@ 2024-10-18 9:52 ` kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-10-18 9:52 UTC (permalink / raw)
To: Daniil Dulov; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3
Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 5.10 1/1] iommu/amd: Prepare for multiple DMA domain types
Link: https://lore.kernel.org/stable/20241018095122.437330-2-d.dulov%40aladdin.ru
Please ignore this mail if the patch is not relevant for upstream.
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-18 9:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 9:51 [PATCH 5.10 0/1] iommu/amd: Prepare for multiple DMA domain types Daniil Dulov
2024-10-18 9:51 ` [PATCH 5.10 1/1] " Daniil Dulov
2024-10-18 9:52 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox