From patchwork Mon Oct 11 18:59:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 12550893 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EF61C10F07 for ; Mon, 11 Oct 2021 18:59:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4349461074 for ; Mon, 11 Oct 2021 18:59:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4349461074 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A1FA36B0072; Mon, 11 Oct 2021 14:59:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A9876B0073; Mon, 11 Oct 2021 14:59:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75D92900003; Mon, 11 Oct 2021 14:59:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 4A38F6B0074 for ; Mon, 11 Oct 2021 14:59:35 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E7C82181AC212 for ; Mon, 11 Oct 2021 18:59:34 +0000 (UTC) X-FDA: 78685070268.17.AEF4747 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf28.hostedemail.com (Postfix) with ESMTP id 3AAF990009D9 for ; Mon, 11 Oct 2021 18:59:34 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="213893737" X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="213893737" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 11:59:32 -0700 X-IronPort-AV: E=Sophos;i="5.85,365,1624345200"; d="scan'208";a="562329884" Received: from agluck-desk2.sc.intel.com ([10.3.52.146]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 11:59:32 -0700 From: Tony Luck To: "Rafael J. Wysocki" , naoya.horiguchi@nec.com Cc: Andrew Morton , Sean Christopherson , Jarkko Sakkinen , Dave Hansen , Cathy Zhang , linux-sgx@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, Tony Luck , Reinette Chatre Subject: [PATCH v9 7/7] x86/sgx: Add check for SGX pages to ghes_do_memory_failure() Date: Mon, 11 Oct 2021 11:59:24 -0700 Message-Id: <20211011185924.374213-8-tony.luck@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211011185924.374213-1-tony.luck@intel.com> References: <20211001164724.220532-1-tony.luck@intel.com> <20211011185924.374213-1-tony.luck@intel.com> MIME-Version: 1.0 Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf28.hostedemail.com: domain of tony.luck@intel.com has no SPF policy when checking 134.134.136.126) smtp.mailfrom=tony.luck@intel.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3AAF990009D9 X-Stat-Signature: rbxbkr8gdkz4zfynkn1gmqims6yqzabf X-HE-Tag: 1633978774-614941 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: SGX EPC pages do not have a "struct page" associated with them so the pfn_valid() sanity check fails and results in a warning message to the console. Add an additional check to skip the warning if the address of the error is in an SGX EPC page. Tested-by: Reinette Chatre Signed-off-by: Tony Luck Reviewed-by: Jarkko Sakkinen --- drivers/acpi/apei/ghes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 0c8330ed1ffd..0c5c9acc6254 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -449,7 +449,7 @@ static bool ghes_do_memory_failure(u64 physical_addr, int flags) return false; pfn = PHYS_PFN(physical_addr); - if (!pfn_valid(pfn)) { + if (!pfn_valid(pfn) && !arch_is_platform_page(physical_addr)) { pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid address in generic error data: %#llx\n", physical_addr);