iommu/vt-d: Fix debugfs register reads
commit64eaf497746e95d97e3f2883b6274d07b117e8ff
authorMegha Dey <megha.dey@linux.intel.com>
Mon, 9 Mar 2020 20:09:46 +0000 (9 13:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:00:01 +0000 (1 11:00 +0200)
tree3489315f1099877a801e7d0188b5465b4cb4a47f
parent1ca96ac200c8e7a589ac69f3b1675fd18ed9e5bc
iommu/vt-d: Fix debugfs register reads

[ Upstream commit ba3b01d7a6f4ab9f8a0557044c9a7678f64ae070 ]

Commit 6825d3ea6cde ("iommu/vt-d: Add debugfs support to show register
contents") dumps the register contents for all IOMMU devices.

Currently, a 64 bit read(dmar_readq) is done for all the IOMMU registers,
even though some of the registers are 32 bits, which is incorrect.

Use the correct read function variant (dmar_readl/dmar_readq) while
reading the contents of 32/64 bit registers respectively.

Signed-off-by: Megha Dey <megha.dey@linux.intel.com>
Link: https://lore.kernel.org/r/1583784587-26126-2-git-send-email-megha.dey@linux.intel.com
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel-iommu-debugfs.c
include/linux/intel-iommu.h