Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2267438rdb; Mon, 9 Oct 2023 20:33:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/7kkfZMpQZNGLOW15Nm0OCPwDhc0+eESuu1ZDuyEgQO/RGHOwSliVKtWhjorJ1LKc1qlY X-Received: by 2002:a05:6808:f13:b0:3a1:db18:401e with SMTP id m19-20020a0568080f1300b003a1db18401emr22854068oiw.1.1696908782931; Mon, 09 Oct 2023 20:33:02 -0700 (PDT) Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b75-20020a63344e000000b005578c6a7672si11341533pga.90.2023.10.09.20.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RjsHEf5w; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 4518A8057E16; Mon, 9 Oct 2023 20:33:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442077AbjJJDcl (ORCPT + 99 others); Mon, 9 Oct 2023 23:32:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442064AbjJJDci (ORCPT ); Mon, 9 Oct 2023 23:32:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5908AF; Mon, 9 Oct 2023 20:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696908757; x=1728444757; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=SQvhEoJCLLDkIPDzGdH7qnCsT860DApMSOR2FSkhQtM=; b=RjsHEf5wZrdvnaXpEqCYkUyEG4ixDaCmGn/6GOAvH3hG6s4LO10Hb1Nj YLzosMQTHmyaTZDoOqEarQrl5K/GzoFHTA9HdvbLnj15LAcmeghg9Q88i E3bP31bwjWlVTEp47KPwWyjtbqmPhWUOwx1hwRtlqMNfJl+zBSkckJ+5B nGOC8ZRSrCX5xFi731+sHlGsHG87cI1QiZRhZdCGzcr3ZRYpS4kVcX/A1 TcF1/BURKqDQmih7aZBySiJfopifUDBdnme9D9qawDK4xQpVIZaYMp6A3 3EfrzdW5dEsi0RDLlCX3gffGvZyfbQtObW0K2eyVvnIb3Wc17AYrCpjb+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="5858540" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="5858540" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 20:31:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="1084596445" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="1084596445" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 09 Oct 2023 20:31:19 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 9 Oct 2023 20:31:19 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.32 via Frontend Transport; Mon, 9 Oct 2023 20:31:19 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Mon, 9 Oct 2023 20:31:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NY+j+8WVnwssjqI9BowGbO7brHWDsDyj12lKB47d8W7dC4y/iIMibEUcH51kZNT2Diyu950Xz9AYMzPvOPlX71cj6GAToMQB+1J59IAHwmdT42h+kWgebaAX48jfDCkJ4QzGzUnntqQT/qSM9FpaOPS4HxrMZ7+hyUx0y73zM1KkVW7feLZ8DdM05o86ubaOK8mzg38s6oPFSjP1IdRFdUHvGJjV1jOuc4v2CNj4Mrarmu3iAwMzOVsGo4UPGUb2BPLWVVTGZ7hrcRfaN5lO6FmgIjjKgPujuYU8y0DqnYcm8ds+7TXu4qnsmodkt3AnM1xOrgeSeclSQ0Y8PZgsvQ== 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=6Iq5kKOz4fDWLu1Hqg9iLyj3mvBTHPxw2wpxNbOfwOs=; b=E/S0hJG+pTehJbRH1u91NtTe5uPSCgyPmVgqqUxCynWn+ymW/V4V5WPgmWa2hsyYREbMJYEUys36nHwffcai9AjV63Dk+ZXOmXIYsN8YJWO2aw8E9CJk62hNgn1ou3Mc/7tKNYgUKPQpjnRSqEQDOuQdYjiuJH0M/cr5D86cmJag2jH2sF3oDNlITCd/F9eOWLaxLqNeaSHkPU7c7fZvxU8NZJDq9x79vuDUrPBFmuGYPamPrAK/bvZgfF4G3pBunAkYzVP7oEgI/bgozuVIcC/Wdrnczl/s+51jyU1qrvXAUeNxai0vCczelSmDdQVoDZFRFZZH6Lqp9Jtohhi+Ow== 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 CY5PR11MB6236.namprd11.prod.outlook.com (2603:10b6:930:23::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Tue, 10 Oct 2023 03:31:10 +0000 Received: from DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::f8f4:bed2:b2f8:cb6b]) by DS0PR11MB7529.namprd11.prod.outlook.com ([fe80::f8f4:bed2:b2f8:cb6b%3]) with mapi id 15.20.6863.032; Tue, 10 Oct 2023 03:31:10 +0000 Message-ID: <522d8a3a-3db5-bc20-198a-c4b142e982d9@intel.com> Date: Tue, 10 Oct 2023 11:33:30 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Subject: Re: [RFC 8/8] iommu/vt-d: Add set_dev_pasid callback for nested domain Content-Language: en-US To: "Tian, Kevin" , Baolu Lu , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jgg@nvidia.com" , "robin.murphy@arm.com" CC: "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" References: <20230926092651.17041-1-yi.l.liu@intel.com> <20230926092651.17041-9-yi.l.liu@intel.com> <04af40a3-1675-4b1c-27de-39d261dcb1cf@linux.intel.com> From: Yi Liu In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: KL1PR01CA0117.apcprd01.prod.exchangelabs.com (2603:1096:820:3::33) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|CY5PR11MB6236:EE_ X-MS-Office365-Filtering-Correlation-Id: c7ffadf6-be7a-4132-3ebd-08dbc9415890 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lgcw4t9L3fPsOu/NcFPYG3e+gM1FOlUcW33iqK1cIKlru+iH3pngPqaT0+KB7i1Tmn86JQFnZJ1AiiaM6o0y4EL79XRPy7sYGJr7i4zAhNxJPxrLvHgcd+QXPj8pcdXL7d2yprU+uHCZysqr+UuDnAZMgFvLUoIHtE6CmoalH690kAQ5iEHecn+MT6nG9mzakolRGCnBeqT4vhxD7wF96qqwwKm39ScldJATDLRSXerB2MoJnV0S34dQWuwtvtMFsOLxwv+x6JIZnU4U0D9XZg1yQ0LdwZ+XHtyzpCM49VcrC4swwTZgmgdpw+gHIoNgsiowPQ+OnAiAsUpwtEc3YWCO/kguYW5cVPVqIQB8GZ1SwGfOZYA2jw482zTf1YK1p88BO17lI/lttKjGj6vyqT11e/Vl1wMlFEkTYMB4Jt+NRb4HuQss7WdvaGC63H/QubyRsEuJLFe4RuUkYv3w2GEbC3gO9f/jrAT0IGTRYK0/xjhK+TUiZtBPmr8LSxeUJI/XsYJaQiMulfm9hqPkHdkJci1/UNInEBnlz2BWg4DtZ3mJ6x6IOSM4DEgdtSKMZVvL2H+eEYvjFQolNs/wCf9zfvLKFH7sTskGCt6YV8L25Iv0R+Du7r1PffXCSYNw7dZJVPUlLUX0iGidm2YueQ== 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)(346002)(366004)(396003)(376002)(39860400002)(136003)(230922051799003)(64100799003)(186009)(1800799009)(451199024)(26005)(2616005)(53546011)(6666004)(8676002)(6512007)(83380400001)(7416002)(2906002)(6506007)(478600001)(4326008)(54906003)(110136005)(66946007)(66556008)(66476007)(6486002)(5660300002)(8936002)(316002)(41300700001)(38100700002)(82960400001)(31696002)(86362001)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T1B3WHM0QStidTl5bE1Qa2FmeUFZd0RjQUtJK0o4eGNTajQwSEYrZUJCcXZU?= =?utf-8?B?cm9pZTF6ZkFKVjFScVo3Zm9OenM4blRHZjNYQm9IM2xVL0NVY2V5UWt3MWl2?= =?utf-8?B?cDZVekRaejRkemFIdS9xUTRjdHJYeVlROEo2VlFmMmFla0pSTFRybUs3YWNO?= =?utf-8?B?S0JjVlRkNmt2a05hc09OQkNGdlVPcmx5bzI4VkJudXF3RmdsMkpHUkFJWFRH?= =?utf-8?B?e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hBbW1uTFYrcVRZb3BQU0xNV1pqUkJH?= =?utf-8?B?UTNkVFIzWFFEdkxQbG1BLysxWHJCTkRwQ2pwNHFRb3dxclNmT0xXU2VPQk5t?= =?utf-8?Q?1dMrqRqfXia2NtMTLtIedRIPa?= X-MS-Exchange-CrossTenant-Network-Message-Id: c7ffadf6-be7a-4132-3ebd-08dbc9415890 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2023 03:31:10.2269 (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: mmI5lIsCFt0gp0eKfhpUEXEpL7lQrE/zxIhR6ZMLkpUUbaEjAZ3UYjqdwne05lw/QciYEGto3u8cIy3/oewJhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6236 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:33:00 -0700 (PDT) On 2023/9/27 16:09, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Wednesday, September 27, 2023 3:58 PM >> >> On 2023/9/27 15:52, Tian, Kevin wrote: >>>> From: Liu, Yi L >>>> Sent: Tuesday, September 26, 2023 5:27 PM >>>> >>>> From: Lu Baolu >>>> >>>> This allows the upper layers to set a nested type domain to a PASID of a >>>> device if the PASID feature is supported by the IOMMU hardware. >>>> >>>> Signed-off-by: Lu Baolu >>>> Signed-off-by: Yi Liu >>>> --- >>>> drivers/iommu/intel/nested.c | 47 >>>> ++++++++++++++++++++++++++++++++++++ >>>> 1 file changed, 47 insertions(+) >>> pasid can be attached to either user hwpt or kernel hwpt. >>> >>> We should also introduce a set_dev_pasid callback for non-nest domain >> ops. >> >> We already have the code in Linus' tree. The idxd driver uses it for >> kernel DMA with pasid. >> > > ah, I forgot. ???? probably can mention it in the commit message. sure. -- Regards, Yi Liu