1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

IOMMU Fixes for Linux v6.14-rc2

Including:
 
 	- Core: Fix potential memory leak in iopf_queue_remove_device().
 
 	- Intel VT-d: Handle faults correctly in
 	  intel_iommu_drain_pasid_prq().
 
 	- AMD-Vi: Fix faults happening in resume path.
 
 	- Typo and spelling fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmeu/KUACgkQK/BELZcB
 GuNCXA/9E9yJP2/JIKNjDNPfE7GMoDGZDIa0K9HE0op+3D0RcTyhwZT1RxKasIfm
 9I+ba/tx5VC1RK4gssGyoJV988BFPXCEWWsMvm9T/ohOsHC098ZVyZEexHawNo71
 lkil0DNI2DepMukDo6DBIWMEUhttSxCrRSG7nQS61+1tjONotKedM0B1s0WUKzNt
 M4JH7x3VyUp7mFqiVpkYNjeKz/pdc4MVMhI/m6VswzpErZ3vivmpWyq7H0Ly0EZv
 ORMGbiMRrheT149/sI87XRpiD7xr34lvkCzgvMV71dHopFEzpYfQwHTQLm2SExIH
 8+gMO7siRW2eVlZfFEJK7jDdd9GFkuQ+vuxOkQaXh/bULAUe8JaBMMX9BK5wVFiF
 xBntgiKt3vFUfRODFecb0KYEioy/Kp77hIq5lb5HTPD6BfGFvZ3TtWOgOLkY9s09
 ccLDczJ0HIgt7tS7YYWiFpQ/Woc6y0TLS3BP9SSH3JFWDfIESYybzYqoltr27ipN
 wKYlpu7wWdm7l+6Wr9MjLrpgcwysb/ABaYjAFzgTfK7zzDwyPmmsWY1Ku8qg2xT1
 AAiYQP5pWiutLgAVunIrfYvJG1vjf5iOYMm/MdpXrYinp8iOX1qRzlAtIb4cJcFt
 Pgg/VRdteVlYkRSTOe7sSX92QDJ3OG3UMg+AzgL1bWbNyYQ2qj0=
 =ZoRn
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fixes from Joerg Roedel:

 - core: fix potential memory leak in iopf_queue_remove_device()

 - Intel VT-d: handle faults correctly in intel_iommu_drain_pasid_prq()

 - AMD-Vi: fix faults happening in resume path

 - typo and spelling fixes

* tag 'iommu-fixes-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID
  iommu/exynos: Fix typos
  iommu: Fix a spelling error
  iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path
  iommu: Fix potential memory leak in iopf_queue_remove_device()
This commit is contained in:
Linus Torvalds 2025-02-14 09:46:51 -08:00
commit 93bd481b60
6 changed files with 13 additions and 5 deletions

View file

@ -175,6 +175,7 @@
#define CONTROL_GAM_EN 25
#define CONTROL_GALOG_EN 28
#define CONTROL_GAINT_EN 29
#define CONTROL_EPH_EN 45
#define CONTROL_XT_EN 50
#define CONTROL_INTCAPXT_EN 51
#define CONTROL_IRTCACHEDIS 59

View file

@ -2653,6 +2653,10 @@ static void iommu_init_flags(struct amd_iommu *iommu)
/* Set IOTLB invalidation timeout to 1s */
iommu_set_inv_tlb_timeout(iommu, CTRL_INV_TO_1S);
/* Enable Enhanced Peripheral Page Request Handling */
if (check_feature(FEATURE_EPHSUP))
iommu_feature_enable(iommu, CONTROL_EPH_EN);
}
static void iommu_apply_resume_quirks(struct amd_iommu *iommu)

View file

@ -249,7 +249,7 @@ struct exynos_iommu_domain {
struct list_head clients; /* list of sysmmu_drvdata.domain_node */
sysmmu_pte_t *pgtable; /* lv1 page table, 16KB */
short *lv2entcnt; /* free lv2 entry counter for each section */
spinlock_t lock; /* lock for modyfying list of clients */
spinlock_t lock; /* lock for modifying list of clients */
spinlock_t pgtablelock; /* lock for modifying page table @ pgtable */
struct iommu_domain domain; /* generic domain data structure */
};
@ -292,7 +292,7 @@ struct sysmmu_drvdata {
struct clk *aclk; /* SYSMMU's aclk clock */
struct clk *pclk; /* SYSMMU's pclk clock */
struct clk *clk_master; /* master's device clock */
spinlock_t lock; /* lock for modyfying state */
spinlock_t lock; /* lock for modifying state */
bool active; /* current status */
struct exynos_iommu_domain *domain; /* domain we belong to */
struct list_head domain_node; /* node for domain clients list */
@ -746,7 +746,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0,
dev_name(dev), data);
if (ret) {
dev_err(dev, "Unabled to register handler of irq %d\n", irq);
dev_err(dev, "Unable to register handler of irq %d\n", irq);
return ret;
}

View file

@ -87,7 +87,9 @@ prq_retry:
struct page_req_dsc *req;
req = &iommu->prq[head / sizeof(*req)];
if (!req->pasid_present || req->pasid != pasid) {
if (req->rid != sid ||
(req->pasid_present && pasid != req->pasid) ||
(!req->pasid_present && pasid != IOMMU_NO_PASID)) {
head = (head + sizeof(*req)) & PRQ_RING_MASK;
continue;
}

View file

@ -478,6 +478,7 @@ void iopf_queue_remove_device(struct iopf_queue *queue, struct device *dev)
ops->page_response(dev, iopf, &resp);
list_del_init(&group->pending_node);
iopf_free_group(group);
}
mutex_unlock(&fault_param->lock);

View file

@ -1756,7 +1756,7 @@ static int iommu_get_def_domain_type(struct iommu_group *group,
group->id);
/*
* Try to recover, drivers are allowed to force IDENITY or DMA, IDENTITY
* Try to recover, drivers are allowed to force IDENTITY or DMA, IDENTITY
* takes precedence.
*/
if (type == IOMMU_DOMAIN_IDENTITY)