From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966290AbcKLBZj (ORCPT ); Fri, 11 Nov 2016 20:25:39 -0500 Received: from smtpbg65.qq.com ([103.7.28.233]:18667 "EHLO smtpbg65.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933992AbcKLBZi (ORCPT ); Fri, 11 Nov 2016 20:25:38 -0500 X-QQ-FEAT: 30gyyBsY25dnxurzXqq5fnZvRbjV87Xo0ZjRjfD5MzZ4icLf5r3JgC8OeKS9c 1u1ww2Lx8r7XbQwNclh2OHH0wCqj4iITIiIyMemiMZ5dZ7ccB0GwRaNePjcVcVL1U2/jZjL ek9wzY+xp7P+DRqLdb3DfZrI0MaGDXzGH/zmTS5geUGOIArrzmOlBejWJLLjSHaMcQU/kr1 yYIKbYM8AAYBeAjW8NpMZYfsXFq59pReFeqS/WXGa1hdCd5ZtNcP5fotMvvUhaZY7Lzkq6a gS1Z2eOSsIRDI0 X-QQ-SSF: 00000000000000F0000000000000000 X-HAS-ATTACH: no X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 114.240.137.204 In-Reply-To: <20161111205119.GB9868@bhelgaas-glaptop.roam.corp.google.com> References: <1474506346-20873-1-git-send-email-shhuiw@foxmail.com> <20161111205119.GB9868@bhelgaas-glaptop.roam.corp.google.com> X-QQ-STYLE: X-QQ-mid: webmail303t1478913925t686485 From: "=?ISO-8859-1?B?V2FuZyBTaGVuZy1IdWk=?=" To: "=?ISO-8859-1?B?Qmpvcm4gSGVsZ2Fhcw==?=" Cc: "=?ISO-8859-1?B?eXUuemhhbw==?=" , "=?ISO-8859-1?B?amJhcm5lcw==?=" , "=?ISO-8859-1?B?YWxleC53aWxsaWFtc29u?=" , "=?ISO-8859-1?B?YmhlbGdhYXM=?=" , "=?ISO-8859-1?B?bGludXgtcGNp?=" , "=?ISO-8859-1?B?a3Zt?=" , "=?ISO-8859-1?B?bGludXgta2VybmVs?=" Subject: Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 12 Nov 2016 09:25:25 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-QQ-ReplyHash: 32966738 X-QQ-SENDSIZE: 520 Feedback-ID: webmail:foxmail.com:bgforeign:bgforeign1 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uAC1PiMl000779 Thanks! Regards, Wang Sheng-Hui ------------------ Original ------------------ From: "Bjorn Helgaas";; Date: Sat, Nov 12, 2016 04:51 AM To: "Wang Sheng-Hui"; Cc: "yu.zhao"; "jbarnes"; "alex.williamson"; "bhelgaas"; "linux-pci"; "kvm"; "linux-kernel"; Subject: Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h On Thu, Sep 22, 2016 at 09:05:46AM +0800, Wang Sheng-Hui wrote: > This is a cleanup that moves PCI configuration space size > macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from > drivers/pci/pci.h to include/uapi/linux/pci_regs.h > > So that the macros can be used by more drivers and eliminate > potential duplicate definition. > > Signed-off-by: Wang Sheng-Hui Applied to pci/misc for v4.10, thanks! I updated the comment to include PCI-X details, since the extended config space applies to PCI-X Mode 2 devices as well as to PCIe devices: + * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of + * configuration space. PCI-X Mode 2 and PCIe devices have 4096 bytes of + * configuration space. > --- > drivers/pci/pci.h | 3 --- > drivers/vfio/pci/vfio_pci_config.c | 2 -- > include/uapi/linux/pci_regs.h | 7 +++++++ > 3 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index 9730c47..12d651a 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -1,9 +1,6 @@ > #ifndef DRIVERS_PCI_H > #define DRIVERS_PCI_H > > -#define PCI_CFG_SPACE_SIZE 256 > -#define PCI_CFG_SPACE_EXP_SIZE 4096 > - > #define PCI_FIND_CAP_TTL 48 > > extern const unsigned char pcie_link_speed[]; > diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c > index 688691d..8dc8a5a 100644 > --- a/drivers/vfio/pci/vfio_pci_config.c > +++ b/drivers/vfio/pci/vfio_pci_config.c > @@ -31,8 +31,6 @@ > > #include "vfio_pci_private.h" > > -#define PCI_CFG_SPACE_SIZE 256 > - > /* Fake capability ID for standard config space */ > #define PCI_CAP_ID_BASIC 0 > > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > index 4040951..a07c53c 100644 > --- a/include/uapi/linux/pci_regs.h > +++ b/include/uapi/linux/pci_regs.h > @@ -23,6 +23,13 @@ > #define LINUX_PCI_REGS_H > > /* > + * Under PCI, each device has 256 bytes of configuration address space. > + * Under PCIe, each device has 4096 bytes of configuration address space. > + */ > +#define PCI_CFG_SPACE_SIZE 256 > +#define PCI_CFG_SPACE_EXP_SIZE 4096 > + > +/* > * Under PCI, each device has 256 bytes of configuration address space, > * of which the first 64 bytes are standardized as follows: > */ > -- > 2.7.4 > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html