Skip to content

iommu/amd: Various fixes to interrupt handler code path

Vasant Hegde linux-iommu 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iommu/amd: Clear the event log entry after reporting an I/O page faultdrivers/iommu/amd/iommu.c+2 -10 replies
2/4iommu/amd: Hold the device mutex across a page-fault reportdrivers/iommu/amd/iommu.c+15 -60 replies
3/4iommu/amd: Call the GA log notifier inside an RCU read sectiondrivers/iommu/amd/iommu.c+17 -120 replies
4/4iommu/amd: Log raw event logdrivers/iommu/amd/iommu.c+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] iommu/amd: Various fixes to interrupt handler code path

Two of the handlers race their teardown. amd_iommu_report_page_fault() reads dev_data->domain with no lock, while detach_device() clears and frees that domain under dev_data->mutex. The GA log notifier is loaded twice outside an RCU read-side section, so synchronize_rcu() on unregister does not cover the call.

The I/O page-fault case also returns before the event slot is zeroed, so the entry is decoded again. Print the raw event before decoding it, so fields the decoder does not know about stay visible.

Full series including other cleanup is available at :
https://github.com/AMDESE/linux-iommu/tree/iommu_code_audit_7.4_v1

Vasant Hegde (4):
iommu/amd: Clear the event log entry after reporting an I/O page fault iommu/amd: Hold the device mutex across a page-fault report iommu/amd: Call the GA log notifier inside an RCU read section iommu/amd: Log raw event log

 drivers/iommu/amd/iommu.c | 56 ++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 19 deletions(-)
Signature · 1 line
2.31.1