Re: [PATCH v10 08/13] PCI: Save and restore the ACS Control register and Egress Control Vector
From: David Matlack
Date: Tue Nov 17 2026 - 16:24:23 EST
On Mon Nov 16, 2026 at 5:10 PM PST, Alex Williamson wrote:
> On Tue, 13 Oct 2026 16:25:24 +0000
> David Matlack <dmatlack@xxxxxxxxxx> wrote:
>> +static void pci_allocate_acs_save_buffer(struct pci_dev *dev)
>> +{
>> + size_t size;
>> + int pos;
>> +
>
> Nit, moving the device specific enable test here:
>
> if (pci_need_dev_specific_enable_acs(dev))
> return;
>
> Would avoid:
>
> - Allocating a buffer that will never be restored
> - Saving ACS state to a buffer that will never be restored
> - Testing for the device specific enable at restore
>
> Otherwise,
>
> Reviewed-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
Thanks for the review.
I'll make this change as you described. Preserved devices will still
need the buffer even if they match a device-specific quirk (see my reply
on 09), so 09 will also allocate it for devices that were preserved by
the previous kernel. Since restore then just checks whether the buffer
exists, that is all it takes for preserved devices to keep their adopted
controls across a reset.