Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1861287rwb; Fri, 19 Aug 2022 10:36:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR6nfQfPG50ZaCLk88fu/zBErUOwxeyldPyh7rUJ8od1dSI09BSV+k1qP+VUift+sn1r+bra X-Received: by 2002:a17:902:d48a:b0:16f:c31:7005 with SMTP id c10-20020a170902d48a00b0016f0c317005mr8543486plg.173.1660930565476; Fri, 19 Aug 2022 10:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930565; cv=none; d=google.com; s=arc-20160816; b=XlRGpN/DQxb1hhWGarGFkB/U5ww26DxEM0ZlNh4HtlLTNYz6xDAFmyGlgd95Sfe3E7 89XTA3YtfU6fzeFtKORxjv4bhyb4Wd8kT9NOYAHe3+4LmEYuIk5LETdmiq1CAWEGNakC uOHeh3aBxc89qG2gbL4bmbbgvRWuc5hCHeToRI924VM9Lw464bp/knma2lzqnOEDkjbu a8eXlkbkLlM73ROgOWJCt7SnoDDYnl2PSapRwFCBSoECwyOmvxBiR7mXedR6QsjLY7h+ 3vNSFkBmDH+q0mpxqKpWaHv5NXvDUe9Lm6gWkEeIcAmQ4FdyDfLLyi8CE9+pjMOUTH0/ 8Nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qFd5kzu4LWWO27jaTeruEpOxz22sAdc/Is9cudRc6lw=; b=wFGguw5dtx4w892JURDtFTX0UN92/x7Z/JQ0G9apudGgNJ5syn+9w3oLUue+Udss2z wA6nmz6P+I8J2pzY19QBNNeFyI6VHSzRo272kdOsNYpxFGz6r3cMhIdnI8f8b3YPmgdG NZBgq2q7jhg0zL3vtzigTex3RrYeLh/lOT7mFA66VWvkK3X4WJ/OhCsEEm0YIqsoHyK6 uVNEXesGqJrLmcimquEAC5G6czKueMVnuUQ0h0l6F71OCz2DlvG0Zs3rfYBpyiF/K0fB H3yn1z7HGDaxta3+tYf0HxOibDW8aX2dMwvHTujkEY/HaEN0SooxwUdysODFwUq23AHa VtSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2iMAkaV0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a637703000000b0041bba71e255si2533162pgc.91.2022.08.19.10.35.53; Fri, 19 Aug 2022 10:36:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2iMAkaV0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351036AbiHSQAL (ORCPT + 99 others); Fri, 19 Aug 2022 12:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350936AbiHSP7K (ORCPT ); Fri, 19 Aug 2022 11:59:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A128B108F97; Fri, 19 Aug 2022 08:52:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21C31B82813; Fri, 19 Aug 2022 15:52:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76624C433C1; Fri, 19 Aug 2022 15:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924318; bh=hHjXvohnaNdS+Nlt1BdI92wZ/8EHawjr4j2i+Mkh8F4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2iMAkaV00u+7wI/0EVmN/snbQsRqxGS5Xk1rz9MKvTKHEI6IetqptCXqHGheFdxgm gxinrDzzxcYxtbGpTGAfT/esUomQIV5TcBzh9LKJLwXDIckjP1oTW/ZIGFcVxu3c5u gtzb/nfPHNzLa8baObIwxkz1UJr56Aa+YqGvdTxU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Luck , Omar Avelar , Dan Williams , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.10 131/545] ACPI: APEI: Fix _EINJ vs EFI_MEMORY_SP Date: Fri, 19 Aug 2022 17:38:21 +0200 Message-Id: <20220819153835.193817455@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Williams [ Upstream commit b13a3e5fd40b7d1b394c5ecbb5eb301a4c38e7b2 ] 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 Reported-by: Omar Avelar Signed-off-by: Dan Williams Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- 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 133156759551..c281d5b339d3 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -544,6 +544,8 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, ((region_intersects(base_addr, size, IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE) != 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))) return -EINVAL; -- 2.35.1