[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] vpci: Add resizable bar support
On Mon, 18 Nov 2024, Roger Pau Monné wrote: > On Wed, Nov 13, 2024 at 04:00:27PM +0800, Jiqian Chen wrote: > > Some devices, like discrete GPU of amd, support resizable bar capability, > > but vpci of Xen doesn't support this feature, so they fail to resize bars > > and then cause probing failure. > > > > According to PCIe spec, each bar that support resizing has two registers, > > PCI_REBAR_CAP and PCI_REBAR_CTRL, so add these two registers and their > > corresponding handler into vpci. > > > > PCI_REBAR_CAP is RO, only provide reading. > > > > PCI_REBAR_CTRL only has bar size is RW, so add write function to support > > setting the new size. > > > > Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx> > > --- > > xen/drivers/vpci/Makefile | 2 +- > > xen/drivers/vpci/rebar.c | 89 ++++++++++++++++++++++++++++++++++++++ > > xen/include/xen/pci_regs.h | 11 +++++ > > 3 files changed, 101 insertions(+), 1 deletion(-) > > create mode 100644 xen/drivers/vpci/rebar.c > > > > diff --git a/xen/drivers/vpci/Makefile b/xen/drivers/vpci/Makefile > > index 1a1413b93e76..a7c8a30a8956 100644 > > --- a/xen/drivers/vpci/Makefile > > +++ b/xen/drivers/vpci/Makefile > > @@ -1,2 +1,2 @@ > > -obj-y += vpci.o header.o > > +obj-y += vpci.o header.o rebar.o > > obj-$(CONFIG_HAS_PCI_MSI) += msi.o msix.o > > diff --git a/xen/drivers/vpci/rebar.c b/xen/drivers/vpci/rebar.c > > new file mode 100644 > > index 000000000000..84dbd84b0745 > > --- /dev/null > > +++ b/xen/drivers/vpci/rebar.c > > @@ -0,0 +1,89 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > The GPL-2.0 identifier is deprecated, either use GPL-2.0-or-later or > GPL-2.0-only. GPL-2.0 is meant to be GPL-2.0-only
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |