Message ID | 20230405180134.16932-5-ankita@nvidia.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 897BAC7619A for <linux-mm@archiver.kernel.org>; Wed, 5 Apr 2023 18:01:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C8366B0074; Wed, 5 Apr 2023 14:01:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6767C6B0075; Wed, 5 Apr 2023 14:01:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F0DE6B0078; Wed, 5 Apr 2023 14:01:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 412796B0074 for <linux-mm@kvack.org>; Wed, 5 Apr 2023 14:01:55 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EBC21AC434 for <linux-mm@kvack.org>; Wed, 5 Apr 2023 18:01:54 +0000 (UTC) X-FDA: 80648105748.09.613491C Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2069.outbound.protection.outlook.com [40.107.93.69]) by imf24.hostedemail.com (Postfix) with ESMTP id D1AFF180033 for <linux-mm@kvack.org>; Wed, 5 Apr 2023 18:01:51 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=PZcCFz0q; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf24.hostedemail.com: domain of ankita@nvidia.com designates 40.107.93.69 as permitted sender) smtp.mailfrom=ankita@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680717711; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Lbn51B6boribzXbBrYXY0Ya6Hm0KLcNEK2K3S+ou5C8=; b=rlqmbxFfrJtNnCaOrUl41pIORk69lTeF8py7F2FBoRv0cKeU7MBHlYi7F5te24YBfBa5QR 8Yb/XhItHJ1vN+sI+lxxTNhBxFQx8s62UaILy4pS7DKA6UyooHrGVhrvmVl1gUgeiEblG7 whtS6pSx3iApz8FG+r7Jnv1/iMD8XO0= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=PZcCFz0q; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf24.hostedemail.com: domain of ankita@nvidia.com designates 40.107.93.69 as permitted sender) smtp.mailfrom=ankita@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1680717711; a=rsa-sha256; cv=pass; b=j0I6MQthCMSxdzNyBdDScim8TYK/n5msHbgGFPlFJDD6VH3LRXXhp+fcyRdTZeQ1+hIJ6J npP1VR64WdWiLzIP9kJk798J7/Kjwrp1LP6qfCnOw9GFVf/jLdT/7c1XLk1rZUCZaQSltn Rg37uCAGnZa67X4C+IVEQbkIyBE0O5Q= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mk16Qisdbe0+HbJZYZO05tRGYuqSxSSQgAbCYG8g2V4dm1cQkMry7SJ18tDQOJaCImLF+pJv63LIaFDPLoNT0ownDmto3e/MKi737P2PrKEx40C+FDLf27VjqJj34aUvX2In01Qlg82jQ1rykt0vSu08s/B53lMu5kWFZUVi5MbuFae+4qdTICjIZGW7WFo3twhRXEKaF2D9Tl6SrJukvzkrhFOxtvJIn44K6j68AmFJIY7HrWkS1b3Y/qbSf5NlvWRj5N8PMnRRUk3Wtquf1I1NXDOIx9v2KdsBF6DXMLhLabT8FSqnvgfuXlLquGWkOv8+toSYjX+9q0ahJJYk+w== 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=Lbn51B6boribzXbBrYXY0Ya6Hm0KLcNEK2K3S+ou5C8=; b=MKlLjpD1L6tzVVgw49KWnibuzszKo6yzrPmPTuD+yI7JO/kusH141CPSsleVyjHNue5MDhbW/hhZJ6qRt5W/fmW45P4FuG0IuVM+apc2jWhWKNsgR6B0ET5zlRDRIwHxOq6N0umSZOCVrhtAkNvM28eGHyf1JtSMbQoWn1Ib4B8X432QdUj/zYlrLg7F+4VziDR3s7RdC3/XzTovyHuYDnRSetoMwcvl3kfq1Pn/74IXy40eg3coI4Wd5OkYGS/7EqcbgluybjBBTYrIjCbDcIwvEiU8/HiIBMk6LNGXdvvbqtjW3toP/pXw4+1h0+nrr9myIti7W7Zefvv5Ji4Org== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=vger.kernel.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=Lbn51B6boribzXbBrYXY0Ya6Hm0KLcNEK2K3S+ou5C8=; b=PZcCFz0qH8qNoVLQKhvqdFll5wU0Zc6tG/mKK6JvTISQIxEPlHJGF7RUsxyRSJ6KMxJvWZfASuArYA9Xf+Q1dgycobpZNV4H1LzkkkxQn6qE7K5qLxvBdRzHXUP/dVU3NccSeKhDQi/KPcCtrYgxIwp0cUERNzuQ75OmVXRhNROZ/djX2/3KWQTJT1vGD6cMYnpipuDz8D5DXA4zlQtpvli5n4e6vMVfsgR2QeXoC6M4po/3sG1vzxSbB0kvssNs1ziW0LZAKJlS59Jv/5d3VpvTmpTOdGcTVrMDI3cUnwrjsl9tTfPqfF6f1gGzewAgnyec0ButMXzqcuhQlH5oJQ== Received: from MW4PR04CA0250.namprd04.prod.outlook.com (2603:10b6:303:88::15) by MN0PR12MB6271.namprd12.prod.outlook.com (2603:10b6:208:3c1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Wed, 5 Apr 2023 18:01:49 +0000 Received: from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:303:88:cafe::88) by MW4PR04CA0250.outlook.office365.com (2603:10b6:303:88::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.30 via Frontend Transport; Wed, 5 Apr 2023 18:01:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.30 via Frontend Transport; Wed, 5 Apr 2023 18:01:48 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 5 Apr 2023 11:01:36 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 5 Apr 2023 11:01:35 -0700 Received: from localhost.localdomain (10.127.8.14) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Wed, 5 Apr 2023 11:01:35 -0700 From: <ankita@nvidia.com> To: <ankita@nvidia.com>, <jgg@nvidia.com>, <alex.williamson@redhat.com>, <naoya.horiguchi@nec.com>, <maz@kernel.org>, <oliver.upton@linux.dev> CC: <aniketa@nvidia.com>, <cjia@nvidia.com>, <kwankhede@nvidia.com>, <targupta@nvidia.com>, <vsethi@nvidia.com>, <acurrid@nvidia.com>, <apopple@nvidia.com>, <jhubbard@nvidia.com>, <danw@nvidia.com>, <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mm@kvack.org> Subject: [PATCH v3 4/6] mm: Add poison error check in fixup_user_fault() for mapped PFN Date: Wed, 5 Apr 2023 11:01:32 -0700 Message-ID: <20230405180134.16932-5-ankita@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230405180134.16932-1-ankita@nvidia.com> References: <20230405180134.16932-1-ankita@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT045:EE_|MN0PR12MB6271:EE_ X-MS-Office365-Filtering-Correlation-Id: d58cd556-1e24-452b-abca-08db35ffd3c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TPrqo7iyZ1LzNwd2UFOiHjb3KLRpX/sJApbPGFn+XwlHp+Y9BEaCIuP9RUIldtiCozRqkdlmVSRETW/yA/eHUVbyu34ZvGx/9M9ynBGhLPUrKE8D1xhramLu3R14fw7CBWXzZYwKiwOD4fFGmVxnQrAtmvhBOZmAyiXqdRZZLlFilsSEwi5qztlj6z7kWCobJPVe4KGU7uXEwxOuXXhtZumpWzUo+U4pVV/D59VfdxChneSMlN/JRGOWXNd4rFrDohvPjEr1ujQgeenMln4S01W9CjZ79wCi2T6bO7Sf/8+MeEzQLr0yPNK8otUKAz8of0+QkeS+5Tlqn+aR4eX29QvM4o3qz3JsAIOvSS38Li/CQz0kI0OjhygiWIlBF9mqg9vYSALxFycMqvDdeIQTDOQk9f81DJ8zna4PcPbd4ZPxW6+3iCI2YkedWnBZpZOweU/EZQBZGiHYSVe1mV2gjns7e0L4pCImHw/A/WQy+eSy6OQgMXX4B6fDJjSI3RPL3qUR7irH4vVOhZkCafubX9DpHToB3w2l1rr+gwA+7r2zK5gcgiClbN4I4u9OxsAyMQBj+jeCMIMAkeMvAuqIDHLUceKp/5O+2UziNnzbv3njsWzQ7H4O+49S2UftdS+H50HMZG5PRDbHXIaRrLOh93AmY7lu0GFIoqMOJ1jYLDNFx+UP+VU8JoZSjbV7r32IC9Hiiz/RzhegDkAus1f9M4mRpnr1x6Cf+jG02sFcCmf72Kkw2ZQ8TXtaHNAlwJ4L X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199021)(46966006)(40470700004)(36840700001)(2876002)(2906002)(82310400005)(36756003)(86362001)(36860700001)(40480700001)(2616005)(336012)(47076005)(186003)(426003)(83380400001)(6666004)(1076003)(26005)(8676002)(70586007)(478600001)(70206006)(40460700003)(5660300002)(4326008)(82740400003)(356005)(41300700001)(110136005)(316002)(8936002)(7636003)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2023 18:01:48.8221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d58cd556-1e24-452b-abca-08db35ffd3c6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6271 X-Rspamd-Queue-Id: D1AFF180033 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: epj86c9sbyi1pb4d6mea3o4mpwii1qbn X-HE-Tag: 1680717711-596076 X-HE-Meta: U2FsdGVkX1/ftYlNo1V6MuNI7go0o94Fz4VO23PCGRQlZGQ3O8EpnceH74VnVFpcV0F9nDXp5VF6OKYR4AXVwwVsUvko2RJbRmwuR6TK6YNbe5ucsl/uF4B1mGGCsTPXCavSPgPBGr4gAe9CsNzXODrb+2UJZmwU/b+1RgRVUuA+n954P3VnqwjQ7/AZMnPd9yEl/nDc+MtKHS1nRO3MzUNf7ajsbYL5LEOsCg9XEp4lD/ckZG2dGychxgsYC2JpH4PieL8pnuRU/xMyua0hnps2RN/0FSoq8X0gxNpAPTdQBzlwLttc6M6tXSGqRHFQGVSniwPTyKLRGsOmrSUDJyspQ6ynfNu5JZGUjMnCEZK2vN/tbMVr5fxOLIgQXJ6qn9QrX+1NbqZTSEXxB9CDKldmOZxKS4JI4dycNe7lF6MdFYIxcBAAfzhY1smRV9YalPyhDBlP0QLUREAyTmYlCs2hyVsdWlNHTlX6xDv6h+YT2Y6NCHF/sCVTnXSZ99zCgq9M96axEUH3xeycbQtJnrCt5ysmOcZtFEFlTgxnY2PRqjNdF6yUAZKcYZsllCqygRk4D6ui4fceVtgVZq//qhfo3tx+RZW0HhMhhToA3eE+imjG5jpvym+NIjzZLKTrn7fn/5CB4S6gTd5wPyLQbF7WTaTXTXeBQJ16yqyGOgT4/nEWIdqL3CfGQl4wjTRKcZpMQTBPAOwN8tePnSkFk7vTP7FgPB9Q2mFX8QrAsl+U79+TKQdGBbpucrrrFUNMmizjN6xY0NpX5p/RSA8NGCgme0ppKN+0XFTdPpoDl0kLyBY7qbKjJHC8k5zIvRz1mThs45j+kAuneGoxlO7HMAik4tSHJjSHMIfyxtEqGh43IPM9ifRkcrl88infNgcRzzmunacGF3N+j0AYi3X6TiCHSHpwZm9GFagWRcKjt1K5sFcJoq5QH21gOMRbMnCTssxtFDaX/6t879cglkX kFHqNTI6 EJR0gtpB5RnvbWj5hMf03IbtnJGu5eG3oRCzn3dmmOmiSV01HyT+haIDyVjhLJNPgquHUwCWkn1ZIHqLOht68JfmPNrhYH7WsfhyEV9Is72wn+BZtOuKwOWkXyoGjg1FS09Or9CcvgCuDeBLQXXdfObx8p5hTeSVI40/lulQqYV1kA36x3CZfKuiw+hbO01pdFqQ4OMWrvYIiG2I2ogPuM3hAjWExRlgQ46N5xcE7cMPLjPgs3sO3Vi5qvPdMNsh9ZcDl8iHvnyYQowM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Expose GPU memory as coherently CPU accessible
|
expand
|
diff --git a/mm/gup.c b/mm/gup.c index eab18ba045db..507a96e91bad 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1290,7 +1290,7 @@ int fixup_user_fault(struct mm_struct *mm, } if (ret & VM_FAULT_ERROR) { - int err = vm_fault_to_errno(ret, 0); + int err = vm_fault_to_errno(ret, FOLL_HWPOISON); if (err) return err; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d255964ec331..09b6973e679d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2688,6 +2688,12 @@ kvm_pfn_t hva_to_pfn(unsigned long addr, bool atomic, bool interruptible, r = hva_to_pfn_remapped(vma, addr, write_fault, writable, &pfn); if (r == -EAGAIN) goto retry; + + if (r == -EHWPOISON) { + pfn = KVM_PFN_ERR_HWPOISON; + goto exit; + } + if (r < 0) pfn = KVM_PFN_ERR_FAULT; } else {