Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927673rwb; Mon, 15 Aug 2022 14:13:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4JCrBrVgJ+39O6Tvl3xwkHBLuUcnWh8Tgh+PTk2r6GCZYg/LwrnlgwU946PcapJtZT1o3q X-Received: by 2002:a50:fb10:0:b0:43d:561a:c990 with SMTP id d16-20020a50fb10000000b0043d561ac990mr16117463edq.115.1660597990228; Mon, 15 Aug 2022 14:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597990; cv=none; d=google.com; s=arc-20160816; b=D46BbLTCybjfgv2TJvJwb3fAHXID+o0SWAni7V8ZuKfROCY0cMN6SwQ45yn45NUDac ddSJmmcqv11+pbAEgbIsvFx4a6kdwt+nChqJJT3dGMlR9DpCHtFcVrXGX4wifXaXMqlg sKxSDlyTTK2t0QSYhMkGcvu9zZUA4CQT+favIxhKjlcWv2aIsQf6KZ8EpQZoHs+nn2TX wkxkLq6OkO55BPfYA+7bFADDnV07zTJDtbIg/8O6kPV6cPj7ieux/k0YHKY24w9NsjZa ZrpkZhVB3W+FFxvGbdahDcCTKPNPWKWe8q73gDd31F26yq4oW3TwrDtqdbrYUqFtnHsW CbHw== 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=8GNwjc4QBZq/BDDAEmsoTlroqcBouxO5LGOHIo0G8Ck=; b=TBU1QX4P5NZRu6M4MBE9l4PEc043v6o+cU4y86CLhcQ5qRvDayg3fl1Kwe8TidcQqb gGQnQx58XTtcLN8zIbQ5pDOoFAhcdVC+O7guVkHMt/som9UWuSCPEmkFtFM/V2QKd4lr 4W3dez1IccnJbP7iu9ziOqAXr7IImV26KC+nvobr3DhE1WuTcGzE9eLgPaVW/xU6noiu h8BdOSutoFWl4XjLs8+U9X5wyXVn1V/YLHEnuMTu08NaNl3E/2VnxmnwERr19U9SCNzT c1owG41xHi0glEr43eSRAgrOCxaMOXJ7lgHBvyhXJ9mdrun0ac5kMCz3asnMogbJxXoY JOww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y7dEWDRU; 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 nb23-20020a1709071c9700b0073101ba70bdsi8510997ejc.927.2022.08.15.14.12.43; Mon, 15 Aug 2022 14:13:10 -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=y7dEWDRU; 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 S1345526AbiHOUhS (ORCPT + 99 others); Mon, 15 Aug 2022 16:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348270AbiHOUcY (ORCPT ); Mon, 15 Aug 2022 16:32:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A8ABF69; Mon, 15 Aug 2022 12:05:26 -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 D9CB3B81107; Mon, 15 Aug 2022 19:05:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 386C7C433D7; Mon, 15 Aug 2022 19:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590322; bh=K+svWRMsaEDa8GRYueGfU8Qrf+A3W7XHXheGz2uplTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y7dEWDRUUGy+bmQgZpEBs3dCusKhE5TNigGbss5QawP/LF9lJu0iQvheGH+1drxfH 0dmHUq1T+/1jRl/v+HJ3vR6ADeUHkoCOdHNmFpuhRTRuwlEg6YlPnBn1BsKEi2i45z x1vEjwj/Iq594w3KUu845z56yxiW8vOkjJgD3Zl0= 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.18 0223/1095] ACPI: APEI: Fix _EINJ vs EFI_MEMORY_SP Date: Mon, 15 Aug 2022 19:53:42 +0200 Message-Id: <20220815180438.934104323@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 95cc2a9f3e05..49b5e317e916 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; -- 2.35.1