Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1187691rdb; Wed, 6 Dec 2023 10:53:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7ecQIxHkhXnL39zS/dqwFaPUOBmii/loOcomvq6kaUsepVHdFLYHtmC+X4HpdKT/XPlI2 X-Received: by 2002:a05:6a00:9387:b0:6ce:53f6:1eee with SMTP id ka7-20020a056a00938700b006ce53f61eeemr1237136pfb.31.1701888782944; Wed, 06 Dec 2023 10:53:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701888782; cv=pass; d=google.com; s=arc-20160816; b=TUyUf5kE0p5V6XJMHfhU/Xo3CyJoXMjWsk9wAFIhBGg08IKO/tssp+rGIGG9hfR0Wc 0m6VSvUNb5nfZQFL+vtc5hjEVXVHoT2t4/EfDY75QOEDff7G0A4ogjy70y6MMZWJ7yx4 RSfptSjfGad8w8pA/JILfmAaSIVG5vktUcF657GtjoRNQfG5yx90OZQwAKEoex/s1NC7 AKEHLmCWGPOem2QgkHjebFv9YkOglQYYI6eXeEIF+43KXd8H9lI+UZFyL12SyoEAItNk d6Gghq9mF43+c9ACO1zYK7kZsYO+Bly6ut3cicu0bCKqub59R++kV4YRP/d5hKqRcygi im/w== 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=SatkdO+hNE2tu2QrTSOMjkTks5OvAKaScLVkTEWvIKE=; fh=LCltHkSG/D6TKbQdvqQT6gw/jVdsNgSuTNKS37sfaC4=; b=tYnmSMA/lNdGo0nZWmKILZn9V0BCmdJ/gz2JLAk/WlueKWh+PdCkHKlOx+us3GMV8/ 0/Bycg4LBcYwGGSjUGu6qN0vOYq+NbXgUARqT/xoXSYEAKZC5aGpGnfZGSXfF6m6ZO7l 0MdxOGIjROfUp1r1Z2/4ex2fDpFkpvAc77Lc0huE3/H15ZX5h8zhv0JzyhZz1mHNg51C loevoiCx+aor/3OahZNPWf3x1s6clXlLXhSfCNDS/rOBSMoP7RBIhn86iXJYELGY6CXe meoIJblRsX7JHzsC0WOLTA9kkmoEONkNIsYJWHG1U9fqnYXY8b2IheWBoaAMx47vKACr MZAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=QXlC+IZ2; 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.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y28-20020a056a001c9c00b0068a3cb58334si341388pfw.320.2023.12.06.10.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 10:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=QXlC+IZ2; 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.31 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 morse.vger.email (Postfix) with ESMTP id 200CC8297C78; Wed, 6 Dec 2023 10:53:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379248AbjLFSuw (ORCPT + 99 others); Wed, 6 Dec 2023 13:50:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442820AbjLFSuq (ORCPT ); Wed, 6 Dec 2023 13:50:46 -0500 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 52B8610C6; Wed, 6 Dec 2023 10:50:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UqxS5DbEH8sTIZ4p5Ma2s9Nk/3CJlrAfYRd/5CRuOZm2p8wFBViAoOKr3yBzZl3U8PV6BhKS1kxaWBC/fjDpi3zaoNlz6KYU92Hx5zucqVEjhsqw4SiYj3wtPZGRFmlsP94VU3ILgO1NdNgaW40agEnH2bw2CdYuuZ+9yPjR9JfV2Ph1AWak5viv38qQk+OiuGlXo3Vy+/EKEmQ3v7xhWzhbt04ethFTX/Ey6p61rUWX7kOJI8jGf848FHIXyqMQAhUS0EG90q/unZPv7m5li33eFpcgCESOjOjeuco0qvr566HVgUyPkARPxYuOTDwSxFRrND6gXtRt4w6SC+vxuQ== 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=SatkdO+hNE2tu2QrTSOMjkTks5OvAKaScLVkTEWvIKE=; b=QV29APwhdfKzxspoAl+/P9bjBe07QjCY22NM8yq3AJePbEG/rXyROP4612Y/X4YpqyfZpypQWFNep+JTas6+U1OMWzNFxUJILZzVRj35ctS9vHAHet1/VdiuVz3Hao+IgR1B5GgbJTC+7UNV4VGZYAT9+C7vlJ7bGBV6xA9m4N9WDRo/38mv+viWVsSZRohdhEGZiD2NIwXECHCuDuuQKP3+HPmXrWtFL2BzwVvRbC1Z2saNa7cAmc2YA0/Nu1QSUgqy9HeYu+cfR+4wYWROwufghHrNgUlH3Vttcs8fuhWWcBpe9OUY9v2GccjXtvhqMBL+nMc1jMR+4NEF1XKNwA== 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=SatkdO+hNE2tu2QrTSOMjkTks5OvAKaScLVkTEWvIKE=; b=QXlC+IZ2Wvn5B3bDa5AOhbMDbZjvyL/gSvJdu9OItYTPtGCuffo8qFSuWtiSOvEzEUcNLJkhPrVRsCn5tZGPjLQ+Ww/C/l9suHVOrbtNxjnJSPuV1r22P3+AoiAUMucoWtJEFXi8wgwc6YxHO7lz3pNdNmhpuakjnep+Fp/lBXZ9EaLZ1TIXAjuiPRT5/2XM80Ui6fvErsyVGj5acOuIzHTAqZSz1hZDGv6C9AymWwLOKjLuO2leepuasLzZ7mFQMox6ns8enbOQ+ZXQeeMXF4e4ipjft9vyhxIFXoL+7F65/E7Y3EU+3PoxKHf0AZ+zSqpfUaCejtWyPfuPZsawaw== 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 PH7PR12MB9152.namprd12.prod.outlook.com (2603:10b6:510:2ec::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Wed, 6 Dec 2023 18:50:33 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::60d4:c1e3:e1aa:8f93%4]) with mapi id 15.20.7046.034; Wed, 6 Dec 2023 18:50:32 +0000 Date: Wed, 6 Dec 2023 14:50:31 -0400 From: Jason Gunthorpe To: Nicolin Chen Cc: Yi Liu , joro@8bytes.org, alex.williamson@redhat.com, kevin.tian@intel.com, robin.murphy@arm.com, baolu.lu@linux.intel.com, cohuck@redhat.com, eric.auger@redhat.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, zhenzhong.duan@intel.com, joao.m.martins@oracle.com, xin.zeng@intel.com, yan.y.zhao@intel.com Subject: Re: [PATCH v6 1/6] iommu: Add cache_invalidate_user op Message-ID: <20231206185031.GB2692119@nvidia.com> References: <20231117130717.19875-1-yi.l.liu@intel.com> <20231117130717.19875-2-yi.l.liu@intel.com> <20231206183209.GZ2692119@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR16CA0065.namprd16.prod.outlook.com (2603:10b6:208:234::34) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH7PR12MB9152:EE_ X-MS-Office365-Filtering-Correlation-Id: d80301f4-1b72-4497-5df1-08dbf68c39b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XDgCs/KbTMuf4bWdjH3COZu/Jv1IW2MynqDWAF3KSVPC/2wtuSxl6MDlmfDBMmngTgGxLN99/eMCQM41/6ZYBZWoI9PXyfFuQb3i0whxCfrICtXo+re5a1OHJeAexdz1BfocdTSJpSwn4likAnNgCrjas4D25IHs2hdFqyxnPhR3uGrLDqrprnv0cAyfTJB4qtuGkK0tLKKS2XMjQ+j/IjKU7xwZfeMDijibcK4RD664GwXNLV+gFOLgQsjB/K4uQHlcg2gnnpZJeuIKNhAqCX78Z6mX9oJzrO/wnQoVBN7Ip1BAxGb8SDRBz5HjtKhTAtvr7E1w3psy0V6n6FKZ5Y5aqOH4PeXfZ0fC6ojlN0WVkIq641mMl+exDt0gXFnF6G/3fJy9yJcN0k7yKgAEoIWnWGw1xEtEOLgfSMYm0Ovj8B7Aev0EFET6BgTQbmu9tm5eAtdNotyK0sGPPs+rptXi5IKwrxPIlhx8aa9/K5yOrEmvGjX0Srd+mli3yNaX0f1JN0ZdqR7bxzFCQNpYOiCF23lsAmeOpjKUJRZ8yGY2vvYB9Drk5lTnqiKln8ba 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)(366004)(39860400002)(376002)(136003)(396003)(346002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(6512007)(6506007)(8936002)(2616005)(6486002)(26005)(1076003)(66556008)(4326008)(66476007)(8676002)(6862004)(66946007)(37006003)(6636002)(316002)(83380400001)(38100700002)(7416002)(33656002)(478600001)(36756003)(2906002)(5660300002)(41300700001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?edxxcNqAi3vwqB5kKA2ONn01Huk9XHgjcV+QyuzFW21okKB8PE9QEpWZYWlS?= =?us-ascii?Q?IcNGuPqNtpCQPiFjMIc2KhRPH4qKGb8GKxoAmr60P0Jcp79/MAz4CbogwZez?= =?us-ascii?Q?diEQRXQsgAraMZydYvw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-ascii?Q?aTV+8EIeZoQeyA0HezWQ3aS/WuNlY78wNcXkjCvejwbKwpwt283DxE2KyZfh?= =?us-ascii?Q?2HqlGIeIliHvgfiL/C60lOhR0hyCaByznO5SOKRozj3UtRGGHnpyGl44JSQ5?= =?us-ascii?Q?MvRggO5G3fmB5wS9YlxcSnRBP1vTTG8nuLUIrexgTzMrF20pFDNbrX2XBrjt?= =?us-ascii?Q?97+o4KdCuXbsgWBJy01A8enEx0iQjbVKt8e0IzrlC6Kk/UuOVU9lh13uXtyk?= =?us-ascii?Q?H44Z87yDZdpjjIRFnl4JJyCw4s2cfgH2Bk2uE+QhiXUjfbuk3J70nWPm+n1J?= =?us-ascii?Q?jhqPs9ymf9wiCf4Y3VZOJ86wZ/3rAoVNN+zsdPEUUKs9qG9STOO4IsQvBq9f?= =?us-ascii?Q?m5DfuUxx1obriqT+WbEEwM7afjLFEewZ54JUxvd8gpEPYCFQNDS1nU6i0bjT?= =?us-ascii?Q?1k/FfE1Qgj7V1bahRviOKV6h4/2ZrjGhSnRRBaTOTaz56JD7Hywc4Pb6zoWj?= =?us-ascii?Q?kzwWcb5cdS6UKGJxYWZio5ZbEDHSoW+H8ZwZyuxbwD7FocHQoKdAV1Vl/4Yp?= =?us-ascii?Q?vVwZHPNy8p2YopwNCRBOAz4ra9l4NgVFqCUs6aus?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d80301f4-1b72-4497-5df1-08dbf68c39b0 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 18:50:32.8174 (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: UGa0nsXNt3+vEf/j0jgUo0t92/J4UDPsDlmgzeUozc/DGyQA+2Y3+Brwq55GZHYW X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9152 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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 10:53:00 -0800 (PST) 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.. Jason