summaryrefslogtreecommitdiff
path: root/drivers/acpi/apei/einj.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2022-06-25 02:05:26 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-06-29 21:24:19 +0300
commitb13a3e5fd40b7d1b394c5ecbb5eb301a4c38e7b2 (patch)
treef81b7a3fcd5eda532e9d5956f1d3520a28ffe23f /drivers/acpi/apei/einj.c
parentc3481b6b75b4797657838f44028fd28226ab48e0 (diff)
downloadlinux-b13a3e5fd40b7d1b394c5ecbb5eb301a4c38e7b2.tar.xz
ACPI: APEI: Fix _EINJ vs EFI_MEMORY_SP
When a platform marks a memory range as "special purpose" it is not onlined as System RAM by default. However, it is still suitable for error injection. Add IORES_DESC_SOFT_RESERVED to einj_error_inject() as a permissible memory type in the sanity checking of the arguments to _EINJ. Fixes: 262b45ae3ab4 ("x86/efi: EFI soft reservation to E820 enumeration") Reviewed-by: Tony Luck <tony.luck@intel.com> Reported-by: Omar Avelar <omar.avelar@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/apei/einj.c')
-rw-r--r--drivers/acpi/apei/einj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index d4326ec12d29..6b583373c58a 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -546,6 +546,8 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
!= REGION_INTERSECTS) &&
(region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_PERSISTENT_MEMORY)
!= REGION_INTERSECTS) &&
+ (region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_SOFT_RESERVED)
+ != REGION_INTERSECTS) &&
!arch_is_platform_page(base_addr)))
return -EINVAL;