Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1483405imi; Sat, 23 Jul 2022 07:06:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBDM2DM4RChm++IR9pkGWHyopXQz/jr6ZkP+BKKFi+HcvTL8Zycc9bnxLOY63X42PX/9dy X-Received: by 2002:a05:6402:4014:b0:43b:cd24:fff3 with SMTP id d20-20020a056402401400b0043bcd24fff3mr4598867eda.351.1658585175434; Sat, 23 Jul 2022 07:06:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658585175; cv=pass; d=google.com; s=arc-20160816; b=LrrhA14o3+ovcOxux5kPwaY5HUvEk1gXrOwKPubDQfVwQV432C5VJ4tg5YgsSSu/YY b7H/jGtiIUhr36Q2mKmAV3J9yvqSRCsRBl6FdIPponnbG4E99O68HmaP5FSTb6fQm0rY SLtOt1MPQhlJlXp4bsqQ7R430L4IVNGwWLG72eIu3WsYD9IrDfK5t13H3nwKyrdH7HP/ 1SYe4MoFGKBg7Ye354uDP/V1f0S0nylaDPScMfYcvrS0hHdYoW4addCAJYM+vieykD7d iOna2hvtVxFFIanlOH6cfdpQNClEKBULMRjK8axHl4wcfydfdIHMvV6booXKxkzQa8fq Nzqw== 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=YgRhrGB0rwjeKa9M3fd7biKpp8/l1C12d3Rquf/9pHU=; b=I2zuvGVLIQm5FOXkCfB9OQ+996vk/eLlQMAkK3ICMSJTW4AJyaLW/dEn9cfLCFLBpV MHeuCqVO+2H0U09IChqCst2g+tsZzxlzf8Yqaic+aWsoVlcS1uaBDBRJGY+z3V4jxE9S M/d2l86lDz/1Ufj9ZiEOfyCn3Izqli6aTpPK4Rck00a876HSqL8J8m2hVXLIWUFSNbmo K+XX1cwloOePH9XDLkhi11IV2122kAm18zGBOv/6UFgUYnP1w8rqkK0MqWXmJLtrL8uL 63tJnmPg6/EzE3h1Ds54RWRkeh/eiePuPj11DK6A6yVdfnhF1lrVgKx3tNbfUhUAB0Mr RE5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=ggV6IRmI; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a05640242d500b0043a4cff7e3csi3327603edc.423.2022.07.23.07.05.48; Sat, 23 Jul 2022 07:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=ggV6IRmI; 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 2620:137:e000::1:20 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 S237150AbiGWOCU (ORCPT + 99 others); Sat, 23 Jul 2022 10:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237074AbiGWOCT (ORCPT ); Sat, 23 Jul 2022 10:02:19 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2042.outbound.protection.outlook.com [40.107.102.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4427FDF66 for ; Sat, 23 Jul 2022 07:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Je2nmW2MMgIQ3gTn8BY9KvAfzBo9Mc8aMB6EzukTIe4fDMxfkS3LnkqC1qFrpG0nkRzvh8CDu9gvqgyh97OFmNqb3VvT60FaY5IVuVbTLAvKx5j9su24OKUpV7BbdqmLdWkscP8kpTlr40kfpifnPz/0nNnstEV5EIAaVurBn8BcWAEjCpv4/ZXoc3WetS4xlocnDPr6bSjieWjGtg9f6xBjQxGfWVCYC/Ae/EOTFZxWsboqXxUooRLobpxe7xs2QPbPopnp1SztAWTHpXosIagelMdYUoToAIJDBr+hGOFKer39MoIowSuoA1Ovk9i3s2bPjZRky+nLLbfYmYKHVw== 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=YgRhrGB0rwjeKa9M3fd7biKpp8/l1C12d3Rquf/9pHU=; b=T5OJBXzlfcC+B/FbyYSuFqpIP3lhGtBgHVLjr1/QobE1uNwqF1BZMDIvP3q3f364sInL0QcCUVQ0bRT0bD5URi/ZVBVjG8HYI26hCZeGGb6+EB60GS/8y66W4PWA/jNQc3Q0SUg8zgrUCNnPFP/RI/YxGy6DZn+M9kmyrzhQveYmyFFd2qUfft9BuVc7jmYI1suz+gzbvrUWDEfMurQMEIPkf9rQ4eM1Si8VdO+q0PwTDEoWWaV0jF3TIqqUCmYN/MZeFdTQQzAn9YM3bOS4yVZnTfrrSsHsR8llt5NNgeyMeU/TDCEk1mhX5+AeSjq/lllsyJrTEwRA5LnwtIu2RQ== 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=YgRhrGB0rwjeKa9M3fd7biKpp8/l1C12d3Rquf/9pHU=; b=ggV6IRmICTWZK4vCYiY1JKIMX10tr/BzaUW0AI8AUBBUcXQlwinWpIKaq0b/Ti/YQByL1hEsUbnBMBW5FhlqfUza7auXpu1N6Z26Rk/hM545dOkEIlsdK19JDrUFeRFF0+Bb4t2aRQ953lk6ZXV7BI4AYJjUuRNhqFyiBLcpsDXs+qDOMldS150DWF5GBoJti2TKfjCtCA+FA1PNPM+kVyjxBQlKeuPdW0Bx2NqDKWKnSEXzb4hCRK7vg1NTW+q+qzqA6c0PS+2R9m8r9jMQDxqAtJTuTgEJDHBJB/DZBDO6H8nfTzV3oPPHJV/Ud5k2Bd5kXibSvIpGJGn7eGmQSA== 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 DM6PR12MB2761.namprd12.prod.outlook.com (2603:10b6:5:41::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.22; Sat, 23 Jul 2022 14:02:15 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::ac35:7c4b:3282:abfb]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::ac35:7c4b:3282:abfb%3]) with mapi id 15.20.5458.021; Sat, 23 Jul 2022 14:02:15 +0000 Date: Sat, 23 Jul 2022 11:02:12 -0300 From: Jason Gunthorpe To: Lu Baolu Cc: Joerg Roedel , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , Zhangfei Gao , Zhu Tony , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10 02/12] iommu: Add max_pasids field in struct dev_iommu Message-ID: <20220723140212.GC79279@nvidia.com> References: <20220705050710.2887204-1-baolu.lu@linux.intel.com> <20220705050710.2887204-3-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220705050710.2887204-3-baolu.lu@linux.intel.com> X-ClientProxiedBy: MW4PR03CA0176.namprd03.prod.outlook.com (2603:10b6:303:8d::31) 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: 38754652-0de0-43b1-65fb-08da6cb3f2d1 X-MS-TrafficTypeDiagnostic: DM6PR12MB2761:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oXgH9fIiszw+RicI7v0quIygNkJB+kSV2e0jv7M3zBAxL0SxEMdbK+JRVcMbZZ4FcIbY1hrSHOIxpEMSyCLPK3MUeeM5S1SIgHyCWtoFba+duZQ1BzD1vZoQUdsy04JY2VKAL8/kN86l1eqM3HYle2GWJfMy/baHkLpIKBwc3Lqrn/rZ6j5+I/xEDU346Kt/JFwFw1PnQgk2CqDbh7dTSQKgunY28YhcpTFYTGuNi1ct3qUlyQcxw0+Xy04OryjGcE8zmAOHbQYziuPG14XfRMXSrKW5jEQtNiKiaeqB9njpyOrXt03m/rs5NwNh9XpbbhLrixhbMe1OEtI9l53Ikh47twUn+FGKUuZn8LziXkOCFQsgbxfwgbam2R0adjF7L4kWVGujnemgdkyERog4xL2G5wiVwsI79hubhD3BCM8niQdTmKdo7r5/lIAqAgNE3dK/4JGvhnJTXKXJomXbFreEzFs82IcENUyYWtvUdSCTjdhRcMqcaESNphD6YgoRZwOcDB9hmTaoZMl0DFSiZT1eT2aSvfXezrH0PdPy6eEtDtJXM1UGKZuiZRdns3x2NCMBSbrbhUSQhVBQRIbalkPbyGbVwxRfTMzi24gvJoqLwkwkpwI5+Nxy+Ta1wPM6/x2+EmZp32hrPWdkjbWfXj1V2Gpj6Nn3Vqs33OYb838PE3Ohbn9EDB5KeIHzmFljlqXo0m7cDk6b50Zr3lODl464cSlH99Q/opWIm+KFCOEJAzBMFGR6EROZLv4S7kdB 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:(13230016)(4636009)(376002)(366004)(346002)(396003)(136003)(39860400002)(6512007)(4326008)(66556008)(6666004)(2616005)(66946007)(8676002)(66476007)(33656002)(6506007)(1076003)(41300700001)(26005)(36756003)(478600001)(6486002)(7416002)(186003)(316002)(6916009)(4744005)(2906002)(38100700002)(5660300002)(8936002)(86362001)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SwjTI9B46zaDaGQBSSQdR68CK81qeO6tvca+b9EVBjdn7msYsPhR0Lt99O9G?= =?us-ascii?Q?otc7onGDZyDO314sWKtAiUWK4dgWJbLXQ6Xk6QrsNpakH0xUdZcqhPQwCEVE?= =?us-ascii?Q?cKC1LPsO6TkRP2UPpwMJhxNacpkLEaYSG0PQp8EoOMepY54Vc6pxUIheQmcc?= =?us-ascii?Q?0bLuFwJrsyporLHL5J0S8Ib0lLo1/4yxGjGb5Srq/YEtKZHdyHuSJQyTV5EK?= =?us-ascii?Q?wXaq8r/v3IfNL3oJS/+DzfmhqTFOWCm/bDQpCMokl5Ko3QOK4lsWkY0514nN?= =?us-ascii?Q?1nkh+3UHvu7RNehOOSfNGRubcZ8eOnj6/g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q?Dyw8tN8DFMXCv6Bo0puqR6iddTnK54ERXEkUyTENlJZvii0SIRjIsCU7BzTZ?= =?us-ascii?Q?Qujtss04z640/QY71l6D1pbqyXRbgEQJ6ueoDDo90E1Ne9XA6k1yNoA8E9DR?= =?us-ascii?Q?24VRqX1rQy4ZKZcO6ASEznet40YIBXowDiqEEu6AXq7f95v/Rv95M9nD2Y57?= =?us-ascii?Q?//SL3jv0Pd9HOB3N6z1TuKSK2m9sw13lB1q+/PsWAm7WcpIBHiWMXK/lPG0U?= =?us-ascii?Q?Hpko2HIZfYjnKk+DauhfGNwGyEkiiF4thLqblYoZ/NPM6DERHd1JlMK9Ow5e?= =?us-ascii?Q?J1ZE52UV7FPWk7DppYN1HsadpRMK6Mv2ECASfI0oZztabY60ayJ2025eOIAm?= =?us-ascii?Q?kD8c4l2ScX9Cvld7NGw+OlJK4wYiD3xAkGwCJO5q?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38754652-0de0-43b1-65fb-08da6cb3f2d1 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2022 14:02:15.5882 (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: OgQ7mDt26hbhlRUlCW5p1KYga+cyacZO+MRUIM7d/65nMgAnSnIEYfMQScDMK5WW X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2761 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 05, 2022 at 01:07:00PM +0800, Lu Baolu wrote: > Use this field to save the number of PASIDs that a device is able to > consume. It is a generic attribute of a device and lifting it into the > per-device dev_iommu struct could help to avoid the boilerplate code > in various IOMMU drivers. > > Signed-off-by: Lu Baolu > Reviewed-by: Kevin Tian > Tested-by: Zhangfei Gao > Tested-by: Tony Zhu > --- > include/linux/iommu.h | 2 ++ > drivers/iommu/iommu.c | 20 ++++++++++++++++++++ > 2 files changed, 22 insertions(+) Reviewed-by: Jason Gunthorpe Jason