[PATCH 2/3] iommu/vt-d: treat unmapped RMRR entries as sane

From: Barret Rhoden
Date: Wed Dec 11 2019 - 14:46:58 EST


The RMRR sanity check is to confirm that the memory pointed to by the
RMRR entry is not used by the kernel. e820 RESERVED memory will not be
used. However, there are ranges of physical memory that are not covered
by the e820 table at all. The kernel will not use this memory, either.

This commit expands the sanity check to treat memory that is not in any
e820 entry as safe.

Signed-off-by: Barret Rhoden <brho@xxxxxxxxxx>
---
arch/x86/include/asm/iommu.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h
index bf1ed2ddc74b..7e9f0c2f975f 100644
--- a/arch/x86/include/asm/iommu.h
+++ b/arch/x86/include/asm/iommu.h
@@ -20,6 +20,8 @@ arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)

if (e820__mapped_all(start, end, E820_TYPE_RESERVED))
return 0;
+ if (!e820__mapped_any(start, end, 0))
+ return 0;

pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n",
start, end - 1);
--
2.24.0.525.g8f36a354ae-goog