Re: [PATCH v3] vpci: Add resizable bar support

2024-12-17 Thread Chen, Jiqian
On 2024/12/17 16:44, Jan Beulich wrote: > On 17.12.2024 09:22, Chen, Jiqian wrote: >> On 2024/12/16 19:24, Jan Beulich wrote: >>> On 13.12.2024 06:42, Jiqian Chen wrote: +static int cf_check init_rebar(struct pci_dev *pdev) +{ +uint32_t ctrl; +unsigned int rebar_offset,

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-17 Thread Jan Beulich
On 17.12.2024 09:20, Chen, Jiqian wrote: > On 2024/12/16 18:24, Roger Pau Monné wrote: >> On Fri, Dec 13, 2024 at 01:42:32PM +0800, Jiqian Chen wrote: >>> +if ( !is_hardware_domain(pdev->domain) ) >>> +{ >>> +printk("ReBar is not supported for domUs\n"); >> >> This needs a bit more

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-17 Thread Jan Beulich
On 17.12.2024 09:22, Chen, Jiqian wrote: > On 2024/12/16 19:24, Jan Beulich wrote: >> On 13.12.2024 06:42, Jiqian Chen wrote: >>> +static int cf_check init_rebar(struct pci_dev *pdev) >>> +{ >>> +uint32_t ctrl; >>> +unsigned int rebar_offset, nbars; >>> + >>> +rebar_offset = pci_find_ex

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-17 Thread Chen, Jiqian
On 2024/12/16 19:24, Jan Beulich wrote: > On 13.12.2024 06:42, Jiqian Chen wrote: >> --- /dev/null >> +++ b/xen/drivers/vpci/rebar.c >> @@ -0,0 +1,130 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> +/* >> + * Copyright (C) 2024 Advanced Micro Devices, Inc. All Rights Reserved. >> + * >> + *

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-17 Thread Chen, Jiqian
On 2024/12/16 18:24, Roger Pau Monné wrote: > On Fri, Dec 13, 2024 at 01:42:32PM +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. >>

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-16 Thread Jan Beulich
On 13.12.2024 06:42, Jiqian Chen wrote: > --- /dev/null > +++ b/xen/drivers/vpci/rebar.c > @@ -0,0 +1,130 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (C) 2024 Advanced Micro Devices, Inc. All Rights Reserved. > + * > + * Author: Jiqian Chen > + */ > + > +#include > +#i

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-16 Thread Roger Pau Monné
On Mon, Dec 16, 2024 at 11:30:22AM +0100, Jan Beulich wrote: > On 16.12.2024 11:24, Roger Pau Monné wrote: > > On Fri, Dec 13, 2024 at 01:42:32PM +0800, Jiqian Chen wrote: > >> +static int cf_check init_rebar(struct pci_dev *pdev) > >> +{ > >> +uint32_t ctrl; > >> +unsigned int rebar_offset

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-16 Thread Jan Beulich
On 16.12.2024 11:24, Roger Pau Monné wrote: > On Fri, Dec 13, 2024 at 01:42:32PM +0800, Jiqian Chen wrote: >> +static int cf_check init_rebar(struct pci_dev *pdev) >> +{ >> +uint32_t ctrl; >> +unsigned int rebar_offset, nbars; >> + >> +rebar_offset = pci_find_ext_capability(pdev->sbdf,

Re: [PATCH v3] vpci: Add resizable bar support

2024-12-16 Thread Roger Pau Monné
On Fri, Dec 13, 2024 at 01:42:32PM +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 supports

[PATCH v3] vpci: Add resizable bar support

2024-12-12 Thread Jiqian Chen
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 supports resizing has two registers, PCI_REBAR_CAP and PCI_REBAR_CTRL. So, add h