Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1469017rdb; Wed, 6 Dec 2023 22:51:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+0lcySKhc65X0RhBxCvhkkMmpa9dqxo5ZQiw6XfZcolX5ILwcrkNcX/zlqZUU7utb1s8Y X-Received: by 2002:a05:6a20:9410:b0:18f:aa4:9c23 with SMTP id hl16-20020a056a20941000b0018f0aa49c23mr1770337pzb.62.1701931890852; Wed, 06 Dec 2023 22:51:30 -0800 (PST) Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id p19-20020a056a000b5300b006cdd5331205si693677pfo.381.2023.12.06.22.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 22:51:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EvpgXgH9; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 8286F805F42A; Wed, 6 Dec 2023 22:51:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377672AbjLGGvM (ORCPT + 99 others); Thu, 7 Dec 2023 01:51:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjLGGvC (ORCPT ); Thu, 7 Dec 2023 01:51:02 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF2F198B; Wed, 6 Dec 2023 22:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701931842; x=1733467842; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=8j+BnTwvVq+Bibs41zIel91zbmrCT4gCcwpXjdTVpQU=; b=EvpgXgH9JB2sXAHkVv+56EBE5hC1bF7UG0wWvCpYzSoUb2Xv34eK5zYx mCNvA8gh0o3BbTJGfMm/PCYsWClN87/TcAJxL5wRBzl4HXSxXn+oG6FNP bB6IfJ9ObVZTWQk4cI157vAU+idvG4qgBl+QtvPsiIYs3fYoOscVCDJf1 N/fjbbT9rutzuI7hJAiHKj5c/wCf/8d30/putCKbVFLZrpgOfcTcuZQg2 cIIRoH4cJ0C7E9WUidqOX4xyKaVuaqGcQlgWDzgkqgl9m3sKzOAA5yMFP S4ZHDG40t8OzvzuO1UAJous37k+o5UpUyGRmqDYz6/MDkYBf1JYSA9hZH Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="1055025" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="1055025" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 22:50:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="800628748" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="800628748" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Dec 2023 22:50:39 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 6 Dec 2023 22:50:38 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 6 Dec 2023 22:50:38 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 6 Dec 2023 22:50:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PqDG8c0Drkz3qU6l7qIS0mDw7Vj4klBbMZKZ5d9VKJlI+qoY7wbpkJRxWZS50FToILUZOJ0HqeFDTFygSDrnCn6pX33LoTnB92QmCv957Mdha0rlrPRkdBcGQnzFx0pb98rsK2ZSssI09D6GhxMLu4JLkX5XBDdlVA4+QzQevSyR3Kxma0ri/dNnMPoYbHWpqtDWzsWZAuI3sIW6jAejfU37jnJI4JXYQDCPVsOWneEPb1vlbno4TQ+hiMxQH8TE8E2N6c9AFI7lvf2Zv9dUqjRWzw6gGyehMzIYlzvyXOx+J4n1mJIK9HdTlyQk/sazpGOYhR7KhHE+uo78PKPmzA== 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=eEdYgpoGbJmwR8qnXPa9aJkZqQ0LcGnwZWuorOblP1w=; b=EpOUBwY9bqZEmu5QYyGyfJXSao4qry3RldHNS8lXLWAYuQ7lpBk96YqDSdSPkeS1cEE8J/oh/+md/MEu1Dmskm4u5OFTsResSHN37V3aSsv6/7ZZPNoNXQ+d3iV+DaotgeYbuhzM8mcoXTb7xk4jOcw8pCYIeZYbjxNqsqHD+INedKgFLI9eajsx4ncGDlNsyNL9UJ7I+1ekcwtlPpdmc84cl9l+TPYsnKu+t3Te6tgJs/Ev4pO+393FaBVcnulZcyKsTWHKdHWbyv4WtI9FcOcPsq+kNLUY7Ew/oIJjlPbWaWww3mT3JlQWCyEZl5V525nbaUeoDEDPUZndDzigog== 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 DS0PR11MB7312.namprd11.prod.outlook.com (2603:10b6:8:11f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Thu, 7 Dec 2023 06:50:35 +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.7068.025; Thu, 7 Dec 2023 06:50:35 +0000 Message-ID: Date: Thu, 7 Dec 2023 14:53:04 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 1/6] iommu: Add cache_invalidate_user op Content-Language: en-US To: Jason Gunthorpe , Nicolin Chen CC: , , , , , , , , , , , , , , , , , , , , , , References: <20231117130717.19875-1-yi.l.liu@intel.com> <20231117130717.19875-2-yi.l.liu@intel.com> <20231206183209.GZ2692119@nvidia.com> <20231206185031.GB2692119@nvidia.com> From: Yi Liu In-Reply-To: <20231206185031.GB2692119@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SI2PR01CA0002.apcprd01.prod.exchangelabs.com (2603:1096:4:191::21) To DS0PR11MB7529.namprd11.prod.outlook.com (2603:10b6:8:141::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7529:EE_|DS0PR11MB7312:EE_ X-MS-Office365-Filtering-Correlation-Id: 2096279c-bc06-4d7c-53f3-08dbf6f0cefc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3cyZGejlbxpgxXgpvglOom/yy5yZa+hpzOiseYEwVn6vOriO2wSs7sQKIeojhJnMBcmZXWMsQty7Knry+bSnOTrJ5CAktKjV3YgrNgwFZJBKkAhsVi7WCTp6uIXX5EyD97mMDSxWzbvysQFI5oqK0/2ALqAYy5D3IKqJJEQdHMNPNkgMUXY2UBuHcKIc6piY2Vr4KUYnkmridBuyC+HZwet2lexXdU4b/QQn3aThI1R+pp3q0xYz58PjoD5c7AJvscY3BXqY4kzBdGP6vS+7H7N8FQD42CXEcq5ymBAVMJ0sJiz3iPumOQc5LJ3ekN5q1wOhVbICCe4QqMgjW/3UwBySvyKld7LJ5ugVzraDXa7Ag+OzHlV12/kIxQTTG8hUkeeGkl2HiY6NP1rPfFaR+u9AlEynUg26FR2s808eudRZ2ghYgjn/kIFMeOM+XaeuQj3VkDhPm6hK001bZHtcqObJlGQpTh3ol5H4zwHO6vLy2X6htuRYYC8fRF9299LPU/CfgsuxL49n/PrBfJTnnnXPog4aOht2EejZ+5qRUsEaUPuDUDvZC60cfCRywy904J2P0Mp8SkgDHOKOtn51UXemE5l4fom8RKAmSQOwUUU0g0edtXmVlPldkCYn5J8YsJ/J4S6EUyQK3yPEpfqPZg== 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)(376002)(366004)(396003)(136003)(346002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(31686004)(38100700002)(7416002)(2906002)(41300700001)(5660300002)(82960400001)(6512007)(53546011)(83380400001)(36756003)(6506007)(6666004)(6486002)(2616005)(26005)(66476007)(110136005)(478600001)(66556008)(8676002)(4326008)(66946007)(31696002)(316002)(86362001)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGVNUHZqbjBUWXA0Z1lEY2VEMVZSYVJRRURMU3VrVnBlMThLdkxQSUVFUUVp?= =?utf-8?B?OCtoNUVaZlJQUmRNblE0d0Q4Z2JIWkhtRmJzRlFxOGExUXJrZzN6VU1IRGpk?= =?utf-8?B?QVluUWxiTFRhcFAxMUNWZm9ybERXU01uQVR4S3pSK2NFY0JsOCtaOFlRbTcr?= =?utf-8?B?YWRySkhQNUpTT2hLcEk1dzdNclBXeHJmVlljVnIxaHgyRlRnUkc5TGtSak93?= =?utf-8?B?cG5kQWJtU1plOHdZNE8vZDY1MzZ1UXpLY0o0ZVJQVUF2ZGRCaEdueGdMTU4y?= =?utf-8?B?d0xqM1krYjkvaEZiUXNhR1dVdzBTbDlhTitkTUVXbisrRXc1L1JXSS9RUWdj?= =?utf-8?B?Z3Q4WEhWcmNBa1ZYa1lqcmZGM3VFOXdpUUtLYmNuVk5UaDc3YkZkT2NhWmJM?= =?utf-8?B?WVZnaTVwR3NRMjZuMitGejhIK1Z2WEtmd2JoUWNzcTJGc0dlOXRXcVBEZEtl?= =?utf-8?B?WEtta3hvVjk5VDRjN0NpaGgyWGg2em4rL0Ercm1DbDRZa3pIVG1qWWJSQUtB?= =?utf-8?B?V3dBd1dybEFzMk9pTmFmellJMlpzR0FEdnRPZXp0aEQycS90YkdaTHBCMklS?= =?utf-8?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Tdz?= =?utf-8?B?ajIrd3pkRXFTSWpkQTNkNEhyY3YzdHZMaXNRWFArRXlORkxkOUlyL0hJUFhB?= =?utf-8?B?cDA1WWQ5VWZvekV6eDRpMW1LbjRSd0pqaFpGSXBuQzNVbnplR2QzUC9WZGVa?= =?utf-8?B?elRtWExQYlliRFcwNVptWDdrQkRvcWZvS2RKME4zUnRIMEtuK0dGSlg0cUFU?= =?utf-8?B?MFFvdWxHa0RBd0s4MjNQb3FPdGtDSFQ3Z3BnVnNnUEtnNFpibDlNTlZDSklo?= =?utf-8?B?cmlPclBPdi9GRTU2RnZwV3ZiYlQrNUNmYXVoU0pkUkJEd0UweDYzaUx6TnNp?= =?utf-8?B?ak9KT01aeGVOdkxUQWdYT1EzY0JzY1ZJQmpodHY1MWU0dXRpekdQYUpvQ0Fp?= =?utf-8?B?d0lyL1IzYThTSk9ZWlV1Ry9EZFpVMkdQNGEvYk1sZHU0YTJ2NERwRjFkeG85?= =?utf-8?B?NXdFQVZFenc3dlI0TDlzVys4dDJrQlVQWnlIeHpzdmdycGNMNnlIbjl1S3Qz?= =?utf-8?B?QW1tSDlvNDhXR2plRXlQYStueXd2QmlvMW5RSldhNHdTanNiM1NxZUpQWFd2?= =?utf-8?B?VzFEVXVkZnNORDcwS3hZSWVtSk5Zcm5RNWliVVZEQjlxdjM2Z0JyWkVxbS9Q?= =?utf-8?Q?JKZqOSrODLFU2vewTfq8VXkW9?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2096279c-bc06-4d7c-53f3-08dbf6f0cefc X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7529.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2023 06:50:33.5616 (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: qOQgYYA8wpVuvwXYEPdxH8dqVC7CMAQaDIDgO4y+rUxUX5QAS4NekvMPOFbkjTAlY9fBk/4Fpt32c8d64WraEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7312 X-OriginatorOrg: intel.com 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 06 Dec 2023 22:51:28 -0800 (PST) On 2023/12/7 02:50, Jason Gunthorpe wrote: > On Wed, Dec 06, 2023 at 10:43:34AM -0800, Nicolin Chen wrote: >> On Wed, Dec 06, 2023 at 02:32:09PM -0400, Jason Gunthorpe wrote: >>> On Fri, Nov 17, 2023 at 05:07:12AM -0800, Yi Liu wrote: >> >>>> @@ -465,6 +492,9 @@ struct iommu_domain_ops { >>>> size_t size); >>>> void (*iotlb_sync)(struct iommu_domain *domain, >>>> struct iommu_iotlb_gather *iotlb_gather); >>>> + int (*cache_invalidate_user)(struct iommu_domain *domain, >>>> + struct iommu_user_data_array *array, >>>> + u32 *error_code); >>> >>> Regarding the other conversation I worry a u32 error_code is too small. >>> >>> Unfortunately there is no obvious place to put something better so if >>> we reach it we will have to add more error_code space via normal >>> extension. >>> >>> Maybe expand this to u64? That is 64 bits of error register data and >>> the consumer index. It should do for SMMUv3 at least? >> >> I think Yi is moving the error_code to the entry data structure, >> where we can even define a list of error_codes as a driver data >> needs. So, I assume this u32 pointer would be gone too. > > Oh, lets see that then.. yes, I'm going to move it. -- Regards, Yi Liu