Re: [PATCH v2] x86/boot: Use EFI setup data if provided

From: Junichi Nomura
Date: Thu Mar 28 2019 - 23:24:47 EST


On 3/29/19 12:52 AM, Borislav Petkov wrote:
> static acpi_physical_address
> __efi_get_rsdp_addr(unsigned long config_tables, unsigned int nr_tables,
> int size, bool efi_64)
>
>
>> {
>> acpi_physical_address rsdp_addr = 0;
>
> You don't need that variable and can return "table" or 0 after the endif
> below.

I could do that but it will slightly change the current logic.

Existing code does this:

if (!(efi_guidcmp(guid, ACPI_TABLE_GUID)))
rsdp_addr = table;
else if (!(efi_guidcmp(guid, ACPI_20_TABLE_GUID)))
return table;

I thought it was to return the table for ACPI_20_TABLE_GUID
if both tables exist. If we remove rsdp_addr, the code will be:

if (!(efi_guidcmp(guid, ACPI_TABLE_GUID)))
return table;
else if (!(efi_guidcmp(guid, ACPI_20_TABLE_GUID)))
return table;

So if there are 2 tables, we return the one that comes first.
Is it ok?

--
Jun'ichi Nomura, NEC Corporation / NEC Solution Innovators, Ltd.