[PATCH] iommu/amd: Convert from atomic_t to refcount_t on device_state->count

2021-07-18 Thread Xiyu Yang via iommu
refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/iommu/amd/iommu_v2.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --

[PATCH] iommu/amd: Fix I/O page fault logging ratelimit test

2021-07-18 Thread Lennert Buytenhek
On an AMD system, I/O page faults are usually logged like this: drvname :05:00.0: Event logged [IO_PAGE_FAULT domain=0x address=0x92050da0 flags=0x0020] But sometimes they are logged like this instead, even for the exact same PCI device: AMD-Vi: Event logged [IO_