Message ID | 20201012124506.3406909-1-philmd@redhat.com |
---|---|
Headers | show |
Series | hw: Use PCI macros from 'hw/pci/pci.h' | expand |
> -----Original Message----- > From: Philippe Mathieu-Daudé <philmd@redhat.com> > Sent: 12 October 2020 13:45 > To: qemu-devel@nongnu.org > Cc: Peter Maydell <peter.maydell@linaro.org>; qemu-ppc@nongnu.org; qemu-trivial@nongnu.org; Paul > Durrant <paul@xen.org>; Aurelien Jarno <aurelien@aurel32.net>; qemu-arm@nongnu.org; Philippe Mathieu- > Daudé <f4bug@amsat.org>; Michael S. Tsirkin <mst@redhat.com>; Eduardo Habkost <ehabkost@redhat.com>; > Jiaxun Yang <jiaxun.yang@flygoat.com>; Yoshinori Sato <ysato@users.sourceforge.jp>; Cédric Le Goater > <clg@kaod.org>; David Gibson <david@gibson.dropbear.id.au>; Stefano Stabellini > <sstabellini@kernel.org>; Helge Deller <deller@gmx.de>; Anthony Perard <anthony.perard@citrix.com>; > Richard Henderson <rth@twiddle.net>; Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>; xen- > devel@lists.xenproject.org; Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>; Marcel Apfelbaum > <marcel.apfelbaum@gmail.com>; Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>; Paolo Bonzini > <pbonzini@redhat.com>; Huacai Chen <chenhc@lemote.com> > Subject: [PATCH 4/5] hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' > > From: Philippe Mathieu-Daudé <f4bug@amsat.org> > > We already have a generic PCI_SLOT() macro in "hw/pci/pci.h" > to extract the PCI slot identifier, use it. > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> xen-hvm change... Acked-by: Paul Durrant <paul@xen.org>
On Mon, Oct 12, 2020 at 02:45:06PM +0200, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daudé <f4bug@amsat.org> > > We already have a generic PCI_DEVFN() macro in "hw/pci/pci.h" > to pack the PCI slot/function identifiers, use it. > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> ppc part Acked-by: David Gibson <david@gibson.dropbear.id.au> > --- > hw/arm/virt.c | 3 ++- > hw/pci-host/uninorth.c | 6 ++---- > 2 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index e465a988d68..f601ef0798c 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -1144,7 +1144,8 @@ static void create_pcie_irq_map(const VirtMachineState *vms, > full_irq_map, sizeof(full_irq_map)); > > qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupt-map-mask", > - 0x1800, 0, 0, /* devfn (PCI_SLOT(3)) */ > + cpu_to_be16(PCI_DEVFN(3, 0)), /* Slot 3 */ > + 0, 0, > 0x7 /* PCI irq */); > } > > diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c > index c21de0ab805..f73d452bdce 100644 > --- a/hw/pci-host/uninorth.c > +++ b/hw/pci-host/uninorth.c > @@ -70,10 +70,8 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr) > /* ... and then convert them to x86 format */ > /* config pointer */ > retval = (reg & (0xff - 7)) | (addr & 7); > - /* slot */ > - retval |= slot << 11; > - /* fn */ > - retval |= func << 8; > + /* slot, fn */ > + retval |= PCI_DEVFN(slot, func) << 8; > } > > trace_unin_get_config_reg(reg, addr, retval);
On 10/12/20 2:45 PM, Philippe Mathieu-Daudé wrote: > Trivial patches using the generic PCI macros from "hw/pci/pci.h". > > Philippe Mathieu-Daudé (5): > hw/pci-host/bonito: Make PCI_ADDR() macro more readable > hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h' > hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h' > hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' > hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h' As this series are trivial and Acked, I'm going to queue it via the mips-tree, as other reviewed patches depend on it. Thanks, Phil.
On Sun, Jan 03, 2021 at 02:04:53PM +0100, Philippe Mathieu-Daudé wrote: > On 10/12/20 2:45 PM, Philippe Mathieu-Daudé wrote: > > Trivial patches using the generic PCI macros from "hw/pci/pci.h". > > > > Philippe Mathieu-Daudé (5): > > hw/pci-host/bonito: Make PCI_ADDR() macro more readable > > hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h' > > hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h' > > hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' > > hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h' > > As this series are trivial and Acked, I'm going to queue > it via the mips-tree, as other reviewed patches depend > on it. > > Thanks, > > Phil. Fine. Acked-by: Michael S. Tsirkin <mst@redhat.com>