Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1531124rdb; Wed, 20 Sep 2023 11:41:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkcAQqWEx2mA2CrYUehUMKB1OsaAOGpVSINM1SP7kWGK/5wri+ILMoADOBPOVO4XzDu89f X-Received: by 2002:a05:6a21:1f2f:b0:12f:dc31:a71e with SMTP id ry47-20020a056a211f2f00b0012fdc31a71emr2747837pzb.56.1695235297474; Wed, 20 Sep 2023 11:41:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695235297; cv=pass; d=google.com; s=arc-20160816; b=wbxqdMOFQWAaLlUwMBCa+Hv3aZI5Cs8dWGtUjNOZqgYUlCJIixNiAZcucp7TUpmjf/ pNOQjT/unZjYRKbcicQY21mVmr3L4P5VbgIaWek0fzQRA9mrLF67Hq9/YJkB4b8MSOts q7G5wdoL1pPbXeW3L4+VOLyYcMN6AHYJO7QxCZAerI6UroBBEC/lVTKl/lh4dkyVwluz fR10OnKZwqnhapPoNYrsbrtFO+z3sSK+BQvIIJN2kbVjIdQhpQBrvO6GEvLS3vbCt1Wb ZwmL/VT8fTojYFx5PJqVlVExD4N8V8ETrqJ5Ne1U0GujoNm6K3ZksC6XgIwhEadnYjgG iadQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nJPM6GxvrfU+SOFbh35kBojQcnerwuMNxRwCXwIw0ng=; fh=EMUvp6C3Q3HZLr3vQ2Vvay1OxhtpSVKZRa9HY2LXjGU=; b=v1scRcR6TZKUZZZdlZp/3n34mUgNt7ODv2UdKETjgdR+m5O8N+eLiRXM2T4q1ZZvmu zu7j/XlPC43XEu7iYXcSgtNrlW4hpcyMZkRIeAaSlMGB9wPTjK0X4enQrwofgQFLbdcB B69qapEgQuqIugNdt3MJ0JfYlMg+Qdouc52SRs9aSd0/dxUc9jCp7QG8xpXsqCgmIqm0 NouRuzvzkx4nN4FN4zk2XFutLEpEZMmvbOe7T6mQFuZK3gxyBtPk0br8+ji5WlePdxcM s8j4VP70Y8n4npcCI/g1hfcn6jZyvq/XgsnKP8ndy8V3qpi5FiKLXUjVOsCe7hHuvp9J JaLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=HPeXu5Op; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u24-20020a63b558000000b00578e7a37c46si1492680pgo.50.2023.09.20.11.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 11:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=HPeXu5Op; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CCB158042A81; Wed, 20 Sep 2023 07:03:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234810AbjITODJ (ORCPT + 99 others); Wed, 20 Sep 2023 10:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235027AbjITODA (ORCPT ); Wed, 20 Sep 2023 10:03:00 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01110E5; Wed, 20 Sep 2023 07:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJxSk/iNQedNw6Mnfnxngnu1fVVk08fMh0Z47BfOGaFe7l3z7hHR14najhxKA7TPW+SOozua0O197QoQOq13Jj7EyxHbNT34bfY1LLeHDk14GKm08SaVI9FBc05BLDxrIr4AOm0aUcv99OghxZ063fEXZxuXlJavBOjMmqk1YqlkKi98bc9y6jBMIuSnbm59JIybqbrNq6USURhaU6vR7Y1ZRxG2CqfWc43yB/vr+YU1xgHPpWsNKnsMlF4Mpz168GAkmtAuGOjcNrd17F7RAiE97kkNxbo240qea9Yi9wS/MYx7H5DQWPgm/xGTVlAvwGAJY+WPVYKywr4Skl3ydw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nJPM6GxvrfU+SOFbh35kBojQcnerwuMNxRwCXwIw0ng=; b=mA9b60YLDiBRJerT+uMDDDxjsdQDYCZ31dUIdknam8od/h6aVRyD0ctCnru5w69M1jStKJh4/2q+kmKkDpJqoRqgjdNO5UWKwWm746XT/V6kebSQSKqMsE2Q7/UYKy5M3XKFEnFQwnmL9tNnYp6o27XQ6YCO1Cq5HUo04QnlUScdpoGTlnIU3DjpZEahvdN4lgrgd+cDoiH+spclcHMdd1LwM1SUznf8paD09ERnkqLpDjHvM06PkNhxuc5kIQLoHgrhLG83kLULe9nRXrXDAAllNYzUxnm2EAItShrs/MvK5orMuSi+N4Yd+hfB6WMjzPKN0HoY/RL+wYjDk6Eb4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kvack.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nJPM6GxvrfU+SOFbh35kBojQcnerwuMNxRwCXwIw0ng=; b=HPeXu5OptSu9mRJh0Gx3xjOL8bKgLmskWJm2uMbc31NDJa7mtIOhSslc8WvXtP5vvC++pB5YCVuQcWuvQQBYKcETd97WITMrAgy/pV04p/Ow76Z4SKDNp0U8yUrU8UeLe9Hh8umGlW5P++iOclV6PYzsZTX4VopMA9zcxUR+7SRZbqFcpddjvQHQB80rpTyKtfchyn81DRRZ63vCHpzPA4TIs05LkiU20ODzBOM9aTkMV5X1SnIBB754EBLejvP7/QrJnXlTQTL3NhWHWwapWlaUctCFZgwXBc4uRQswDiKo7AFFJQDOyJs5ky5knnOsoYKf11qcvzO4wACoW/QuWw== Received: from DM6PR06CA0038.namprd06.prod.outlook.com (2603:10b6:5:54::15) by MN2PR12MB4253.namprd12.prod.outlook.com (2603:10b6:208:1de::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Wed, 20 Sep 2023 14:02:47 +0000 Received: from DS1PEPF0001708F.namprd03.prod.outlook.com (2603:10b6:5:54:cafe::d1) by DM6PR06CA0038.outlook.office365.com (2603:10b6:5:54::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.30 via Frontend Transport; Wed, 20 Sep 2023 14:02:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS1PEPF0001708F.mail.protection.outlook.com (10.167.17.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20 via Frontend Transport; Wed, 20 Sep 2023 14:02:47 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 20 Sep 2023 07:02:36 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 20 Sep 2023 07:02:36 -0700 Received: from sgarnayak-dt.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Wed, 20 Sep 2023 07:02:30 -0700 From: To: , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v1 3/4] mm: Change ghes code to allow poison of non-struct pfn Date: Wed, 20 Sep 2023 19:32:09 +0530 Message-ID: <20230920140210.12663-4-ankita@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230920140210.12663-1-ankita@nvidia.com> References: <20230920140210.12663-1-ankita@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001708F:EE_|MN2PR12MB4253:EE_ X-MS-Office365-Filtering-Correlation-Id: 34cbfda9-142b-4468-32a1-08dbb9e24536 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d0Jy4EnczyibCEUGgEINwvZfy91ADTU5AL9s0fYez1GCX+vuYydmwPJ3dW/b3LlSfI8dnreXrYIBlv7Kow/e4O2XfhGLnzDwNh10YzuNtWrx12bt/jcSYPn+jkcPOPQ2ohfaN4hBoYvoYlmkS1uvIpX+IRi2uVU6FjYw8tIiX9xh8ftELazBGMr4IH1wMjHI/ZNZIYjl8zyqdjEwbz8//6M1LyE1QhGRaes7OtMgr1b66Ff8pRjy2WmiEu+jlNahJoLi6AHaP1KV5lGgDH86k0hZ2y95KtZdPnPg+aPHIZJiOTKG2s96jrbNOsZ5++rPWrsQpDNiPEcQtvwuUub5RzuHKMZZM5dpM9uMKBF0GmVWJ7LXQzhUMHo2ZjsnKjL2Q7vQ0pZ0vfgHwZ7BEEwMPSDXURA6oysWjhxNqMZFOHjbb01hN/dzp0EtTWsJON2ndXVPw3zCC3qGgYP8jeuXEDCxlddmvvYJB/DVgt/qxdLYL+EOEo/eyJCNum/EGtBS9X9yQmobn9a425ADhBfLxE1OWUMG9m0RhBQyQGq1SwbWiZwPFNZGsCULHHC1nA6cBldzjHetQ7pePZ26v3f51fUAMQzIw4/P2zgoQOM06M1n++xdKpQidRxEFZLymItNmI6sEpIEZ6BN/RfAg0xnnIR/Lka4fwZhtPTDn6hKpk/rR2sNBX7FipuNS6tXO3XvTXwnVuA6OseZau8iCEjOhlcbn9Fu3dyLXvYVbPylYl3w24ektRy+WaP7L2pNRQ8S X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(346002)(376002)(136003)(396003)(82310400011)(1800799009)(186009)(451199024)(36840700001)(40470700004)(46966006)(40460700003)(7696005)(6666004)(83380400001)(82740400003)(7636003)(356005)(86362001)(47076005)(36860700001)(36756003)(2616005)(336012)(1076003)(40480700001)(26005)(110136005)(316002)(70586007)(70206006)(54906003)(7416002)(41300700001)(2876002)(2906002)(5660300002)(4326008)(8676002)(426003)(8936002)(478600001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2023 14:02:47.6421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34cbfda9-142b-4468-32a1-08dbb9e24536 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001708F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4253 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 07:03:15 -0700 (PDT) From: Ankit Agrawal The GHES code allows calling of memory_failure() on the PFNs that pass the pfn_valid() check. This contract is broken for the remapped PFNs which fails the check and ghes_do_memory_failure() returns without triggering memory_failure(). Update code to allow memory_failure() call on PFNs failing pfn_valid(). Signed-off-by: Ankit Agrawal --- drivers/acpi/apei/ghes.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ef59d6ea16da..6ad1e4cbc968 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -457,20 +457,10 @@ static void ghes_kick_task_work(struct callback_head *head) static bool ghes_do_memory_failure(u64 physical_addr, int flags) { - unsigned long pfn; - if (!IS_ENABLED(CONFIG_ACPI_APEI_MEMORY_FAILURE)) return false; - pfn = PHYS_PFN(physical_addr); - 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); - return false; - } - - memory_failure_queue(pfn, flags); + memory_failure_queue(PHYS_PFN(physical_addr), flags); return true; } -- 2.17.1