> 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
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
> > +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
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
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