Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp316762rdb; Thu, 16 Nov 2023 22:28:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IECl8VxE+07buI39PMzHQgxxaDv/4to9DHe3aWxufbEvJcvYSc18VnuT3oZh+J1WIBpoiDJ X-Received: by 2002:a17:90b:4b8b:b0:27d:58a8:fa7f with SMTP id lr11-20020a17090b4b8b00b0027d58a8fa7fmr16910346pjb.37.1700202506781; Thu, 16 Nov 2023 22:28:26 -0800 (PST) Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id oj12-20020a17090b4d8c00b0028014e41ff7si1364217pjb.48.2023.11.16.22.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 22:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lzdT5X3s; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1E35680401D5; Thu, 16 Nov 2023 22:28:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjKQG2R (ORCPT + 99 others); Fri, 17 Nov 2023 01:28:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKQG2Q (ORCPT ); Fri, 17 Nov 2023 01:28:16 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BB2D49; Thu, 16 Nov 2023 22:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700202493; x=1731738493; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=AGe/1d0mh0xdnnYVemmqURS7GoVo7s+rwwY99qi9qaM=; b=lzdT5X3styau/8cA8K1YQhL30xcTuu41g57bghsOKqGr0Y609S8yEVHr dbT1IvGi0cKF9nfkuX+gvNNhNRhbeODX+OG4jnw5Tg0Xenpzcv60jsbKz /54QK2bCWgoLmcwPZybYmuj+CCy0dpDtmcgLfGZXYADy83xsLDpDad89/ 12gMrBwyvLmx9CcZg7sSxpvkeTRyctAXUrPQWVnemnPsVUfHHwNmSnafm 5vyU0ttW1aLYmgYqVyvTMOwdsIE74fonpT6zZCfqfNamXff1qDQVmu5ot Xo1KNXvV0UYeLfdd+0fiE0/B+ddbj3VMcOl0Nk8cw7CjjBT1Zxf7J0v0B A==; X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="4327176" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="4327176" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2023 22:28:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10896"; a="856246814" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="856246814" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 16 Nov 2023 22:28:10 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 16 Nov 2023 22:28:10 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Thu, 16 Nov 2023 22:28:10 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Thu, 16 Nov 2023 22:28:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZ+i/unfv4VtcFquY7mH8HK77zVg9CLrVMlSuVu5/JXek8uED7tzNnvL3qFykgzoloe/RdCKO/texJH0Upokh5dL6AKJKeVx+6Wi7tqDpHxXTMAy3IjvAiPytlVmMLV4EM7tWU2LuM93VmwUyXWyv+YNpKmfkfF2QtLt5XvItkEmsweTHYsIpCKaj2tiEo7CIArmmMH7RR62NE3fauj3/P2Nx/IT7LxyHMiuzXFudsEF8zJikr1A2FAvW+mWZA1cBedbuD+cRLfzf0ST+trR3U0n1Jl4iPdtOh0nNIAwMaz0teRRK0F7DHjI4E6BTKPFLExYPyuidP8EFMZuQ4NvbA== 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=cMOzS6KxEkO6Uw4EE+ClVrhoCOj8qS3eUBafvKRbauc=; b=CLD81ZwRdlwkyKauEmVWHuI1wDomDYML+PKLwVY4KsKIGZ4CtIz1lEspZBQ/2WOawyq+reIyftS+/Tr0WzX22GIG9MTJEIhGLXX2BIm4NRMhK35mHV6triPheYB6tCnIIJvXhX9LP2qMtiLZBSo0PKGOY2DeiQ4NA+rVgZDkOft5iAJKZ33FguH/PNo/kKK2TG8vCowGHCMI+YQltOTMTNPdFLtVbTGG70K9bRKBkMPHUunoyNCPuESrZjnroLEVzAYy8CCSpl3POqqxJiKd5LBjwh7Il4CcaohydcH6o1fHj5Qcg+izeNIw+rcCX+pGzbnJx/B3jJZul75bc86niw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) by SN7PR11MB7137.namprd11.prod.outlook.com (2603:10b6:806:2a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.18; Fri, 17 Nov 2023 06:28:07 +0000 Received: from DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::e4ae:3948:1f55:547d]) by DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::e4ae:3948:1f55:547d%5]) with mapi id 15.20.7002.015; Fri, 17 Nov 2023 06:28:07 +0000 Message-ID: Date: Fri, 17 Nov 2023 14:30:36 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 7/7] vfio: Add vfio_register_pasid_iommu_dev() Content-Language: en-US To: "Cao, Yahui" , , , , , , CC: , , , , , , , , , , , , , , , , References: <20231009085123.463179-1-yi.l.liu@intel.com> <20231009085123.463179-8-yi.l.liu@intel.com> <99115148-d0e3-4920-aed6-669ae45aa2fe@intel.com> From: Yi Liu In-Reply-To: <99115148-d0e3-4920-aed6-669ae45aa2fe@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0113.apcprd02.prod.outlook.com (2603:1096:4:92::29) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|SN7PR11MB7137:EE_ X-MS-Office365-Filtering-Correlation-Id: 11372f20-e679-4914-4cf7-08dbe7365c69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HOGzlwVgrd5R3VRlaUGaQEauh5g6QGFXaMe/5YbuJuWJP8d3EzR6u540f3w15+F8DCg44K/LwrldFM5Xw1Zj4Z0CqFPPUsSAPDxqVOerBf4Qk1xUhG27znjYc8M9kxCSegckNA8+gZJSk4btAVbvVsm3XWE7NQ0CI479lBUbT9N8YBg7DRRUfPARENU1y/tU2b8WGh/zZUMHuydXyM2mLaxAz4nz1ohGW0Mzr2p3fDXeHLtsREkS4IUt/Ec1sRcAkup4P7J2+n3dvnsO9wsDKcyNLotqyZ87th3iSD+zWqbV//VzHH5nkw19cHfkopb/WKBCAXzH6mUsOzGTLm5CVtCN3ygQMS4Fu6ukCbxDMKwnRGdeimiIrEoq+hvnyEHxv2FWeszkB03La1Wa4nd6i+axHg4Zbw0Nhd6WwFl9cR6WcBxCvUZ1714X+BtArawIxgDgQo4p04p9pqPAY1VkI29OGmTpVQc63F5akK4RNWOQjgX4CboyuC2chAIqODTBA+E6vukS6QgNJvh6q7B6NBGTr6MkN4zEGlI+mCPKTB/2c+jY7OcUCWG6ZrGvaQD4yptApseG+D0ojre5cmaciHmEzlynIoA3MlTCPMd6pY6z3chI2qtSbF2b7yRIomFOnJWprobWf2afREIp/9rCHQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7529.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(6486002)(2906002)(478600001)(53546011)(6512007)(6506007)(31696002)(2616005)(6666004)(86362001)(5660300002)(7416002)(316002)(66556008)(66476007)(66946007)(4326008)(8676002)(38100700002)(8936002)(41300700001)(26005)(82960400001)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UncvUjZURkkyaHdNa0xKOStOTUJ2L0NKUnRzNkwxbDl0a3psaW9YM1BZYkRn?= =?utf-8?B?VCs2RUJhZHBaWmpmUjZ4azBUMkx6YWFMNktBclo2VmQ5RUVnYjlIOEF3TGha?= =?utf-8?B?ZWUyRkovZkk5c3ZqZm5CbEVaYU1HRDFmQlFsM2g0Z1RXTzZOVUpocEc5cThT?= =?utf-8?B?eDI5SEdPRlZ2aFVJNlhCMFUwS2hwSjEyNXpIZlBTSjY5dldBWEVUdEdTaWMz?= =?utf-8?B?ekFsTlF6elBlM2UvZGVQTThBclpZdFArWHVmczUyQjJ2blliY3hrdU5OWjRV?= =?utf-8?B?M3ZWZ2hwUjhCN01BVjAyanRDQmpISFVnOGRXYnRWU1RIV1o3QUlSNVh2NGd6?= =?utf-8?B?cDgveFZ6K2d3RENoaWw2VUlObjdrQjhlYUdXTFhWbDRIbURmNm9hNHVjY2dX?= =?utf-8?B?SDgvZXZwVWVYOWE5b3ZFSHUrQUxKT2hZNngvcXJDQUVsNzNnQTkrTG55b29r?= =?utf-8?B?bVdWeVJkeGU1QkdHYjd1TDNpdGJIYkpmeXRKSnZQSUttNHREcHlhS243MWxO?= =?utf-8?B?dVM4Q1J5S1U0UWw4SmZPa0dMZXYzSW5qS29kVEd5WHliOENicFZQK3R0eGg4?= =?utf-8?B?eHdaamhNZkkrMkFVMVpWTVRjTGtrNTg1blRPc3Y1YUhJQmZPK3J6S21C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2x3RnFuWHFFV0plL2lla2c3?= =?utf-8?B?QlNiM1I4Zlc3Tk5NQktkQmxhRkVHeGlpK252R0k1LzBMUGY4WDh4Yi9JTkZS?= =?utf-8?B?d2x3YnhPcWMrbXdRSjNTWStOM1ArS05wOEJNZzlDTk9zcnBoK3BPc1NkYjJS?= =?utf-8?B?dm55MXJaN1dHMU1iYVpydWVDMDVjbHJUNXVEREpBdjdXNHZDMUI5c0tNU1ZG?= =?utf-8?B?TzFhbVdyeTdJVGovKzRkdlQ0OUVrWFJsUEsxODlQdVc3ZEVHOFNaOUJ6a2t3?= =?utf-8?B?KzQ1RkVUTWZ6NDl3dWVaZm5FelBJbVFBcDYvYzBnUUJmL29YckI1Mk1CbUxl?= =?utf-8?B?ME1aSjB2dEh3R1B0b2dHWDh0VEdnN0txanRvMUNMM290Rng4Q0hYelJ4Y25w?= =?utf-8?B?cDJMcVpWUHVFb2hselNvQjIrVWg1S0N2YjhIK2cwVmliWndKSmZ6RVFwTWRm?= =?utf-8?B?dFEyUEdiTDBnL2RXdG1mT2l6T3d6K29sVWFPMlB6dXlIY0grM1NLSS9nSG1S?= =?utf-8?B?dXM5dldPNXE0Z09saUlieFpZMHJHUk5hSTd1SmoxMWFaMWI0ckc1cWs2cVVT?= =?utf-8?Q?09wyVunH48p7P9MblFdtQMoWv?= X-MS-Exchange-CrossTenant-Network-Message-Id: 11372f20-e679-4914-4cf7-08dbe7365c69 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 06:28:07.3463 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jsny34yyW/1x+BKnvMpG5jGxnHz38lB5NitbC/DNKDAMXXG2QiaT3vnPSCN/CP71PFfU4wi8H0fuHk5/ozHPww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7137 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-1.0 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,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 22:28:24 -0800 (PST) On 2023/11/16 13:12, Cao, Yahui wrote: > > On 10/9/2023 4:51 PM, Yi Liu wrote: >> From: Kevin Tian >> >> This adds vfio_register_pasid_iommu_dev() for device driver to register >> virtual devices which are isolated per PASID in physical IOMMU. The major >> usage is for the SIOV devices which allows device driver to tag the DMAs >> out of virtual devices within it with different PASIDs. >> >> For a given vfio device, VFIO core creates both group user interface and >> device user interface (device cdev) if configured. However, for the virtual >> devices backed by PASID of the device, VFIO core shall only create device >> user interface as there is no plan to support such devices in the legacy >> vfio_iommu drivers which is a must if creating group user interface for >> such virtual devices. This introduces a VFIO_PASID_IOMMU group type for >> the device driver to register PASID virtual devices, and provides a wrapper >> API for it. In particular no iommu group (neither fake group or real group) >> exists per PASID, hence no group interface for this type. >> >> Signed-off-by: Kevin Tian >> Signed-off-by: Yi Liu >> --- >>   drivers/vfio/group.c     | 18 ++++++++++++++++++ >>   drivers/vfio/vfio.h      |  8 ++++++++ >>   drivers/vfio/vfio_main.c | 10 ++++++++++ >>   include/linux/vfio.h     |  1 + >>   4 files changed, 37 insertions(+) >> >> ... >> ... >> +/* >> + * Register a virtual device with IOMMU pasid protection. The user of >> + * this device can trigger DMA as long as all of its outgoing DMAs are >> + * always tagged with a pasid. >> + */ >> +int vfio_register_pasid_iommu_dev(struct vfio_device *device) >> +{ >> +    return __vfio_register_dev(device, VFIO_PASID_IOMMU); >> +} >> + > > > Missing symbol export here. > fixed. -- Regards, Yi Liu