Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3973783rwe; Mon, 17 Apr 2023 06:22:43 -0700 (PDT) X-Google-Smtp-Source: AKy350aUPM0ntkaaOa9ymOZYTtPJg9p2ZzuB6FRGVjPiWV6T4vECPr7esiw47MiS6uvs0w/GGOXs X-Received: by 2002:a17:90a:f68e:b0:247:96e0:2ebf with SMTP id cl14-20020a17090af68e00b0024796e02ebfmr2896433pjb.1.1681737762791; Mon, 17 Apr 2023 06:22:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681737762; cv=pass; d=google.com; s=arc-20160816; b=ku4gUDlG1xb7hWbAXDrEWzz4Swk3KXk6WY5k3jr/gh443oyZJjQzjJZYlnM+9YfkrT ID7ZarpfuRkyOYvIBaKK2xSGDIEn69O4SCOtGWp21Mu7OfMpVsqmHpw+OlW+l+AmENUG AV1F7njHr0PtRDJZ7F2jdjZy6Vp46DluOSWq2hsrsR9S9zlKeoQT2fGYPTup08AjNQPe ZPzv7dzW94k2naqnIOkE5r1q8w8cSPz/3bMO/WYGB+5uX3rRiSjDenMLYk+7XUxsI3Xv YHe5AtV88mNWeq2AatLT+IpIFfFXJYL2bLXpOqxBaXtjqidNuahCJ2oY+XhpQLtu1hIN /fvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=KX+0RnpI/PM3OMfTg7nkQbd5Q6i4xPtC1VlYU9tvVKU=; b=zQ6Z4dIq5qem4Ru4R1JCyFNWU2DkAqt9bvWT6gwbeXJFm21NlQV1ewnL7W4Zbccqgm daRjdWX/9qcCVrhqd++GXR2inXmeRUMFgi7NZRx0Z2diMKIh9DwyBVMM5EDpuT4CS2p8 BX2p5iuDbkDIj6mGDiY4sN5O335Ric0w33VIGILTtk5Yx/YUIaf6sp4LrV17w98aMa1I D2TeA1BJD7LRn2aoskg4eXrm/j5KNVNAx7RptF3Y/1T1sZYl6KTMbMsIzNCe7F5phSTh y/v2XybkTQazmhWnCSTlO3tCOBpLSF29AdGo/uTBLr2n/SED96zauhOb8r/RhZenhRXb ssgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=B4dRnSRs; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020a63fd18000000b0050fad17282dsi11791434pgh.217.2023.04.17.06.22.30; Mon, 17 Apr 2023 06:22:42 -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=@amd.com header.s=selector1 header.b=B4dRnSRs; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbjDQNVZ (ORCPT + 99 others); Mon, 17 Apr 2023 09:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjDQNVY (ORCPT ); Mon, 17 Apr 2023 09:21:24 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2067.outbound.protection.outlook.com [40.107.96.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EA56B0; Mon, 17 Apr 2023 06:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EFz8N/BMIEXgcUcTVEgpOtXh72NZAtnrYOOOICfS52OdweWfd1NjQ4WTFmLw10Lrytvj2XKSd638QTCCWrwJV5GQCs0ie+oUsPbOCam7VdITQf4aejhyIh0i5xVtNnhKA2XJ3U7abaQDVuiH/CNeFMf4aaHozqw+QkagfWnmlMn7HFPL/nh8n7suAV/6wplkajQaeR9TKZ+RknmZvvz6VdJ0jZVp0RvPmwysilw88O8W6ggS3W1mdWtxPJco9rFWPyxxb/qlW/KR9VIzM3f/9d56gMVqvFNt9nvECZBTCPoV0mhmACWs6znY7RaI5O8HCuPmP9W8qNkrez6Xs+vhxw== 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=KX+0RnpI/PM3OMfTg7nkQbd5Q6i4xPtC1VlYU9tvVKU=; b=DIeWeS3kPH8sRJ1JuW1OlRSCkja39WYDNWAmHmYcuAEvvuTKRRpSySTol2D2qdLdagNfuEKmBigtDhG7h6qkvinCqffI5ZqaHXV+hrjNIynfo8FpjK0mRDWD02JDY16qqZsVgtDBv9MedonRfEl+NmaFOPftD81uAt8cs09nx3J7HkMXmS+znx0IcRR5Gup6chfA9/RZlZTeKmWoql0IeDjQp/cbHE29u5ApNw/0YqgFvN5RY27aCg/4mqwaQpvu/kZuvCy4ICaEjNttck5uDjwG0yZ9hj31AXPu1yr3mpLX5G9ndRmk4tr1U0mXKTFvVYkpvnnypa+4EBZiQIwJbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KX+0RnpI/PM3OMfTg7nkQbd5Q6i4xPtC1VlYU9tvVKU=; b=B4dRnSRsBRuN+OvT7I3gtQJ/vHTjRAaHHlRbX50oKwB+Tt86p3Ag/fUhS8ixa2VTsDYY/EU5nEtdu1wbLiIVJET1670qC4mkTW3U29n0BYHIasumnygx+aex2vZvTuFo7X5BXUHO8ZV4G6KocgvXdfjQNcn7sIOu6sTMmu7rEt4= Received: from CH3PR12MB8308.namprd12.prod.outlook.com (2603:10b6:610:131::8) by SA1PR12MB8643.namprd12.prod.outlook.com (2603:10b6:806:387::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Mon, 17 Apr 2023 13:21:20 +0000 Received: from CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::4e4f:3a93:b7bd:489c]) by CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::4e4f:3a93:b7bd:489c%5]) with mapi id 15.20.6298.045; Mon, 17 Apr 2023 13:21:20 +0000 From: "Gupta, Nipun" To: Jason Gunthorpe , Alex Williamson CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "masahiroy@kernel.org" , "nathan@kernel.org" , "ndesaulniers@google.com" , "nicolas@fjasle.eu" , "git (AMD-Xilinx)" , "Anand, Harpreet" , "Jansen Van Vuuren, Pieter" , "Agarwal, Nikhil" , "Simek, Michal" Subject: RE: [PATCH v2] vfio/cdx: add support for CDX bus Thread-Topic: [PATCH v2] vfio/cdx: add support for CDX bus Thread-Index: AQHZbs15HOi8AGJVHEyZ47Q7VDPnRK8rVKsAgAQr/ACAAABjgA== Date: Mon, 17 Apr 2023 13:21:20 +0000 Message-ID: References: <20230414123414.21645-1-nipun.gupta@amd.com> <20230414153614.3b72e659.alex.williamson@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-04-17T13:21:17Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=014aca73-68e9-4bda-8d7a-c6aabc41e417; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3PR12MB8308:EE_|SA1PR12MB8643:EE_ x-ms-office365-filtering-correlation-id: 29a80878-1301-4e41-1b50-08db3f46a205 x-ld-processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /CONaxC7kQkVVzOkF3vmoLJxYBviGpIjERM7gnnmMJKtz9RCWbcIDaYmo9tgXUyZI10QfLDSVT9R6MhUh6Lxxj8Galt3q5jnR3pPATLxiwQhAmNag87cQ5toRe8LgYLv4qJa5rAtYT95m0s8yjq+ZRzbVZ6iu5wJxSqMGtZjseHCOst/0lnwVAWHHSuYcL0n469crUz07YO/YsX2ukAkFOFH/BQ4Wfxu0EHusFuoV3It3aAHQNKuxuthR3PwGFNBIduELt6V+UMf82k7cHeZyOFAqlEMYh+b0u/znACKZN0YOzqFSdhyYLbMz4+vBUrQxDVP57R4rh294g9Bh7gVlzIi8Q8zglCM3w3r/OI8Z8KkJvrye74hfBptzpLa8QVBO9YjiAeRfpSE/Zqox+zBUTJFT4UJCJCa7XKR9AImPwt1UvuFU5xtq20leg6H2NJg379GhJanmXY9bf+Kh0Kr6Agn/fBWJpxEtXVB/I3Urw2q7YO3V9mjIhyGINJdW6nG/VxRpuWhdAqKTpd6cLDfgAH+2z5tq0I3V5evnuhMVpWEpNSbXxyJ7k6CKK2zoZnFWbW3npO18Vkwa0va2EwmAw68AoaWywvTQDa4KwPx2fuSnLWPgmvNeEkKcqZM+bhH x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8308.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(366004)(39860400002)(136003)(346002)(451199021)(33656002)(110136005)(54906003)(4326008)(316002)(76116006)(66556008)(66446008)(64756008)(66946007)(66476007)(71200400001)(478600001)(7696005)(55016003)(5660300002)(8936002)(8676002)(41300700001)(52536014)(2906002)(38070700005)(86362001)(122000001)(38100700002)(26005)(6506007)(9686003)(186003)(53546011)(83380400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hzUF/thpSc3aBP7DFQjf2Z7DwQV3C/Potaort+VTgbBieFzqnMLmMti3M0zi?= =?us-ascii?Q?QQrrC040beJcxwE4i40rcVGR4QMiA5XCJwpxY43XHWV9rEgCdOKPzMcFHFrN?= =?us-ascii?Q?qR/2RsExxWZv9pu0LpR+HNYFLcAXhaWevQTzEVW6YfDC8+CneHseV4XcPiOi?= =?us-ascii?Q?ZIr1jIjVa/nK/n8w41Yb2Hh2wGPM8jeMwvxXRCLm+rI9p8DyStbP/WvJTPcW?= =?us-ascii?Q?JF8+0+78jibZToayM+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K6?= =?us-ascii?Q?8kltlbft/B6kLwKCCjFQ7+DEi/gMqCr5HU8dZ4hAAEidE5YJMDYWuPdfnV+s?= =?us-ascii?Q?2yT99QGAtkM+ipCvHFxWqy6esGTu4mgjOZZtUOioa10vi6FEnW70mriMpxRJ?= =?us-ascii?Q?s3LN8NOjKSz6VrCFG7zMYtzLELAj6/v7OvhuIsoOGj1BngIrrvfdfE0cu8Gp?= =?us-ascii?Q?PiEHeGlhLw/or3/p8rwCY9ExJ4z1mUnz/mv88Rw0Em8IZFPBoDH9+gNg+ZqH?= =?us-ascii?Q?JpwrF4zO5kxEDyO9LsjMZ0fm36rAMo+6sQYm/m6piJsbFZoZdEu4aAH206kY?= =?us-ascii?Q?6oXqFKrAF5pXE/gfuV42EkclKArlnW00cb0Bx/fdxLeUiFDXktqHITXLgSdQ?= =?us-ascii?Q?cGziZB1/YnQV1242PxqRJyQva1qYEubETxn6ykSFIZyfW27v2etuv4Va4eo4?= =?us-ascii?Q?dQdcHoo2nvfdCwr21KU=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8308.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a80878-1301-4e41-1b50-08db3f46a205 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Apr 2023 13:21:20.1387 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vKpZaF8rlq6J1jV+aUExf9fT8YhJ7c+5bkMCF3CEFKNiQglYVdYGPnhJgphqxw5i X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8643 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,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 [AMD Official Use Only - General] > -----Original Message----- > From: Jason Gunthorpe > Sent: Monday, April 17, 2023 6:49 PM > To: Alex Williamson > Cc: Gupta, Nipun ; linux-kernel@vger.kernel.org; > kvm@vger.kernel.org; masahiroy@kernel.org; nathan@kernel.org; > ndesaulniers@google.com; nicolas@fjasle.eu; git (AMD-Xilinx) ; > Anand, Harpreet ; Jansen Van Vuuren, Pieter > ; Agarwal, Nikhil > ; Simek, Michal > Subject: Re: [PATCH v2] vfio/cdx: add support for CDX bus >=20 > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. >=20 >=20 > On Fri, Apr 14, 2023 at 03:36:14PM -0600, Alex Williamson wrote: >=20 > > > +static int vfio_cdx_init_device(struct vfio_device *core_vdev) > > > +{ > > > + struct vfio_cdx_device *vdev =3D > > > + container_of(core_vdev, struct vfio_cdx_device, vdev); > > > + struct cdx_device *cdx_dev =3D to_cdx_device(core_vdev->dev); > > > + > > > + vdev->cdx_dev =3D cdx_dev; > > > + vdev->dev =3D &cdx_dev->dev; > > > > Both of these seem trivial to factor out of this patch, cdx_device is > > always available via to_cdx_device(core_vdev->dev) and the struct > > device is always available via core_vdev->dev. vdev->dev isn't even > > used anywhere yet. Both the init and release functions here could be > > dropped afaict. >=20 > Yes please, I have a series someplace that gets rid of all these > redundent ->devs we keep around everwhere. >=20 > to_cdx_device(core_vdev->dev) is a good solution, maybe with a static > inline. Agree, we have already rolled out v3 which has this change i.e using to_cdx_dev(core_vdev->dev) instead of storing these again. Thanks, Nipun >=20 > Jason