Re: [PATCH v6 1/6] PCI: Validate ACS enable flags against device-specific ACS capabilities

From: Jason Gunthorpe

Date: Mon Mar 30 2026 - 09:09:46 EST


On Thu, Mar 12, 2026 at 05:06:32PM +0800, Wei Wang wrote:
> The ACS flag validation used the kernel's full set of ACS control bits,
> which allowed users to request ACS features that the device does not
> support. These unsupported bits would be silently ignored by hardware.
> Validate the requested enable flags against dev->acs_capabilities so
> that only device-supported ACS bits are accepted. Accordingly, move the
> check after the device is matched, since the enable bits apply only to
> the matched device.
>
> Also change the validation to apply only to bits being enabled, since
> attempting to disable unsupported features does not cause functional
> issues.
>
> Finally, improve the error message to report which invalid bits were
> requested.
>
> Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxxxx>
> ---
> drivers/pci/pci.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason