Message ID | 165611192645.990447.9154951000881269149.stgit@dwillia2-xfh (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | ACPI: Fix _EINJ vs EFI_MEMORY_SP | expand |
On Sat, Jun 25, 2022 at 1:05 AM Dan Williams <dan.j.williams@intel.com> wrote: > > 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") > Cc: Rafael Wysocki <rafael.j.wysocki@intel.com> > Cc: Mustafa Hajeer <mustafa.hajeer@intel.com> > Cc: Len Brown <lenb@kernel.org> > Cc: James Morse <james.morse@arm.com> > Cc: Borislav Petkov <bp@alien8.de> > 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> > --- > drivers/acpi/apei/einj.c | 2 ++ > 1 file changed, 2 insertions(+) > > 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; > > Applied as 5.20 material, thanks!
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;