Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4823168rdb; Fri, 15 Sep 2023 13:28:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8Z0T7H+wOz+kY+hxpuu5UeUdhWeF23L2dTg+H2NfoklTDdxQa/klHxJVnpVrcZW4ju+fC X-Received: by 2002:a05:6a21:3282:b0:14c:e527:fab9 with SMTP id yt2-20020a056a21328200b0014ce527fab9mr3471736pzb.19.1694809724774; Fri, 15 Sep 2023 13:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694809724; cv=none; d=google.com; s=arc-20160816; b=Nzn5mi6s+TGQkCsBm4H2VgSYqffyDB0BmI0VShednyBw79VxrXfw2r6fEPnt9iTCm/ nVETrXWuE+AuvcZklpuOmEEKg7+wF9OcODu1BuH7rqguqzyJ9NEgmnGITjXLychSwKtc c4m0UiO90TrXSrg1PwpxvcB1W7ijcpCt7VUAZKR5MnqJsDHP0VhafweVQr27XE8ThpJC zGutA13pTQYU2XGBZWSxRVzgDMSK6xmu3MLF4nq5JD2ddPH1e6Gc+V6AEnQ//QcUhJLx zfHNqZH8CvjUpxmsAdm18CEnNgSlEnQV0zdF+WmxT5aDDSQSSxmi2UCEdFpD/0NOSH1w sWdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Ghzt0gMUW66V7NRyUGXJr6A3y8erfYE/z3VgzfOC+I0=; fh=rFLHJ70t4mfI1qQqEYVLmqFZLTlriBopqZgU3zeqtyQ=; b=F4x9so8u1TRMQd39R3QSohqpldC+Xk90Y4TLeEaN3DrwSp2uVcurph695AivrKvaVK XOC64KM/hubUOgbZqcOMaDV+fI2zd8NYClQImxoVfZ5i2bd2p1rvyHofBijnDNkD2Wrd rlmaXlHPzbh0rGWTntO5qQGC6KTNoo1kEk9yA0npDf3GGcBr9yhu5VYFBle/Jh7HkvBu nGcSvZnl4WsZPDudaTBSu0LWft4Q1xQehtFvMhxqY1Of1ORPg51RFT2Py+qPv1qKMSeW 7AVPcAkOBS4dDbZEHa2rWB3DEelFAT0ujWJHX6z7TCjCh4MtbBKNZs5/OFei+jXU5svp 9mng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C7+hsTRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id s128-20020a637786000000b0057828b85afdsi1240742pgc.795.2023.09.15.13.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 13:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C7+hsTRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1F86F80972B5; Fri, 15 Sep 2023 12:00:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236856AbjIOTAS (ORCPT + 99 others); Fri, 15 Sep 2023 15:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236823AbjIOS7w (ORCPT ); Fri, 15 Sep 2023 14:59:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7F5D106 for ; Fri, 15 Sep 2023 11:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694804341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ghzt0gMUW66V7NRyUGXJr6A3y8erfYE/z3VgzfOC+I0=; b=C7+hsTRCKZKzJFP7og6zFqkkCxVUrxi1zvFE/odTGGpnOSXDNcw2o1T0xabConRxmxZQCJ ejzVJ3u1+6AjWacjS24FfyyAUF+IJRuOgdkqn3E6nIt62Vc1TbBB3K2KqFlFZcnakJ2YJ8 Rab6xI2qh3SZcjaAzwN2I3rYveNg+h0= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-7PqY9IbOP9mVttjBgF8OOA-1; Fri, 15 Sep 2023 14:59:00 -0400 X-MC-Unique: 7PqY9IbOP9mVttjBgF8OOA-1 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-7983537d6c1so216450239f.3 for ; Fri, 15 Sep 2023 11:59:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694804339; x=1695409139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ghzt0gMUW66V7NRyUGXJr6A3y8erfYE/z3VgzfOC+I0=; b=uUJOzfIMv3uT9AK+cDB3lH1zAQLophn3n6Lv2cIFdRVvsFWviaEhUlfFMkFgicRUAc IA9Gz1gfxF/9n1NMlhEbXL2sfparHaDRqn8wEMWsf7RsBVGoh5RnBtDJPB6oDYWdB68r O3WjMKYbDzkSsbarnAPBozSV+OH39L6Fw+NnQv2h2MlXdqLtaqBDSe7qRynw/3NJEE2w zN6SL0JbH13/pEgUJJa5PmyI/9ohqCorEPuZyXWLtvK4orcL8ElcaFjDWZtV+BLprh3i 1EuJkrc82GGTj9FVYArbFiURQ5y35uE6NBeW/ZjNeIYa7az5fjOElqrUg3+w0liV1KIA s2Tg== X-Gm-Message-State: AOJu0Yzm79WnIgWdZqW62ynVstj78UL+vDKgJG3PAfbJhOKl+47/ToNN hlbb4QVMI44vFTpwa41aWnxazBLYwqlOQ6wEKIdePoOVag1T7kMetyLnT9BVF5WdG76ZCwkxCW7 UOBdClpK03h7iO6ZR2IFFs1kP X-Received: by 2002:a92:6e11:0:b0:348:f4c1:4817 with SMTP id j17-20020a926e11000000b00348f4c14817mr2860638ilc.6.1694804339642; Fri, 15 Sep 2023 11:58:59 -0700 (PDT) X-Received: by 2002:a92:6e11:0:b0:348:f4c1:4817 with SMTP id j17-20020a926e11000000b00348f4c14817mr2860624ilc.6.1694804339412; Fri, 15 Sep 2023 11:58:59 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id l12-20020a056e020dcc00b0034f3220c086sm500944ilj.12.2023.09.15.11.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 11:58:58 -0700 (PDT) Date: Fri, 15 Sep 2023 12:58:58 -0600 From: Alex Williamson To: oushixiong Cc: Jason Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Brett Creeley , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio/pds: Use proper PF device access helper Message-ID: <20230915125858.72b75a16.alex.williamson@redhat.com> In-Reply-To: <20230914021332.1929155-1-oushixiong@kylinos.cn> References: <20230914021332.1929155-1-oushixiong@kylinos.cn> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 12:00:50 -0700 (PDT) On Thu, 14 Sep 2023 10:13:32 +0800 oushixiong wrote: > From: Shixiong Ou > > The pci_physfn() helper exists to support cases where the physfn > field may not be compiled into the pci_dev structure. We've > declared this driver dependent on PCI_IOV to avoid this problem, > but regardless we should follow the precedent not to access this > field directly. > > Signed-off-by: Shixiong Ou > --- > > This patch changes the subject line and commit log, and the previous > patch's links is: > https://patchwork.kernel.org/project/kvm/patch/20230911080828.635184-1-oushixiong@kylinos.cn/ Kevin & Jason, I assume your R-b's apply to this version as well. Thanks, Alex > > drivers/vfio/pci/pds/vfio_dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c > index b46174f5eb09..649b18ee394b 100644 > --- a/drivers/vfio/pci/pds/vfio_dev.c > +++ b/drivers/vfio/pci/pds/vfio_dev.c > @@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev) > pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn); > dev_dbg(&pdev->dev, > "%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n", > - __func__, pci_dev_id(pdev->physfn), pci_id, vf_id, > + __func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id, > pci_domain_nr(pdev->bus), pds_vfio); > > return 0;