Re: [RFC PATCH 1/2] x86/acpi: Improve code readablity of early madt processing

From: Borislav Petkov
Date: Mon Feb 24 2020 - 08:22:00 EST


On Thu, Jan 23, 2020 at 09:41:43AM +0800, Cao jin wrote:
> Current processing logic is confusing.
>
> Return value of early_acpi_parse_madt_lapic_addr_ovr() indicates error(< 0),
> parsed entry number(>= 0).

You mean, the count of table entries parsed successfully?

> So, it makes no sense to initialize acpi_lapic & smp_found_config
> seeing no override entry, instead, initialize them seeing MADT.

Err, that logical conclusion is not really clear to me - pls try
again with more detail. I kinda see what you mean by looking at
acpi_process_madt() but before I commit a change like that, I better
have the warm and fuzzy feeling that it is correct and properly
explained in its commit message.

So why did

cbf9bd603ab1 ("acpi: get boot_cpu_id as early for k8_scan_nodes")

do it this way? Was it wrong or why?

I'm very wary about touching ACPI parsing code for no good reason
because, well, it is ACPI...

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette