[Bug 201753] AMD-Vi: Unable to write to IOMMU perf counter

bugzilla-daemon
2021-02-10T19:53:25Z

--- Comment #6 from Neil (ledufff@hotmail.com) ---
Hello, Suravee, I tried your patch in my Thinkpad E495. With RFCv1 and had no
success, I'm sorry I forgot to save a dmesg for that, but I am sure it was like
no patch was used, it was the same dmesg as before.

I had success with RFCv2, and got the following:

[ 0.606952] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[ 0.607117] pci 0000:00:00.2: can't derive routing for PCI INT A
[ 0.607118] pci 0000:00:00.2: PCI INT A: not connected
[ 0.607169] pci 0000:00:01.0: Adding to iommu group 0
[ 0.607180] pci 0000:00:01.1: Adding to iommu group 1
[ 0.607191] pci 0000:00:01.2: Adding to iommu group 2
[ 0.607204] pci 0000:00:01.3: Adding to iommu group 3
[ 0.607215] pci 0000:00:01.6: Adding to iommu group 4
[ 0.607238] pci 0000:00:08.0: Adding to iommu group 5
[ 0.607249] pci 0000:00:08.1: Adding to iommu group 6
[ 0.607257] pci 0000:00:08.2: Adding to iommu group 5
[ 0.607271] pci 0000:00:14.0: Adding to iommu group 7
[ 0.607279] pci 0000:00:14.3: Adding to iommu group 7
[ 0.607307] pci 0000:00:18.0: Adding to iommu group 8
[ 0.607314] pci 0000:00:18.1: Adding to iommu group 8
[ 0.607321] pci 0000:00:18.2: Adding to iommu group 8
[ 0.607328] pci 0000:00:18.3: Adding to iommu group 8
[ 0.607336] pci 0000:00:18.4: Adding to iommu group 8
[ 0.607343] pci 0000:00:18.5: Adding to iommu group 8
[ 0.607350] pci 0000:00:18.6: Adding to iommu group 8
[ 0.607357] pci 0000:00:18.7: Adding to iommu group 8
[ 0.607368] pci 0000:01:00.0: Adding to iommu group 9
[ 0.607380] pci 0000:02:00.0: Adding to iommu group 10
[ 0.607392] pci 0000:03:00.0: Adding to iommu group 11
[ 0.607403] pci 0000:04:00.0: Adding to iommu group 12
[ 0.607434] pci 0000:05:00.0: Adding to iommu group 13
[ 0.607474] pci 0000:05:00.1: Adding to iommu group 14
[ 0.607493] pci 0000:05:00.2: Adding to iommu group 14
[ 0.607511] pci 0000:05:00.3: Adding to iommu group 14
[ 0.607530] pci 0000:05:00.4: Adding to iommu group 14
[ 0.607548] pci 0000:05:00.5: Adding to iommu group 14
[ 0.607566] pci 0000:05:00.6: Adding to iommu group 14
[ 0.607571] pci 0000:06:00.0: Adding to iommu group 5
[ 0.609950] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 0.609951] pci 0000:00:00.2: AMD-Vi: Extended features (0x4f77ef22294ada):
[ 0.609952] PPR NX GT IA GA PC GA_vAPIC
[ 0.609954] AMD-Vi: Interrupt remapping enabled
[ 0.609954] AMD-Vi: Virtual APIC enabled
[ 0.610822] AMD-Vi: Lazy IO/TLB flushing enabled
[ 0.611644] amd_uncore: AMD NB counters detected
[ 0.611647] amd_uncore: AMD LLC counters detected
[ 0.611963] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4
counters/bank).

I will attach the full dmesg later.
Should I try the v3?
Is there anything else apart from booting and checking dmesg that I can do to
test your patch?