Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3536892pxb; Mon, 24 Jan 2022 11:40:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmgbIx/+LpD8srAnjxo2FtLD0n5IODi9U3ds4iFkR9lk8wVsU5D42mDZa1/b9ixdgMTfhJ X-Received: by 2002:aa7:988b:0:b0:4c8:b982:d4fa with SMTP id r11-20020aa7988b000000b004c8b982d4famr7824081pfl.14.1643053248924; Mon, 24 Jan 2022 11:40:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643053248; cv=pass; d=google.com; s=arc-20160816; b=sMcJL5TnIYHjfE30kmqvYQa/fDPG+sqezO39cLHcQVNN7OkjJT0lzTDOpBiNcXz1oW C0yT8H2nf+NRuVn1rYvwLDrakZ99aQxrrXBqqb0MMRxZ4xK2QuanYL4LWj0/N6ZN+xQW eSMyUiRUar/UUnOloXG1IxwkzRoZcu3ZgHmXMMXj9nb2L8QzwbnyK/kzZ4jYfITsvWmR gx7lu6h4x83zb0tx+eJnpxnLq9V0rmOf3Y1QXMF4T3GMuT1dcFmR30e4/rea5LHmZ2tF +rNvelPyxEuD/rwkywpm56HKT+dIFaprC8XGOLMqVV+30kRdatnkzdo1fTFDgtYn6okV j06w== 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=vYEBFzAm+76aFeLIl/mwxSlqinNryGozNFn7PHvX0D0=; b=noswC1AbTkA14TtTWUvLT8XB3VTCr4oKgNMyqiYUSzq5wGCpnOJGq9BlIJ8aF3AbZQ df6p2yhQ7iGfEXPU0tj+fQzoQF4JNuH6ZDJpEeGWAubS21t7JHvIPRPTnGkXYtjYLaPV 6MOcw7GCYdeMd0x15oPbjEl3ZAwjyRyDoYIOvsWfkVJltXXI3QeRKs9KWnWQSGYfrxfp z2XrXwyotsrOdYbbEmkmVx3isQ1SX8gJQhJtGK6volghIIPexYOMhg6HmaHZ1oJLzXx7 1zpeX2YzMPtv0mw6j++TyKBbYxypcR+K2IhfdURmoglvharYJi7nIlT1C0lKywRkfTNd 1ytQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=IY6c3yet; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 67si15841662pgi.130.2022.01.24.11.40.36; Mon, 24 Jan 2022 11:40:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=IY6c3yet; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S244266AbiAXRSE (ORCPT + 99 others); Mon, 24 Jan 2022 12:18:04 -0500 Received: from mail-co1nam11on2044.outbound.protection.outlook.com ([40.107.220.44]:23025 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231765AbiAXRSC (ORCPT ); Mon, 24 Jan 2022 12:18:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dqbkg9Ey/PmuiFjD6/WUGQ5v4mq3VwVGWp1TCvVeKyuh92wCTg7IBb/kudmhxikJIYX71nc8/ej4axyWxjxloUpOhyvbgGoEfa7S3lAWM1s6dGsLCyvu5EE8VX4HCpr1Z865RN0MVbSUHE8uYwVHR4ATmLPCUg5TKLR39FdUylW6sPfCXuf5lVgcU9yjrIQ/29PDDIhZONxkcDQ/q14mAmY7RmCpweQ0CsHaJM4qkJhJGNP5C51cp92L/g4Fw1XXhKdf/PYRbzlixiEWvvmsP2w1WADSH2FKtzHpG6QyEc7djD/RnOOfnzDkqNdGVHnigxbQEyNjvHR5FYtLAZGanw== 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=vYEBFzAm+76aFeLIl/mwxSlqinNryGozNFn7PHvX0D0=; b=YtLvwM8xMNAZgy4OXzT7Q+rNpSWnsnjtml/2I7I8t5ah+yQ/2wZ1Galbc1vOa9thLzv3IHBTJ43k6qEIZXeaSn9KS70/fSaY/D3mXE8iCDL0AQG4p5vejXRzOAsAoJNDo0NeWNRWwC7f2RX86RXyhxSgQNdDDC63TL62GxzgGwuNF3e3zakWzLF1+Q3h3zxVY8EURxUlNt6d+3wCut69FbXxo/eZ5aD+I9S+ZGCfBY+P/JURwngDojIcXwcdUWUHAEG53WV7V+O2i5kIhNUgnkPlXNqX3dQQtFINFB3n3MWL6ulq+qhRJIEaUdxMIdcHXkHs+T5RTclOrrmW0g0W7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=vYEBFzAm+76aFeLIl/mwxSlqinNryGozNFn7PHvX0D0=; b=IY6c3yetaYq76TELopEahv/dm6D67fxXwYIzpO5H+3WhuE3P4M9/P+Nr88i/oi7i0q932Gq5kZ5AZQ9zqS4pDIYAfpDSE1kxGYN1Z/YWuE45Jxem5yf+CvHVJMELLEo3iROjLtOJkncuXphEva4lBmUHK4J6xYOaHOV6wwp9u6t1fB4+WFZICeped6kdfveeI9yrTyrCZbkwQ5c6zBzgd0g9roUQyV5TSSkj69UoFntz1a+c2RfgMvp9AqvdKYQAWTeFi/8W/RKJEF0d+F2YdKg8wp6vC+/oCljKLOQQsS6RPvyPEBNXx+Vxwrx5Jzz9jyIzqLjbfF0NzrTb/nqPHA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by BN9PR12MB5114.namprd12.prod.outlook.com (2603:10b6:408:137::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.8; Mon, 24 Jan 2022 17:18:00 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::ad3f:373f:b7d3:19c2]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::ad3f:373f:b7d3:19c2%7]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 17:18:00 +0000 Date: Mon, 24 Jan 2022 13:17:59 -0400 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Lu Baolu , Joerg Roedel , Christoph Hellwig , Ben Skeggs , "Raj, Ashok" , Will Deacon , Robin Murphy , Alex Williamson , Eric Auger , "Liu, Yi L" , "Pan, Jacob jun" , David Airlie , Daniel Vetter , Thierry Reding , Jonathan Hunter , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 7/7] iommu: Add iommu_domain::domain_ops Message-ID: <20220124171759.GD966497@nvidia.com> References: <20220124071103.2097118-1-baolu.lu@linux.intel.com> <20220124071103.2097118-8-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BL0PR05CA0012.namprd05.prod.outlook.com (2603:10b6:208:91::22) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9fd6ade-63bf-4343-345c-08d9df5d78e5 X-MS-TrafficTypeDiagnostic: BN9PR12MB5114:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4SGTk7ceCMglg8vutWBgN25pOTlo7aVHZt5kfd3HKEAl0seNGVlLwS34nt5njxsfel/6AEDKmV0kvhLML4lwJyD1CzdLjSlZhXJEQKDafiju7QJWSwiMQAtwp8rbUUwsisbnp0gZ9tIJ6f7afq0Bf9zVhFsgWuhN3UE/OFMyDZ6noVMiEtU39aFl8FnUSe+rtdqQ4u9/rvK3fcJy2svsPwjlRBn3iRpFtiDB5/tuI06j2gZm8BkJV2w25mEnk3OjJA3RJ8Em6UlNQRpGjWA2TtcSkNqkJKnGccNYY7YOwmWkWXlBctns8oxEMxT2jPLCKM6aJ7GoBSW08+eWPkS79nReYLNUlis3Lu7uney4l9S9d0OweYOTpbzqowqjDPtbZQTM5vEOWD3wSYcc73C2b8PoUHzQKGSRBUK8AjOZNY/k3El40ef5pf2x2K601OqXiBAvhLYK5hQcPPMsul2DndBi2/HWJdYyUOVv4MlM0iQGWNjthOeD95JpJi26XjT9Pnw5RttFMpZ7aCS8VsCHBE67J9HioycgQ1XvQVSNoTFI4tB7usBDzvPkBiqYMhII+6WwTtzsb8/zo8gTKoo+G4qiI3FCP6oTmSTETJhqavAm12kBblaO4WfZn1ZJk2vUNO6HeEUbOLrm0WGYJ1DzQaUFia/7KRi/ZS9jLLb8/avoWEWZIoBgGcHM707vbM48Akmt287iC+/MKJGMmGSlCQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(66476007)(6486002)(33656002)(83380400001)(2906002)(6506007)(5660300002)(6512007)(2616005)(66556008)(6916009)(66946007)(4326008)(7416002)(508600001)(8936002)(8676002)(86362001)(38100700002)(316002)(1076003)(186003)(54906003)(26005)(36756003)(4744005)(27376004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8E6U9U03D03tFvJDwT9kXSRXHfDMNDYSEgo3+R4rPjs+Wzd0/jkEJpbJxjf3?= =?us-ascii?Q?JoJuK+enTGyZUrtfDbSTaW5hGtF/xYezeDBEpwSA3IVRULFajNBQdQQ/oajh?= =?us-ascii?Q?yOnPIcEOkMYFhldLrpnZAa1tFYpDACeABDUf//6a5EWF4RuOW/3ivg46O7Nd?= =?us-ascii?Q?oVHHlSlUMt0hl4if9cVwOgstfLuowDkL8uvTuFS5DiyvDHeSadXaT7fNMYLo?= =?us-ascii?Q?qPRtiBbCruV5v/3EkB/0K3O/uJp+z9z9QW8eaAe31pLz6y5khAwD6EX3YiXu?= =?us-ascii?Q?7P1eVPIsqsk/WqBHOmHjdnp3OKxpUIElHVSasF9T2XnxhUB6oEI4m2mfliLR?= =?us-ascii?Q?2MnUbM2wNtxif5YJsjIoOfh3UAqj/7fzPHVFKQf3ydDuSeG8JuimTlLCptov?= =?us-ascii?Q?4EXmBQbYBQVVYu8uDnxLsXmbnbr7HnuJUXi9lg0Q4kX2xv+t/z81f0GPxVC1?= =?us-ascii?Q?tNpYr6SktuRRCa5y++rb/tGq7pGbIGmvKW6+uqnUsQTe+pOL4Wq10cdk5Mep?= =?us-ascii?Q?jdVM77/4AKb5hh852TkT1lLcJ1PV98s5uFD9uVVLRkiDJeAoLEsxuaxLhfFk?= =?us-ascii?Q?XU1hY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zbRStU93aqeMZA2Xi?= =?us-ascii?Q?JDwuxEEeb3lLKzupH9O7uVax9QWllKbgqiUjsUNBdfvfhN0npEjoxxjqYVcO?= =?us-ascii?Q?xkLKtKAZeW/lwqx3pHA=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9fd6ade-63bf-4343-345c-08d9df5d78e5 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 17:18:00.7717 (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: zzwA3CA6Dd0rMR966bWievsR1EGzhXoW4gzPQUNViGFeILRajI6kKjy/UOpjC0Yf X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5114 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 09:58:18AM +0000, Tian, Kevin wrote: > > From: Lu Baolu > > Sent: Monday, January 24, 2022 3:11 PM > > +/** > > + * struct domain_ops - per-domain ops > > + * @attach_dev: attach an iommu domain to a device > > + * @detach_dev: detach an iommu domain from a device > > What is the criteria about whether an op should be iommu_ops or domain_ops > when it requires both domain and device pointers like above two (and future > PASID-based attach)? > > Other examples include: > @apply_resv_region For apply_resv_region the 'dev' argument is really selecting a device that is already attached to the domain, so it should be in the domain ops. > @is_attach_deferred Only two drivers implement this and neither use the domain argument. Remove the domain argument and keep it in the iommu_ops Jason