]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:19 +0000 (08:38 +0100)
commit1f1d48331ac0989ea082eec148693e4c9d834feb
treece30d6986df8e05e418c5680063ce5abd90c05ee
parent08bd511fe94577d962eb48dca90a2ebc3dcd3a15
iommu/amd: Check feature support bit before accessing MSI capability registers

[ Upstream commit 813071438e83d338ba5cfe98b3b26c890dc0a6c0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_types.h