iommu/amd: Fix IOMMU perf counter clobbering during init
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 23 Jan 2020 22:32:14 +0000 (15:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 15:45:29 +0000 (16:45 +0100)
commit16aab32ff8b379f3e1e3b4f0d52f50cb52fc48bb
tree23ad4cc02450dd886343e2958e97cb44d13c6142
parent9f6216862a2075474fa985ea3b801c2ac4b41de3
iommu/amd: Fix IOMMU perf counter clobbering during init

commit 8c17bbf6c8f70058a66305f2e1982552e6ea7f47 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/amd_iommu_init.c