Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7425289rwd; Tue, 6 Jun 2023 10:29:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7aBESFeghS4Yh3m0pOatj6LlyvJ9Es/I8KcjyoPDk13b/zWZnyiuRG8xoI4IBt5ut9vRh4 X-Received: by 2002:a05:620a:8dca:b0:75b:23a1:d8c3 with SMTP id rd10-20020a05620a8dca00b0075b23a1d8c3mr461736qkn.7.1686072594469; Tue, 06 Jun 2023 10:29:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686072594; cv=pass; d=google.com; s=arc-20160816; b=dMNs83rVGKJQHJi6rJrUEKGi+jbNB9bv/z8dZTzx82Mw8XDkcg0xzyk3gx0cdZa4Op G8GOjct7p53eX+4vK+8Mf1XQ5+hnXf97CxwMPKyLB6kpVNSWhxltTbXlTgrmedY9Ggeq NowLtYbiQB2CwsEQMRFOMmH0Q0duWkybYEaonexxN2ZLnIj4345rNs2Sgq25rDbQDcgl GLdduJ6RBezUDazoRJgv5h63pcE/s1nb6IfaNJyUgyfgsaMb75Ck1OHUp60+tpj7tk9x XytPoBkse1mqkeGSdXI7CCe2b05Yj4he37KVsA2rU4C5fVOLxsPhA5Gc6riiss9AYBbt RX6A== 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=dx82KZLcT/tjdpR75f169l6rVXphPQxUcdJfn/F/qm8=; b=gptx3pDpV2aCoZ3j2s+yp080dLN0RHV9Ms/qaUNBGTTlp8D1id+msdFA1xKuR8aGXy k3m1kIH67cLTXFgZ+YrlfO+vUQrO92m1lv7P6CHSUmGe3qlNh9ufGtR56i7sghQcF4WZ A6VyrGINkGqEtOw+MLBnD2lxokZ6EbfkzOWD0/b04W/k1gMVYcgb/oOvhQKOxbegD3dA oRxEgmjqHVkUGPvC4vzwE/UCOW/XozQYhswdKKIG/NITlvYP5CLROJxKWK6PtMsnJORa 8VcKUKnMlk8NfkepKGSslOqgagSzrg09DUs50VybeM3odbgaPfttxl+cByzXBxa61sE7 c3pw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=fLMcL89l; 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 h27-20020a05620a10bb00b0075ed995bae3si401879qkk.355.2023.06.06.10.29.38; Tue, 06 Jun 2023 10:29:54 -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=fLMcL89l; 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 S238524AbjFFRQv (ORCPT + 99 others); Tue, 6 Jun 2023 13:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238366AbjFFRQt (ORCPT ); Tue, 6 Jun 2023 13:16:49 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2066.outbound.protection.outlook.com [40.107.102.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A0A518E; Tue, 6 Jun 2023 10:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aOxrfD5F4Bj5HfWhOhfb6bdPdfAU1Fs0RqyumX4lflQb2qGd+pRme7Yo2FcLQmFzMeKChYHDf/MZTPWHDHFTzP4L4yIcqeqMWuzqaRFJIvs3NzaVl6FCHynKeSH0yFGbp0fKbk4VLAnXfsRXKw5yqEbYb4YSD57tEmdx8/hz+HDaD+mTRIKoWc21W4k3XDJE+AWQxYc42WXyEiEK7bQYDS/a+Trn/I2icy3O/OzcWGqDIa5UjgTfcEjKgZC7CCI8TBuKXE3RJtilDSELaAu0ptODY4aINcDH9ElUcChz3o7dl0eEdE4FBgYv4LlBk/bM9ai7SS9cOzYrWZ+crw0D5g== 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=dx82KZLcT/tjdpR75f169l6rVXphPQxUcdJfn/F/qm8=; b=mhukIVCE0kMduqtZ69XszouTBqaE8VyxZxdUQe0i5wIfgIhGLTa/aHd2nu2sh9Oc0XlethFlOqUDYr2EQgQj8FKEoNmklveE7HASWvUVN2tfsE3uXfVYUl8VvpF6rL2s/umoJ3BN+xdtUz8TrQotslMSCcIUwf4RfnggDpdjFKmvYAYynbPDtPkewSv1Z9z0QUZM1LicQTbWKs9lTXkwh6MplE7+0LTjPutxBJUuT2PDohx3g0Ub9cJdg7cSnJVIjE5BKuDMx5MqOA1oAV1zgTE1yIZdkuBxdcDfjVkQOf/b9gyUL6YVXPOyX/XYmvfDwlSb4JcSZIxu9J+niYzmLA== 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=dx82KZLcT/tjdpR75f169l6rVXphPQxUcdJfn/F/qm8=; b=fLMcL89lRn0NJ5a9chJOqiB3IPoyQ3Zx9TwxSKjibJca8ZlnBO2FbTI/KwvVEANazQOzpz+FPN56JzjwYowsFZT9DEYYrTaLYKEUWFqwoJ88Q1domJ1WtV6vUhBdqW70F4c+iGG1FwUzMJTiHHRg68YZiseKOvdmyF/xcFHQ8T5Ii7650wLkZQlSwzT+p/cpvpaBdtzgJeiwLmTXHTDUm4SviNvVblJyxyJoBfqtjhA0JrBh/EzozX9vMfTDgsohM6Tc2/bXLVXRIcVb/SG5snaP3yibx8g6E1BpkbcS31DnXeDXfzEQU2hoQgxNWlo2cuBxqiGTynXmJ3zd0Ggngw== 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 SJ0PR12MB5487.namprd12.prod.outlook.com (2603:10b6:a03:301::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Tue, 6 Jun 2023 17:16:46 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab%6]) with mapi id 15.20.6455.028; Tue, 6 Jun 2023 17:16:46 +0000 Date: Tue, 6 Jun 2023 14:16:42 -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 v3 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper Message-ID: References: <20230606025320.22647-1-ankita@nvidia.com> <20230606083238.48ea50e9.alex.williamson@redhat.com> <20230606110510.0f87952c.alex.williamson@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230606110510.0f87952c.alex.williamson@redhat.com> X-ClientProxiedBy: SJ0PR03CA0268.namprd03.prod.outlook.com (2603:10b6:a03:3a0::33) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|SJ0PR12MB5487:EE_ X-MS-Office365-Filtering-Correlation-Id: 50763ff7-91c4-4691-c49f-08db66b1ce36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xMbtzJAGi0QG3uKGS3z/PozlukYD8uEqkyTdGpMwFRltKHUsWLobjXLdtvs44ByqObRoenvI82t0290rsLRO6rgf+s05DYOp9F0I8XBrtEO9UpmsFtvPMkSrBB37e0KSDns51HmSNbZwMVxsWV99esqsg2hiV+rejqsmHMV+0mjQ7PuDTG+51F6irbuQeZ+ri6Yk2YKhXz0uHugUj2QO8ZSM5AxEDaK+hL7sabFNJ9AyADawLOfC48yLfzvo1GTd3hJpoAlC54pNKPoI9GjId4KaV4lhI0VJ9lPV2Lvz3crnQTKo2HLjh1rDIjRQG4VsauI52PhLzJCzR6A48jpEtXopawXSf3ZzP2dl1Bf+bAVftmgMO/a4ApRoq7XE6M497QLzxWpovh9Y8njjFOv6O1b6qy6Z42N4TdlM+v8eSn9wVo6LEO4L0Vk9viwq0aLyK0NBFC4re7gqyqkI2Y+TpiSvDJ6SKwhUNxZkVw4zG2ealx7kx9G9fEt2TLHTRSDhTMXSvB9LTO7/vrAxs2VD1FbVsBfpvUSbpyCD6WlXVOTM677EvEyj2tpHOfGZhJqpokzbIra9P+/KRqcVf0nJzGlcsof8tjlV7h1d+RTCLWrCf5b71JUPtO6FIas+BFu7NWhljJSpBnf5Wrts2RK2rQ== 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)(136003)(376002)(39860400002)(346002)(366004)(451199021)(8676002)(316002)(2906002)(5660300002)(8936002)(66556008)(4326008)(6916009)(66946007)(66476007)(41300700001)(6486002)(966005)(6666004)(6512007)(6506007)(26005)(36756003)(186003)(2616005)(478600001)(38100700002)(86362001)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iJu6teF7LSK1u/m8HKIwYET7hNba3kJdyhgQ6UAiFsBNLVUgFYcnRpNb8kXW?= =?us-ascii?Q?7PdfokJG7A9jDeDe2fvHkQoAxPS7haXSJWFjVNvE8xBdrM/AEHnvAFeWHRT6?= =?us-ascii?Q?A9o7yNSnjkzjd77I5qQaZ+sDX/HOlZGgcEWptndinfTkDyBGtkPtw8FTyxmU?= =?us-ascii?Q?s3vTse29hYmQ4h+rCUNcdNrSkz9+zo62ZwgjAhGgoD1uF5ypWH1A1bFcyWU1?= =?us-ascii?Q?NTCkVxvuuZxvYlm5LICzYMJKDYA4wPn4MPCB1xTurj2vkc0lU5HxjVEwnqff?= =?us-ascii?Q?yrZunPS1LMbajA7KZd6TZALZ3rCRp6l2F0vbuWrNwHpYeJtwYanILqwHsKvu?= =?us-ascii?Q?RqrHrO5hxVJm8iine+micNzBT8pg3ih+QDczwJfVgSFnLCfX7gJiHwD/b168?= =?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/usIeR9j2Cx?= =?us-ascii?Q?w8DgsaHSv+3cEN1vJyNCSQItkA1MsZbowIIdj6dVBYPTXAzJY4gXB27VE/c/?= =?us-ascii?Q?6FYgVgBIPprw/vmqKRvMxVqqvl8I7BzHaDHfdyZ+WMPidBUgz6U3QDjhFx4G?= =?us-ascii?Q?s2JKsGXEABL+lCdUx8UoOr1Y3XdvqHhag4Kou4PBvrtDvTJN3/34KesOegZF?= =?us-ascii?Q?Q87qMRm31W8DZVjIw0md9f8I6djTLE06/V7DEJySZ1+vHw598SK7imERRm7L?= =?us-ascii?Q?oJLWuIoCDz6TYPWke/PlTBbgc2H+BJ4uI6a5rSRf?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50763ff7-91c4-4691-c49f-08db66b1ce36 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 17:16:46.0436 (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: sCCVvMhrRBL4X4V2XViufDOWXHuGf6vpJTWpy+ysdqggSlHpbm+v66kU/EnbpVSb X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5487 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,URIBL_BLOCKED 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 Tue, Jun 06, 2023 at 11:05:10AM -0600, Alex Williamson wrote: > It actually seems more complicated this way. We're masquerading this > region as a BAR, but then QEMU needs to know based on device IDs that > it's really not a BAR, it has special size properties, mapping > attributes, error handling, etc. This seems like something has gone wrong then. ie the SIGUBS error handling stuff should be totally generic in the qemu side. Mapping attributes are set by the kernel, qemu shouldn't know, doesn't need to know. The size issue is going to a be a problem in future anyhow, I expect some new standards coming to support non-power-two sizes and they will want to map to PCI devices in VMs still. It seems OK to me if qemu can do this generically for any "BAR" region, at least creating an entire "nvidia only" code path just for non power 2 BAR sizing seems like a bad ABI choice. > I'm not privy to a v1, the earliest I see is this (v3): > > https://lore.kernel.org/all/20230405180134.16932-1-ankita@nvidia.com/ > > That outlines that we have a proprietary interconnect exposing cache > coherent memory which requires use of special mapping attributes vs a > standard PCI BAR and participates in ECC. All of which seems like it > would be easier to setup in QEMU if the vfio-pci representation of the > device didn't masquerade this regions as a standard BAR. In fact it > also reminds me of NVlink2 coherent RAM on POWER machines that was > similarly handled as device specific regions. It wasn't so good on POWER and if some of that stuff has been done more generally we would have been further ahead here.. Jason