[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-23 Thread Gerd Hoffmann
> FWIW, given the low-level nature of these functions, it may be worth > using wrappers like the following: > > void pci_config_writel(u16 bdf, u32 addr, u32 val) > { > if (!MODESEGMENT && mmconfig) > pci_mmconfig_writel(bdf, addr, val); > else > pci_ioconfig_writel(bdf, ad

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-20 Thread Kevin O'Connor
On Fri, Mar 20, 2020 at 06:48:53AM +0100, Gerd Hoffmann wrote: > > > +static void *pci_mmconfig_addr(u16 bdf, u32 addr) > > > +{ > > > +if (!mmconfig) > > > +return NULL; > > > +return (void*)(mmconfig + ((u32)bdf << 12) + addr); > > > +} > > > + > > > void pci_config_writel(u16 bd

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Gerd Hoffmann
> > +static void *pci_mmconfig_addr(u16 bdf, u32 addr) > > +{ > > +if (!mmconfig) > > +return NULL; > > +return (void*)(mmconfig + ((u32)bdf << 12) + addr); > > +} > > + > > void pci_config_writel(u16 bdf, u32 addr, u32 val) > > { > > -outl(0x8000 | (bdf << 8) | (addr & 0x

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Kevin O'Connor
On Thu, Mar 19, 2020 at 10:21:55AM +0100, Gerd Hoffmann wrote: > Add support for pci config space access via mmconfig bar. Enable for > qemu q35 chipset. Main advantage is that we need only one instead of > two io operations per config space access, which translates to one > instead of two vmexit

[SeaBIOS] Re: [PATCH] pci: add mmconfig support

2020-03-19 Thread Stefan Hajnoczi
On Thu, Mar 19, 2020 at 10:21:55AM +0100, Gerd Hoffmann wrote: > Add support for pci config space access via mmconfig bar. Enable for > qemu q35 chipset. Main advantage is that we need only one instead of > two io operations per config space access, which translates to one > instead of two vmexit