IOMMU Fixes for Linux v5.5-rc7

Two Fixes:

	- Fix NULL-ptr dereference bug in Intel IOMMU driver

	- Properly safe and restore AMD IOMMU performance counter
	  registers when testing if they are writable.
iommu/amd: Fix IOMMU perf counter clobbering during init

init_iommu_perf_ctr() clobbers the register when it checks write access
to IOMMU perf counters and fails to restore when they are writable.

Add save and restore to fix it.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Fixes: 30861ddc9cca4 ("perf/x86/amd: Add IOMMU Performance Counter resource management")
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 file changed