iommu/amd: Check feature support bit before accessing MSI capability registers
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 20 Nov 2019 13:55:48 +0000 (07:55 -0600)
committerJoerg Roedel <jroedel@suse.de>
Mon, 23 Dec 2019 13:06:15 +0000 (14:06 +0100)
commit813071438e83d338ba5cfe98b3b26c890dc0a6c0
treea5b3e71f7e71480ed2793d202e5ca54ebb166d00
parent387caf0b759ac437a65ad5d59665558025f350fc
iommu/amd: Check feature support bit before accessing MSI capability registers

The IOMMU MMIO access to MSI capability registers is available only if
the EFR[MsiCapMmioSup] is set. Current implementation assumes this bit
is set if the EFR[XtSup] is set, which might not be the case.

Fix by checking the EFR[MsiCapMmioSup] before accessing the MSI address
low/high and MSI data registers via the MMIO.

Fixes: 66929812955b ('iommu/amd: Add support for X2APIC IOMMU interrupts')
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_types.h