Re: [PATCH v2 11/11] gpu: nova-core: vbios: reject extra PCI-AT and FWSEC images

From: Eliot Courtney

Date: Thu Apr 16 2026 - 22:34:52 EST


On Wed Apr 15, 2026 at 9:02 AM JST, Joel Fernandes wrote:
>
>
>> On Apr 14, 2026, at 7:40 PM, Timur Tabi <ttabi@xxxxxxxxxx> wrote:
>>
>> On Tue, 2026-04-14 at 20:54 +0900, Eliot Courtney wrote:
>>> Currently, these are silently overwritten. Instead, error if they appear
>>> twice in the VBIOS.
>>
>> How do you know that there can only be one PCI-AT image or no more than 2 FWSEC images?
>
> Also, which GPU is this extra PCI-AT observed on? When I wrote all this code, it was on GA102 and there was only one PCI-AT and 2 FWSEC.

I think that it doesn't make sense for there to be more than one PCI-AT
image. I haven't observed any, it's just that the current code will
silently accept it. I think that we should explicitly define the
behaviour here - erroring seems the most conservative to me, but other
behaviours could be take the first or take the last.

This is more of a problem for FWSEC images, because the current code
will take the first image as `first_fwsec_image` and the last image as
`second_fwsec_image`, which means that if there are more than two, the
falcon data offset will actually point to the wrong thing, since the
code assumes that first and second fwsec image are contiguous for the
purposes of the offset pointer space.

AFAICT, nouveau and openrm take the first PCI-AT and FWSEC images, but
they use the first FWSEC image to adjust the offset and then just
address directly into the whole VBIOS based on that. To match that
behaviour I can update this this patch to change the nova behaviour to
match - i.e. take first two FWSEC and first PCI-AT, instead of the
current behaviour which is last PCI-AT and first+last FWSEC.

N.B. that the current code partially assumes that there are only two
FWSEC images because it requires the falcon data pointer to be in the
first or second one, and errors if it's after that.

WDYT?