Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2492091rda; Wed, 25 Oct 2023 04:34:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtOQMSlovt9BE150mM1JtE9TOWuCuRCaAUwkVaSOF6tT7NLcW+HlAiWY3erm0aS16TIP4k X-Received: by 2002:a05:6808:1895:b0:3b2:d6ce:f582 with SMTP id bi21-20020a056808189500b003b2d6cef582mr19354742oib.34.1698233648268; Wed, 25 Oct 2023 04:34:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698233648; cv=pass; d=google.com; s=arc-20160816; b=WGR6ybnyU8TJNkSvU3lTeatQgCyQFaXKWTMEAR5YgqpoEpjoD0yYDb7ENpLHGO2yGF 0DSg46ZdnMLdnSGTaGs98nip2FG8mHFBKh42epKauynzt1Ln8Z4W0511HLx741KEH44U XqngtmGbTf5xbpZMdEFIGmWH0Jhv0tMjwruRz8pKulFWpnhFTIqQ/GVZIIirwTgp024f uDm5czi8q9VWoDyJyx483gw3Rbs8+7YXqa4QbrXeWWJT9X8HzeLq+kZa7xB3a7vCsXN3 9QLHBClqd+6jJ5Id1ZzoJQbmMIPMCPMm9nZXsLRdxDGtQWbW1AtYbOHTmqsUxVAFECqQ qAig== 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=kfpKJXaPcodKfu0l2Mqsb2iH0nb3MDEqtmU9UDODzUk=; fh=809GvQL8smZrI+EkSxG7FsLMAJPj8D9k9iGE/sm61FI=; b=guMcMfeYri5AD1i0bUh+dpRhkMLNTgys3hhzhwfIKDABTFJybGgIn7WW2wh9UZVm0K MU7Voto7KT5NJnPQdPxG58yD/+qRQbCjvqjT6cqUJLmgegoeRV3nhJ7RakbkVOpuxqTu 3YsJXMDtMy6JjZs/UM+aWvjmhrRLOrpL35zseJ/8NB4tOg/Mtcaanxxw7AHCJvzejkX1 6sHFfBjJbiJaKMaS0Umfxoe6dxVn5Cl5/ssB973SO9rPPowVp7Pfghd/k8CLbUEa7lXY FOsL9bBsh7y/TzNRzWeHrLfJB7Mv1b89FgS4gSWMC2iKFM3rZfEGGoR22xmZR7bCo2H2 58mA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="G4Zf/OSc"; 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.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d68-20020a25cd47000000b00d5c1dc7b052si9075555ybf.713.2023.10.25.04.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="G4Zf/OSc"; 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.37 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 snail.vger.email (Postfix) with ESMTP id 830DB80E73F0; Wed, 25 Oct 2023 04:34:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234582AbjJYLeD (ORCPT + 99 others); Wed, 25 Oct 2023 07:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbjJYLeC (ORCPT ); Wed, 25 Oct 2023 07:34:02 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2080.outbound.protection.outlook.com [40.107.220.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13579129; Wed, 25 Oct 2023 04:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnd7DWiG1d4HIrClW/EbniGaLcd7/qUjX3Bs/yWUI61+ArMOwLBBBRDcFO7O7MFjN8YupCZXPw6gHVYV8Lg8yCb/jKh1gl/oipWBC2XyZXSnw+zG3c2v+fKDz8eG0T1Pi5kuU9tiwbjeW1t7l0eVi2jjC5aj9nFOsZEZn7MpwngiMrJ799WQ1vMEAwHX+uuooFpWXKqLjGWb4BNv9tSCfRbCYzABt340718QNKr18LjSQM8Mb/u36ZtFkO3Qiwai3FQ3CaIvH76gPEFpJmMI07Qo3+Hve3gedXl5EGGG0MvxnxZlJN3l5f2/nRtE15wJNH6BlfSuWxpzD7GTVHAKVA== 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=kfpKJXaPcodKfu0l2Mqsb2iH0nb3MDEqtmU9UDODzUk=; b=Dd+sUSKsUep79Uvyy03pGEWl/gcohixNEY5EdRDDuhG0nvZzmyyhHQLjK//bnaPImOVtVu0GN92zTzUWyhnz61xuJ1JsnnkTzfcFRJsUkZ+Yuay17s0gsIPrM3mW1o9Y9Z86dW+iibeSjh95/pS9ttzfanVq+QvPgTevPmIORbPnoGnGAOPr0UjkeCIKe4V5vnM0hbttNGQGK5WZTXIKxqG56mkx9qmf2i86SGXyS5dYfpQvhjUQvxeQUMRpuNwL1aabybXZj9396tYbXvGLfUF6dpCrUTDGKyCqQYNl9scQxW8sRm6Wjo9SGMqBJIlr6X4Kdx520k/d4ZlhTxn3bA== 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=kfpKJXaPcodKfu0l2Mqsb2iH0nb3MDEqtmU9UDODzUk=; b=G4Zf/OScCEKa04mFG1yBAlMa58giFxjKha9tZO9OaJJfEl6J61FhLPlGeh/IiYiAHm9Tz/j5PGW9boha/31tAHxXGiTDEu33ETFfl46PDisfVaByfMjjPb0U7sR7MEWWC8nPV6qFm1P4X3kM7vRso84nZuSNbqaXSw6ZkZzKv3hKajf+zs5kJ8aBG5JU8nAxzX4WFyPd9PvE+j0F2KLEcJAyJVGM61gaVHimXJ8AC7tkKMpCIWnjpQdm+W3bQtgGLYlPkt2fhn+7gROXHkWicKBLARawpD4qrNxIiD6CzAgskibGmjiNZpjfgaA9oba40ybcPKBku0CyyU8oo3im8w== 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 PH0PR12MB7981.namprd12.prod.outlook.com (2603:10b6:510:26c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.19; Wed, 25 Oct 2023 11:33:57 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6886.034; Wed, 25 Oct 2023 11:33:57 +0000 Date: Wed, 25 Oct 2023 08:33:56 -0300 From: Jason Gunthorpe To: Baolu Lu Cc: Yi Liu , joro@8bytes.org, alex.williamson@redhat.com, kevin.tian@intel.com, robin.murphy@arm.com, 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, zhenzhong.duan@intel.com, joao.m.martins@oracle.com Subject: Re: [PATCH] iommu/vt-d: Enhance capability check for nested parent domain allocation Message-ID: <20231025113356.GX3952@nvidia.com> References: <20231024150011.44642-1-yi.l.liu@intel.com> <62f396d4-f890-477f-b9ea-7b330fec35c2@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62f396d4-f890-477f-b9ea-7b330fec35c2@linux.intel.com> X-ClientProxiedBy: SN7PR04CA0109.namprd04.prod.outlook.com (2603:10b6:806:122::24) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH0PR12MB7981:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ee603a2-29bc-4544-0f17-08dbd54e46af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PSaUzxXQhPT+n3HJYGPR3bSjWShvN5JzbDtPg7IhMxLisvWJNczuuWdi+xpFFamvTrnKlMIclMn+K2yI+ys73T/gn1SmtnWS79zC5JEfIPUT6KuUnP1Gr0IAUJw17pUcFjl4/mLCZHRuYPXavFsEGmJCxnAMoWUWdo7eWkCLwuFMHPCyl/C41LLge7+kKCcD2lufAlCHo1V/QV2HRSgvPJGncZ8nM8SN9sR7QezbrpXQq85qlnTbREMNC+rdJG1Ediz46WYL3Hf34fjQYuc9kSytrHa2fDNLySe+7B/EpWN1DvV+X4YlPydQhRiI8Exv4nLLIvBJL7oyoIQB1KEke8BFXuGLpGWKzPU7P0DrcxglJZv6T03AuG0xCkhLiWLp45+GaKzkIORxehuL5DFT69buBclgSQ2wJZYYLqrHtB0VQMy82d1BpV3gE3cs63NpbXtC0hjzrHUVfqOehSBqVYGcjAAfv2ztWr73yM7jphviyev9DgK/3wCuP52NsEInyF1krd6RZ9brnn+ffZsB8Ec5s7wUyKTS3hG3MzGtMdKj5X5vsBrDebsI48oZFENY60Ux+jtnQY3S/AovQUfZFpGrnyukUtdkwr+PoIuEVZw= 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)(346002)(396003)(366004)(376002)(136003)(39860400002)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(4744005)(2906002)(4326008)(8936002)(8676002)(83380400001)(6486002)(966005)(7416002)(53546011)(41300700001)(5660300002)(6512007)(6506007)(86362001)(316002)(6916009)(1076003)(26005)(478600001)(2616005)(33656002)(36756003)(38100700002)(66946007)(66476007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GqvlfS1inqOfSTIJdqfAPO96g9AmJGYDw+SRz+5/l3w4HzpnABzNzW+M/HoY?= =?us-ascii?Q?OqOIhDahyuCu2ls/AuBoXGhB2MA3yrl35gQHPw+pYdJq5OPDvZiNx3GNkq6K?= =?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587/QNX/3utL/thgZ2w?= =?us-ascii?Q?py9zmJDDVXySGknm+Qx9s/PWgzw+oQxaGhOBU4nF6tjhMu6Q812V8OQ0grjJ?= =?us-ascii?Q?YjnP4iaGGYx5beSlmg/tKf5FdAlJ5qBRDLjeqic4A8YZ1Th+cbiFRQEZ1YRL?= =?us-ascii?Q?xCOJegNadp2gRfejI9s82j8ObLWgwGpMv48Poo9oYkD+GoDGFirYYwyNuATM?= =?us-ascii?Q?K3PEUGZNBt1vwop3+eUeVgT0yXvssBWO54Y8eRPdyslzcgiWD3dxptQA5H2u?= =?us-ascii?Q?iaHH2EclkVoE5JyrPWJnI0p1ustBb57oy8JjdUWAKOpsseZZ5NSgQMg20Qqn?= =?us-ascii?Q?+a1Ich/sJ9QacakG76XAjxY3VoExjtSabL0hxIEBbDa0BXlLiHfIDjDJaXaa?= =?us-ascii?Q?z5T24Cmc51+IDMfcBsldfPR4LCUSxznECKdqeO9zZ2W+TvY+S6KLE9SV9gP9?= =?us-ascii?Q?xsS2bMu0+PNoRjIKn3NDOZHIkge0pDP/EqKqsYBGRIj7rWYK+OXgjClrZWxt?= =?us-ascii?Q?MSdm5bKrlTfyJchgYGxv6QVGGsNqyQcqli30sJ1hYnozDyobNjb36V/tbF2W?= =?us-ascii?Q?Rq67jnYrU3rTwZTUuUo3E2pRWR6N8BmjfsJelFGS?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ee603a2-29bc-4544-0f17-08dbd54e46af X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2023 11:33:57.4698 (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: z3KL2DB5oGeQRDyYF0NsIQc3W//tquh0JCdBB2y9A3z29G4i6TQmqN8oH/UxpdUY X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7981 X-Spam-Status: No, score=-1.1 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_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 04:34:06 -0700 (PDT) On Wed, Oct 25, 2023 at 09:10:08AM +0800, Baolu Lu wrote: > On 10/24/23 11:00 PM, Yi Liu wrote: > > This adds the scalable mode check before allocating the nested parent domain > > as checking nested capability is not enough. User may turn off scalable mode > > which also means no nested support even if the hardware supports it. > > > > Fixes: c97d1b20d383 ("iommu/vt-d: Add domain_alloc_user op") > > Signed-off-by: Yi Liu > > --- > > v1: Based on Joao's dirty page tracking v6 https://github.com/jpemartins/linux/commits/iommufd-v6 > > --- > > drivers/iommu/intel/iommu.c | 2 +- > > drivers/iommu/intel/iommu.h | 2 ++ > > 2 files changed, 3 insertions(+), 1 deletion(-) > > Reviewed-by: Lu Baolu > > Hi Jason, > > Given that this fixes a commit in the iommufd tree, can you please pick > this fix as well? Done Thanks Jason