Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9176330rwr; Thu, 11 May 2023 11:00:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5b2rPDNiz07Z9PgUkCJRO37piHBTeUml3OY6YbTrKJeqR+tg/dKhxO7rpawhF0W80l6n8p X-Received: by 2002:a05:6a00:248c:b0:647:e6d9:88c2 with SMTP id c12-20020a056a00248c00b00647e6d988c2mr11702673pfv.0.1683828034848; Thu, 11 May 2023 11:00:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683828034; cv=pass; d=google.com; s=arc-20160816; b=wLUs80qtZunn0U7sNT4LvaP8HhczQDZ6sjLC4AkWlLhDAsvmPUEBSOSwUXezdaxwrq pT2fbe6D8d/5NOdQgE1Imq0jpCDj1DJE7yslNDFDXRDHhkWFPfrmKUUylnJEUHxJa96o u/AEA65pRXLSBPmtyJLUB88eErwETZT910+csZql2KJOozCRvfOLF2il9w3PdFxsPTN0 adjKaxaxrk5yRKc5rVq3QjngFPKvndDbvmKG9FWR6ZbmMSppLwameb1BCO0STGyDxChP Zt/vbyp6niww98qnL5kDlFHT5fNVSLvdumxwWFxPG3fljQBIuWEw6Qd7hMr/ZhTYIMEx vHRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QDVpxH42YijfZJcYLUUDi10obarGOHqBDUoE2cHdBDQ=; b=kqS07WsvyhJhqz4PvJ4x1iKPs/fo84eEkMQfqNIRgem4lmxh8+j7IcU2EdrAamhfG/ FBP/vNSiR/IukYB1A2V6321eV+8Eevpt3yRsdt7wc+BPhRJiSj8tsLqSqSyJQEYWDZrW dw2lqZro6x19ccTg84zlzuqaDmfol0mP8oNdTRNVupz73YDSqP7+CihTLi+eooW/z21F +CAztZnMNvMdZpvPQHHXdllqSLAWGRV1hQs3PM4fyQ6GpM9FtCmZsg92x3OU3K3ZAQjG IeEAZurGnzzsKq3eMU1ZPI4lKle3UVB2yYALPrDaQ81FK3zx20hZTisptez04wfCWSYm 1f8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="WKIJg/KQ"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a637a45000000b005186bbfb286si7552652pgn.308.2023.05.11.11.00.21; Thu, 11 May 2023 11:00:34 -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=@Nvidia.com header.s=selector2 header.b="WKIJg/KQ"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238890AbjEKRrz (ORCPT + 99 others); Thu, 11 May 2023 13:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238737AbjEKRrx (ORCPT ); Thu, 11 May 2023 13:47:53 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2071.outbound.protection.outlook.com [40.107.243.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE0D31BEC; Thu, 11 May 2023 10:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fomJMLOEtNXUnUseKOBeWJrM151ulpIaTWpat3QivrEZKhlXz4NFOS1Yi84ALdwfmEJbN3wj9joaPN+lg77l33AEyRZpqP70mzBjnwwnBe0tmnJ9WXtElKIUEnUZo3mIe+EMyQlJgywEgQT7gJEQXW3UVoBL/teGp/XXI3ZqCm+n3n3+XWmcZnMG6jabi1yH/s2CYaaLELfjzLc6zxniftOvAghlehHjlQUu2G09MuSIcp5Ebx+Ttk/hpqm8A10RKOIrOTFBFSo5j97gcOBaEHNokjwDPubTitTwFDazTB0GAcKyfrPkjWMF31rpvYFmZiYJPMllJ7ZzOMlgPr3qSw== 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=QDVpxH42YijfZJcYLUUDi10obarGOHqBDUoE2cHdBDQ=; b=TotiyMZHrZ/nzWjSkCPXLCOfi6u8P2a9HhHUUiGse948lb+2/hskNTSBvDQ5uc4aFglhpIkKfuZb+uyt2HdxE7Kp5HkPygnFWwy2HGi3TJms58wuRlKq7YtxL2XYvcxUrHMgXUd46khXfgHW0dlU8hXE/7D6Q4+BRJc5ZPhTk2RI0WxKbTcU/rn1/szfsydYaH6wAdxvgV2wrS+TjAvJRUnkJpvuTPUECxFwgwfAgVws92BiW9NB9OytrphnMkpMHW4u1ud4p2DfdJq3oQzKJSgkzq6vX3TX9eIHFtAfDTrsbEfqzOdcB37KGRrNG5JoqTHgRTpg2pNKMLWNIXNDIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=QDVpxH42YijfZJcYLUUDi10obarGOHqBDUoE2cHdBDQ=; b=WKIJg/KQBLFS25VLQX2s+i95aKNFDA4MScTH3da0ETXD3mbosMP96Zzx2Sq737RGMxgtT+FjRI1KkMjlMPVWsyk31Vw8JsRI/uWLAaU62hvwte69vQ2nbdqOpmJXxVl0Ur6OnQnreN0rKOsdjQuV2MSkXjitfueZ+hqFIc3+mCRdlattjO5VLgW2N8JjzwmtSZdaKplwLE6Xc8aYSgdlAmfanujokVMapGxFVU6WdHxusCDgtJZOjJabSquJqxnwoX+zmJl375GvP02/D6M3JDHaEdeY+TdcW6GD8Z5qPlkp6rlKMV+JVBQBapFHog3S7qGFOissutWWwbGOu7Dcgw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by DM4PR12MB6301.namprd12.prod.outlook.com (2603:10b6:8:a5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 17:47:50 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab%6]) with mapi id 15.20.6387.021; Thu, 11 May 2023 17:47:49 +0000 Date: Thu, 11 May 2023 14:47:48 -0300 From: Jason Gunthorpe To: Alex Williamson Cc: Yan Zhao , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kevin.tian@intel.com, yishaih@nvidia.com, shameerali.kolothum.thodi@huawei.com, =?utf-8?Q?C=C3=A9dric?= Le Goater Subject: Re: [PATCH] vfio/pci: take mmap write lock for io_remap_pfn_range Message-ID: References: <20230508125842.28193-1-yan.y.zhao@intel.com> <20230508145715.630fe3ae.alex.williamson@redhat.com> <20230511100706.63d420db.alex.williamson@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230511100706.63d420db.alex.williamson@redhat.com> X-ClientProxiedBy: SJ0PR03CA0342.namprd03.prod.outlook.com (2603:10b6:a03:39c::17) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|DM4PR12MB6301:EE_ X-MS-Office365-Filtering-Correlation-Id: f6147bd2-ddf1-4601-6523-08db5247d672 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rHo69usaUg/wOc+KRI5CaV7Hzopym7T5Wxmx9pCQNHrQ7LDlIIeF3YNLzacATfFZ4PuPwVkwT/HmARrRPbYjeu/ZKLLxmMXsW/ulOlu5W7ugHa6ERiSePkddAKuCQmOjugJbaYi1PtMJzmYUqn4BGuNt2titePoLpNdZ6ZxylChFV97s6QCUGim+DDwy4AyYt55hdUOPV9th5uoTc73xxAKKgzAgy/18mkrb7poVW/byU2otv1DONTmwLJn1tRx3Vl/sesYFJsXO/5nP7jTr+6XPZBvaQqZrNJzErq+RBCOEGxZZmdj/59sffwV1CbSTjV+CAdqKeakRvdZ1ezPlDargxcyCJISzRjnKd55VdopXzpQg9SPUsjuoQ0+0igbQV/wH5Sdy73Ef39szI43tCsoPE49rxZ9qHcsuNCU7sPGhvbwSzhqMCZWdBUyDSStapWvjTnImOUD3u5kVPjX/bvgnvAJadXwQFDWTuW99tHaWguQkbW1d3UyPxm8p9px4hp6n1tRN0tGMc6Xs9u9yB/gncAcJW8Iej5WaVq15hkKB2H+hOUMK+gIsbPgp6jIs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(346002)(376002)(396003)(136003)(451199021)(38100700002)(5660300002)(6486002)(8676002)(8936002)(478600001)(54906003)(316002)(6916009)(4326008)(66476007)(36756003)(66946007)(66556008)(2616005)(86362001)(2906002)(186003)(83380400001)(4744005)(41300700001)(26005)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2jVkcj34JvADKYr1THERsXc0Hp8kodl1//nSpDdm7q3iiTvYYu5wl6aPEKlQ?= =?us-ascii?Q?panmtYWACjuYirYmxLFE2UkS7r9iYajZTMQvRp0NJzyfgDPiCMd8bZsBgcwT?= =?us-ascii?Q?TtGHHkJtxVtPxPGUdD4/YCFOYGZfYeNFcdkFint1UGAKBWnfd41Y0XkFTZZ1?= =?us-ascii?Q?o/QnMw7eAmdxN0/Hvr6d+dnsRL+d57AybTJxMIJ5iSN52yk5KKZxxYWWx3TT?= =?us-ascii?Q?Hd7sza8aVRkxZvZG2J11PvsUy+6dgT5REe9yY/W0MuybJGpGtJR2yKBC+ngP?= =?us-ascii?Q?aIq0kSgookvnNrLofB0WogY4xEi6V+OBkCyCagh5GDjD5MQty2C6JJfQqkoB?= =?us-ascii?Q?C0vPnidUxOeI8IZPxSal8YNKL1n9fMJirMACdRKa0o0QxSyiRi6onrHS5j2o?= =?us-ascii?Q?aomcapuYl5jA3cpMYFme1RyteB9zo49RiGRDKheqTloXY9A8xEot4huD2Svi?= =?us-ascii?Q?uE3owO0N152sp8RJBxgmev+I6ty8nK9oa8HVt9+xvvY4/N+jGDRofxfIiUIC?= =?us-ascii?Q?i9XK6H9J8hFe83IXBiOdWMd03D+mSKy2OPVkR70EwWXoEp9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EL5rSMH6FOgfWBOoXlTrms7AJCuiFw7K9Z7fD+?= =?us-ascii?Q?do0BOiww57t2AHaEA6NlVxZRKZuBgD50kiifgMQugDZwM5+PdPXaGCFIVSyu?= =?us-ascii?Q?o/vZjHCbPzV8W9xxQiep4rRCWwJkWjCSlLX3zZnY?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6147bd2-ddf1-4601-6523-08db5247d672 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 17:47:49.8866 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cPmX9rAsI7Rzja+9+an7RbqOB8Q2sdtqBztmXd5Q2zIA2mPNCRWBRM/9rVH46A+R X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6301 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_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Thu, May 11, 2023 at 10:07:06AM -0600, Alex Williamson wrote: > > I vaugely remember the address_space conversion might help remove the > > fault handler? > > Yes, this did remove the fault handler entirely, it's (obviously) > dropped off my radar, but perhaps in the interim we could switch to > vmf_insert_pfn() and revive the address space series to eventually > remove the fault handling and vma list altogether. vmf_insert_pfn() technically isn't supposed to be used for MMIO.. Eg it doesn't do the PAT stuff on x86 that is causing this problem in the first place. So doing the address space removing series seems like the best fix. It has been mislocked for a long time, I suspect there isn't a real urgent problem beyond we actually have lockdep annoations to catch the mislocking now. Jason