From patchwork Fri Jun 24 23:05:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 12895157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DF0DC433EF for ; Fri, 24 Jun 2022 23:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbiFXXFe (ORCPT ); Fri, 24 Jun 2022 19:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbiFXXFe (ORCPT ); Fri, 24 Jun 2022 19:05:34 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6598896E for ; Fri, 24 Jun 2022 16:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656111931; x=1687647931; h=subject:from:to:cc:date:message-id:mime-version: content-transfer-encoding; bh=sTirgUrkotzGrSH6qecJSFz4C/4Jp50Wc83W3PgFw0M=; b=SUBemZwJv5TEFUbg7b4skPvyHrNDra9BQhz90RzkaZ+OBRCqxBI3ZMxk o14wxSZxR3tHr3Y2IEuPclZHJyzOO+tza+ZPhM5rkQ2xNfRNl1eUA95ky vdgZC99YR82hMRpfvC5FIkBeBUr0vjh5KBEU9/q4C0lkokWlUR/6xjYFH Q7Z8vsV6BMzDI+E+eoXbCHYBRFYkmexKm1IZPQ12qQazJc0r4bCX/cOBb Q/Qz1RBr1gQgzYc2IZVOkC1aczrlkFcSovLJ0JVR+dpyBnjCuT6DX6asm SyaCwuU4TDBCr0aaRpi+VbnDd3j/MuXkk1OUbVl0Oe8HdxDdiza1V3fO6 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10388"; a="306580049" X-IronPort-AV: E=Sophos;i="5.92,220,1650956400"; d="scan'208";a="306580049" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2022 16:05:27 -0700 X-IronPort-AV: E=Sophos;i="5.92,220,1650956400"; d="scan'208";a="678735414" Received: from jooyoun1-mobl1.amr.corp.intel.com (HELO [192.168.1.117]) ([10.209.31.49]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2022 16:05:26 -0700 Subject: [PATCH] ACPI: Fix _EINJ vs EFI_MEMORY_SP From: Dan Williams To: rafael.j.wysocki@intel.com Cc: Mustafa Hajeer , Len Brown , James Morse , Borislav Petkov , Tony Luck , Omar Avelar , linux-acpi@vger.kernel.org, patches@lists.linux.dev Date: Fri, 24 Jun 2022 16:05:26 -0700 Message-ID: <165611192645.990447.9154951000881269149.stgit@dwillia2-xfh> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 Cc: Mustafa Hajeer Cc: Len Brown Cc: James Morse Cc: Borislav Petkov Reviewed-by: Tony Luck Reported-by: Omar Avelar Signed-off-by: Dan Williams --- 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;