Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp983811rdg; Fri, 13 Oct 2023 07:06:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWFqgpe5XWjY2Kghh3FFhaVaIQ+MOQaOA1012Bo/SZVmbmTxh+ag6R1CwuyUW3rK9d4oVC X-Received: by 2002:a05:6a00:2e84:b0:690:3a0f:4164 with SMTP id fd4-20020a056a002e8400b006903a0f4164mr30704834pfb.19.1697205962422; Fri, 13 Oct 2023 07:06:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697205962; cv=pass; d=google.com; s=arc-20160816; b=d2+VehXzNeqCdjeClbAGRd/uAD7XvCMVLG7tSuZOmzKvgLSwk4vqte1CnvQTy7mkon Coxq5YJPZILfEKCl4rLso1VPzTVuH/hkCtxVXgm4dM8V8L6WedjJ9XnuIro1+MovYd/l KcDylbDPl7/T+6tBfQzkYXQ9LGOYQ2c0134WY7Rv7QL/XzXeyRTNoJISwKpb8jbBMGD/ SdxTCToqulpAH5Rbg3pgWZv7+k+AlERPew73f1LM362O/VgHuuMLWcqBTtXzVbt5moKR i2lx5MetLkCfgAlSMlY5o1SFw7YN3jLHNE5YnSvZpTRNButCy/frS2BKYuKHlgboo2tk Lysw== 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=RxdeAnXwdJ9Ow7zvNKdWFzKTYHy13VNdgWCSKcXrewY=; fh=IlgHnfNhMfyw90uPDYzMpw3iviW2Wqor8eqOtpESGe0=; b=mgC05ItfASk1sYM9AXTyRMNB1QEitTBhz6lArEP8JrxI0P7WjG0fw6cbO9cteZA8oF AGQUYztW2hVYCgmxaTxDaQLMh+iCJjuS+3mDRMEK9AlLBBk9jAvNoUswxa7+lJfaC5tG uKKBZf5R9vQKEgS3e6wyk6MynoSJTqOkj2BlU++U/ruGXST3jz+S7UH3kxQRQSdUNbVE 4xFVcZhxp0z/xLY1rzGROg1w85MAr9DGq13XTejGU9ju3SHkea75rz2CeQlNEzQcHve9 io+FoAdp2AfhRzpdZRKTKQ7njoSYWoGIQmP+9Ralr5wpAg3cIdUPYAhRvX/mA5Z5VKg1 yXYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=PoxmVP97; 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 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id a21-20020a630b55000000b005578c6a7672si4704957pgl.90.2023.10.13.07.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 07:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=PoxmVP97; 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 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 1849680A87DC; Fri, 13 Oct 2023 07:05:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjJMOFo (ORCPT + 99 others); Fri, 13 Oct 2023 10:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjJMOFn (ORCPT ); Fri, 13 Oct 2023 10:05:43 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF2CD6; Fri, 13 Oct 2023 07:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MlnjfqxhPFtDakbUW/LpLCLjtd/etr7hAq+Zz9ey26YNcjjtnbag9YNzFBwO8ILf4yeHyZrz6SJNvbdqQK2B4G1oDAFRA0OrcVEU/DB+Eb2O22uRH1EdNrVLbcTM7kpAtqocfNyx9rBxJe4+BPGFrG3e96bVlHF+pESGXnl8E7wLPLzf5cJ6ijaokO2i3CUc9+QeOtnfpnl9tJIUdVfptfjWECHjPbLWVVKi6nOrepZJFv913H+YgaFs2MTS1FeZ7mCnOkIqqRB46bQo8KBsVv+dBLvvMepIYmDEAxH3t9SKfXqToz8BOGuDZX/DQCJ2PCmhy3xgrgHdFq2k9Q++5Q== 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=RxdeAnXwdJ9Ow7zvNKdWFzKTYHy13VNdgWCSKcXrewY=; b=EG0TME2SX2r5Kg6STiMgndxQDE+4kG/SH04tNCqz+7LgVbZ5HR1MqYO/DzHiyKJZtGQ9q6T3dHYjETSa1+1KpvzD4wMqmqQ/gncp7nr61a4LAZn/nNIRkjelYXVPChQI4Y68UhZVC2CupcLOV5riyCwSKEyLqVb/5PJOkaKYSMdrCRYNsZLufbxsKhYjrcCanmZACXqdbj3Cl1qd5P3qf8wCuAkJh1vuQydtGOpB342DV4FJUJ7o31wXIv7JfG1mj6udKWtqOojyEVZfzkcC2EFWn/qzzd0afuLkzFvrY1+xBWTC2s0TEcTqLaOissrga909zJcsWYVXdyIllCaY0A== 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=RxdeAnXwdJ9Ow7zvNKdWFzKTYHy13VNdgWCSKcXrewY=; b=PoxmVP97pE7mZVozwFvPdhwO3XYqESZEeTwgBjhqVfzRrO0oJCf6imE1YsVrXmsD4Ax/ZN97W1w03agDgyiV7PdDIHGGi8vt6WrIOn8LiaT6XtWy4m490sP9icOOBlIcrVMv7rujlQe7Prium4XL4aCWbviMGG6OmWwU+04t4iRHmpqHSszNaPNc83CaJCYnA3i2VveeY7BuNIkFZ7l5gT/s4DevbMgzuWp7cq/8i5qRuv/99H7YZKv0J42CL5MwWYgMcIIo51Wz7kEALxDEc/XpVcx8YtCRslTs3I9uSmFMuPOUYTMfAYrHaFLtYmngGLinp+SzHKK4sXaogyWA2g== 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 MW3PR12MB4538.namprd12.prod.outlook.com (2603:10b6:303:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Fri, 13 Oct 2023 14:05:39 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6863.046; Fri, 13 Oct 2023 14:05:39 +0000 Date: Fri, 13 Oct 2023 11:05:38 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: "Liu, Yi L" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" , "cohuck@redhat.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "mjrosato@linux.ibm.com" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "peterx@redhat.com" , "jasowang@redhat.com" , "shameerali.kolothum.thodi@huawei.com" , "lulu@redhat.com" , "suravee.suthikulpanit@amd.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" , "Martins, Joao" Subject: Re: [PATCH v4 05/17] iommufd: Separate kernel-managed HWPT alloc/destroy/abort functions Message-ID: <20231013140538.GS3952@nvidia.com> References: <20230921075138.124099-1-yi.l.liu@intel.com> <20230921075138.124099-6-yi.l.liu@intel.com> <20231010184932.GT3952@nvidia.com> <20231012190931.GO3952@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR01CA0057.prod.exchangelabs.com (2603:10b6:208:23f::26) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|MW3PR12MB4538:EE_ X-MS-Office365-Filtering-Correlation-Id: ee892394-a32e-42f9-e59a-08dbcbf57ac5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eNVeq2ocIAVGfhrEakHVrQtK+NqkSJLxkMU1vq7tpeQ3ht7eE3Cd4ZkFJWlz7eYhdHJ7FJOgJZGI+4qBGzfRbVKa1ztdHla17iBYEbXbbLqSKBjX9PA/MtiE+w+sTBw7J4LS8YJb2O5uysi1KZZdqgw23ORo+PWEAswRIYOHfU26FV2Z2y72rK2fdYSwb4U0ffSS+3X8P5CZfoMdR6WdlBTBOcc6nn3JPXUW5uJhOw66qjdUUEyqYzHra7DNcYJMwnv3wfrPCTV88qjHtz5g6EO7ThV9+MKRgU720q0cj+fct3dZ/Ux1apZHAjhiZz0jm6WVPBDFAd2RQHZOsI0yc9i6xheL2Ugc43F/z6FJMv+toHpUSydYrNVqFpjSv7936mNm3bKdBYgDk5435nHJspibc45IvYSn9uKvcNcpoo7Ajz/GmSsIfski/KQhBXub+HJBtkfMzcrI3tm6jZFJErqn4Xztkq7Zs59tg4bvkpy+/v3ZfTS3w6eoPH027EuSlUjx1chpuxHhrfPRwog/b/szYswTCkq0ZO1EZ6KP0xQTwdEte3fYU7o5/F/EtVEn 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:(13230031)(376002)(39860400002)(346002)(366004)(136003)(396003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(7416002)(2906002)(478600001)(6486002)(4744005)(41300700001)(4326008)(8676002)(8936002)(5660300002)(66899024)(6916009)(36756003)(66946007)(66556008)(66476007)(83380400001)(54906003)(316002)(33656002)(6506007)(26005)(6512007)(2616005)(86362001)(38100700002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oAIX0muRG2e0f+NsnZ6Oe2P7HENXzxBiU6DR2phlZQNvGMqR2MDTrZxaW0lD?= =?us-ascii?Q?w87tVjnhcxduWjKD7eaTlC0i0sWQZpQA5NqBoEl1EeNLtgwJ52O7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xoYO12kx2+T+D3NERRStO8A4jwWt+kwad/qV9K+q4P4VlI?= =?us-ascii?Q?r7f6l8sy+lUXzJe/cCwJgA5PLVYkhT7YuKMyx3R2k6aurLT3DkmHO1L1xzrW?= =?us-ascii?Q?MuCuPYsnuBtDGUwFbT+2b0fcva97IQ3LU2EmfmrIswXjqvD5Dx2xmO9DpCuQ?= =?us-ascii?Q?BWj6utWqQ5ZbPT56Nd1REpa1XLyV/8Gnf6l7iYzwWZPJlzjVYbFO5gI2G0cB?= =?us-ascii?Q?KzvQR1OrZhACosLj1WoMEQbuSr5fhFMwYgZsBtIG8868rgAmx5GV8r+lxBWk?= =?us-ascii?Q?LK2kKQ4BnAcIXstKRX21FJCGD0qd8EMwGyriYvwWm+l+sAAdl7oyp5KzYgqM?= =?us-ascii?Q?gVsPRQMSD+U4J2mNNJBmI4SLTb0M58HihdpvSkuZ1ppWRE99Q3igVMudtR5N?= =?us-ascii?Q?E+j8cBYENfeytMzfa6ej7TxN3a2bmUugEznRr6a/EyUyAghj36qU5ElPlwHk?= =?us-ascii?Q?auAdUQcOQhHaaJ3rtdJ0i4sGSgnbHNAzNRSKgHvPSJ4NCm38JSH9wojuLFKY?= =?us-ascii?Q?MPEyddRc9lxu6K+yAXKIfEqWuC78oAA+eRH5gtLMZAnV2MRo3khon9l8ypNE?= =?us-ascii?Q?ReIOrgvwk31TODIZNQMKAdinVbxaYizEAi52g8Ir?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee892394-a32e-42f9-e59a-08dbcbf57ac5 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 14:05:39.1505 (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: iA4NSsTEnRDVwmPRUNwSx3CJPlziRDc1UDuVy74PFlNWstZnkMWx02p1Izm2Tvml X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4538 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Fri, 13 Oct 2023 07:05:58 -0700 (PDT) On Fri, Oct 13, 2023 at 07:13:34AM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Friday, October 13, 2023 3:10 AM > > > > Also, we probably should feed enforce_cache_coherency through the > > alloc_hwpt uapi and not try to autodetect it.. > > > > In the past we had a long discussion about this with the conclusion > that user opt is the ideal model but it's fine to stay with autodetect > and existing vfio/kvm contract for coherency detection until we > see a real demand for user opt. > > Is there anything new which changes your mind to have user opt now? I guess, I was just looking at the complexity it brings to keep that working. Jason