]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Fix the overwritten field in IVMD header
authorAdrian Huang <ahuang12@lenovo.com>
Sat, 26 Sep 2020 10:26:02 +0000 (18:26 +0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 1 Oct 2020 12:11:36 +0000 (14:11 +0200)
commit5f14fd21537067d8df39e2e23d25123c79feb6ef
tree57b5ee4c46f439bbfc759a83bf60217bbf8de19c
parent36d70d20ab392a1db4dbc2301d0adcb629eb6563
iommu/amd: Fix the overwritten field in IVMD header

Commit 8a9a1f408eca ("iommu/amd: Treat per-device exclusion
ranges as r/w unity-mapped regions") accidentally overwrites
the 'flags' field in IVMD (struct ivmd_header) when the I/O
virtualization memory definition is associated with the
exclusion range entry. This leads to the corrupted IVMD table
(incorrect checksum). The kdump kernel reports the invalid checksum:

ACPI BIOS Warning (bug): Incorrect checksum in table [IVRS] - 0x5C, should be 0x60 (20200717/tbprint-177)
AMD-Vi: [Firmware Bug]: IVRS invalid checksum

Fix the above-mentioned issue by modifying the 'struct unity_map_entry'
member instead of the IVMD header.

Cleanup: The *exclusion_range* functions are not used anymore, so
get rid of them.

Fixes: 8a9a1f408eca ("iommu/amd: Treat per-device exclusion ranges as r/w unity-mapped regions")
Reported-and-tested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
Cc: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20200926102602.19177-1-adrianhuang0701@gmail.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c