Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16405976rwd; Mon, 26 Jun 2023 09:31:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YriqgPdg0fR1NGQSlMMiWd1U1wiKAsA+aGcSenwUTZfgmSKI5oNwWlHd5J7fokZ4AkP9F X-Received: by 2002:a2e:9c07:0:b0:2b4:6ca3:7747 with SMTP id s7-20020a2e9c07000000b002b46ca37747mr15765230lji.28.1687797118882; Mon, 26 Jun 2023 09:31:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687797118; cv=pass; d=google.com; s=arc-20160816; b=TD7tTRWOZSPdVL4EFp/Z47+8zN8zBRCr+rX42VLKXCnVSU//pOfwYe1DF5+tsXUlLk NA278CLUCwjTx6j8HP0ENVUtW9jhG3Y8hioy47Vu7cud4J/NaGv/ydkg6pQJ6NRH+ETd 2zaJnsG3ozIHNoa/+VZb61Qzzzdkxhwc3I04b4bxOLqhw+VIC2odMN6w197xbq9ApBb9 AZWlRTxPOI1uNVUSvxYgalUu0otBQv/oW36w+87opEJxrTeIopOriZi4qexRoaEUWZ83 r9Ci3z6O1X+EIjeBCJHikJ192SFImeCiLxnHLbcVA4ueA0pxQXeeXmCpoObTCNSy2ebW ipmQ== 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=j30aBMAcZxJzYSgJm+44A+2jO2EztXvfs0/DogpcmGA=; fh=eGaTd+dECWGWTWRdKJB0QGHjJ9bMiUBiS1fvTDjVlXM=; b=Q1NQgQQfqR/XA0vjq8fCxFmLvFZjmWthOJX4ohXbWYrWAkEryR3gWXvHgy2TVCPaD9 cWk56n1u9zpBecXi2/5k8vl/FYeBMZv0vEBKQzOSEMRX5VsNrOWY5haJMWtYj/xSh+p5 NPPOl1DZXG28TQeTYcT6eVKhmSvCsoKRKkjWYD6R7eQbwVTuOv1tQkP61DnWtCGmc8CU osWwoP0EwK7+zLMo3ywa6uj+wmBHnpZezHShpf8ccUFQQazdTpeh194aZtx5sEv6Z83U xjZspwpLnX1JQa8hArvHJJxtSoiXAB1LsYJvnmKkmwdA2sfIcMAhXIHDwjAF9seNP4ef sCCw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=pr1MyVnM; 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 e17-20020a170906081100b0098cd94bc1fasi2764915ejd.983.2023.06.26.09.31.32; Mon, 26 Jun 2023 09:31:58 -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=pr1MyVnM; 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 S231666AbjFZQYZ (ORCPT + 99 others); Mon, 26 Jun 2023 12:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjFZQYE (ORCPT ); Mon, 26 Jun 2023 12:24:04 -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 88C642135; Mon, 26 Jun 2023 09:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WfPso+YU91VDXkorR0hNeosx0U7UHoqhDHAycwjCQZ8sayxGJAw4cU0714Ci7vcHhBTuWhV4B6fF5cDBlvrcMuwmvIQLFiI+b8LkzHun7hGOVvDpJhENTtuxXuXKVJ/kZkk3ThefeOU6rcrzS2UtLM4BvNo5c1ObNM10TtLEbMW69mJsf8N2qx95zZvttSV6imH2FGGENhr+iLYxj7S0l9YrMbUel/z871FfOXBsfXJsBa2MDpiQz8S92ZDmhSzvF7HDhVfeTfez5gLevo+V3hf4eStqoYpbFdLULv3MNcLQGFL/v+TaIPcGMVjc3t/wssv5w2M9n03y7fy/PMkwtA== 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=j30aBMAcZxJzYSgJm+44A+2jO2EztXvfs0/DogpcmGA=; b=T73EgjhUbseD/6MkbFIi6jtJOW0oD4IgvxKaqZ+zcZz3p6fb1Z0e6eOHX8RC84RBeA4sSEoafckunBfczSWebxiO359NOwrccS3ERz8vg9DskISAiIHhEKuq8GOfynUkIkCOx7LlyOYITbWsLPafJbyXb4K3h0qF/0+w10F7QQo0DfH/YNO+lVpoMJpFq1cxQjguFkl83SP1yBoKu7UzVkkmTgMvEqB5uZ8/S0p7Mp3C1NWJglyeW7Iiz1+ZOC8G7xR+n8GECDrCbWLWXZ+72gjfMDqTYaow3G6iqvaMsSsDKoSbv/15oWuOHOtwcmIajwDPSqLdaYNFX4IUw3IEgQ== 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=j30aBMAcZxJzYSgJm+44A+2jO2EztXvfs0/DogpcmGA=; b=pr1MyVnMj1sQb+Tj3HCVsnJdJ9Wkd5tz8hjqA6D+99c2JoBFBj8U4qb8IAswbo/DFJPbwekGy9Zk+uyf8yVX80IT1MRyQ56nx0iiiJZFSjdqtjg9W29a1pYr6FZlTNmq5IDLY4hNjLzPLxf2ZQz0HBOW3wJtdPTYg5KIKjCsLN/rPu/W3LR9KUhwcniRrOjQZ5svhgY+xGQnHDsAYGxdaC7DIv2IPWVtPHQKvIntBGQcL+BvnBxQsJ2kOO9mCPYcKYtWn0n55QUqht2f4P5XVp8pNDIijZiGMqTm51muFcmhaZoA6drnO0rIw0hYfEu4yqfQmDoxNuJuYAOO4vc0/Q== 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 SA1PR12MB6749.namprd12.prod.outlook.com (2603:10b6:806:255::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Mon, 26 Jun 2023 16:23:09 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab%7]) with mapi id 15.20.6521.024; Mon, 26 Jun 2023 16:23:09 +0000 Date: Mon, 26 Jun 2023 13:23:07 -0300 From: Jason Gunthorpe To: Alex Williamson Cc: ankita@nvidia.com, aniketa@nvidia.com, cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com, vsethi@nvidia.com, acurrid@nvidia.com, apopple@nvidia.com, jhubbard@nvidia.com, danw@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper Message-ID: References: <20230622030720.19652-1-ankita@nvidia.com> <20230626100629.3c318922.alex.williamson@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230626100629.3c318922.alex.williamson@redhat.com> X-ClientProxiedBy: BL1P221CA0012.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::6) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|SA1PR12MB6749:EE_ X-MS-Office365-Filtering-Correlation-Id: c60d3d96-6572-49c8-9de9-08db7661a11c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 23jXYxiN3it1/RUbzOS6+DwC42UDjqY01tcxpABMUVadPLxjRmiie1og+wXs+nIdALBuYE2qkWuDVFfjts1znmgHU2ZddMHDrqeBNvPpIzMqgPJ6bCwB41/AsUyvbjVcwOONt835cvha2FwQfBw4eHEAi387wx3utPzRAoqoRdrFwJNo6io9xAJlMDktSQyC7nLeG0FPAWGd/0lhFBqK+wO5KtEPPKK7nxHjzToVy9tjJdtZQmFz4CAHY6Z5go3aZEpc4u5qtuEFMotHWArz2Z92bpkTL/nnKJ+rygTRRJl1n6sRv7nKSRoqCU6sV5Q/xFKwgbH/C5ZIB68UM6g1/vi2ENdiZb16iY8UTTDge+iENDxuCXjYAYRA2/1kq/0patmYxHIz0URvqsW1s9fUJ9LvYeRbW7uzPR7YM+4q/uwH4HTqR168vULW6BgyPlS0jgwqimpMx12CERxUk9CDnnmo3JEdRAKEzJ0ef8MfJGJwEddcP/nSlx8UtshXo+/p4JupmVVeLFT84mlftxzo/Rb677MDb5SXhuFfV5AoQGFV0P9eWsdnQc/Tvz7LZRsp 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:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(366004)(451199021)(86362001)(38100700002)(36756003)(41300700001)(6486002)(66476007)(4326008)(316002)(66946007)(66556008)(2616005)(8676002)(6512007)(6506007)(186003)(8936002)(6916009)(26005)(2906002)(4744005)(478600001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vrHCWhM+9ZxIplgL2we/T6vnvSPwNxjRXbgcbhAtrqQEBj3KqfiWhy9VfHpW?= =?us-ascii?Q?zsjO6k+4jGovT6P244D8cZH+32Or3C6+8QqbTxwwexoRTfycHfj4nKgcatlp?= =?us-ascii?Q?XIhkVCjhKvyVz6LrSveBdwEVV6gxdTJaEsttFqey5cx3Y1BbLwcOE3JphbfO?= =?us-ascii?Q?hCaiBHyHjjtXhkOeqEOrQ2VaEdXViOjWn5aoiKeibLy2efgecpgDKd7MSPYd?= =?us-ascii?Q?8ro/+pyeJFC1AFxiuDCyZXclXKkU9cM8jN1ab6f6L2n0bETSoh9HmlhhrLi2?= =?us-ascii?Q?OxkL8fHEPZPcSguFTOBVh6hqRaC8maJGQ0xGFzNI4rgDS9i2cB2gUM0sGdV5?= =?us-ascii?Q?LJ3Gmj9+M3mNBr2smQm6BTCBm7r8+Jy3SAOHN/Gcb2QJhkrPBzl7tdmAdsgL?= =?us-ascii?Q?Qd76GpcZXPDZ3AyuZYREecndWtjCavuefB2QeCAP9b7+kikk/lQFcwsU3I0u?= =?us-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byEvrGjvIkPDhqH4mBNSaz?= =?us-ascii?Q?rWQyFQ0p1jOPcG9H4QWgiWW2ecwDZZ9FZDdiAjYLVga/aR/6DB8rpkGERL32?= =?us-ascii?Q?8iNbA/YAqEJau+f0u5zctm4Ls0Y+83eqY/F/hvI6t3capz4zo9yUrkNyRRA4?= =?us-ascii?Q?7Z5A+FIr6xFpLJLPZc56knkt7eTEtD3Eb9sjyw2+6xD8Q1jL4xazhsHvzxM2?= =?us-ascii?Q?owIDYgcr/dbOibGTiUjiUade0jxh+UGXwPV3RolD?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c60d3d96-6572-49c8-9de9-08db7661a11c X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 16:23:09.1590 (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: T7iPeZ9bh+fXdEKXIOvxHNbFv8p4qgSX2E2r1cF+TuVQbHs8Nk4lEsS7cUypeBnO X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6749 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_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Mon, Jun 26, 2023 at 10:06:29AM -0600, Alex Williamson wrote: > On Fri, 23 Jun 2023 10:26:05 -0300 > Jason Gunthorpe wrote: > > > On Wed, Jun 21, 2023 at 08:07:20PM -0700, ankita@nvidia.com wrote: > > > + if (caps.size) { > > > + info.flags |= VFIO_REGION_INFO_FLAG_CAPS; > > > + if (info.argsz < sizeof(info) + caps.size) { > > > + info.argsz = sizeof(info) + caps.size; > > > + info.cap_offset = 0; > > > > Shouldn't this be an error if we can't fit the caps into the response? > > Silently discarding the caps seems wrong.. > > It's required for backwards compatibility. If a userspace doesn't > support the info ioctl capabilities chain, it gets the basic > information successfully, while an enlightened userspace makes use of > the flags to know that a capability chain is available but unreported > due to an insufficient buffer size, with the required size being > provided in the return structure. Hum, maybe this part should be pushed into the cap helpers.. Jason