2024-03-22 18:58:28

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 4/4] x86/mpparse: Register APIC address only once

The APIC address is registered twice. First during the early detection and
afterwards when actually scanning the table for APIC IDs. The APIC and
topology core warn about the second attempt.

Restrict it to the early detection call.

Fixes: 81287ad65da5 ("x86/apic: Sanitize APIC address setup")
Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/x86/kernel/mpparse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -197,12 +197,12 @@ static int __init smp_read_mpc(struct mp
if (!smp_check_mpc(mpc, oem, str))
return 0;

- /* Initialize the lapic mapping */
- if (!acpi_lapic)
- register_lapic_address(mpc->lapic);
-
- if (early)
+ if (early) {
+ /* Initialize the lapic mapping */
+ if (!acpi_lapic)
+ register_lapic_address(mpc->lapic);
return 1;
+ }

/* Now process the configuration blocks. */
while (count < mpc->length) {



2024-03-22 21:48:39

by Guenter Roeck

[permalink] [raw]
Subject: Re: [patch 4/4] x86/mpparse: Register APIC address only once

On Fri, Mar 22, 2024 at 07:56:39PM +0100, Thomas Gleixner wrote:
> The APIC address is registered twice. First during the early detection and
> afterwards when actually scanning the table for APIC IDs. The APIC and
> topology core warn about the second attempt.
>
> Restrict it to the early detection call.
>
> Fixes: 81287ad65da5 ("x86/apic: Sanitize APIC address setup")
> Signed-off-by: Thomas Gleixner <[email protected]>

Tested-by: Guenter Roeck <[email protected]>

Guenter

Subject: [tip: x86/urgent] x86/mpparse: Register APIC address only once

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: f2208aa12c27bfada3c15c550c03ca81d42dcac2
Gitweb: https://git.kernel.org/tip/f2208aa12c27bfada3c15c550c03ca81d42dcac2
Author: Thomas Gleixner <[email protected]>
AuthorDate: Fri, 22 Mar 2024 19:56:39 +01:00
Committer: Borislav Petkov (AMD) <[email protected]>
CommitterDate: Sat, 23 Mar 2024 12:41:48 +01:00

x86/mpparse: Register APIC address only once

The APIC address is registered twice. First during the early detection and
afterwards when actually scanning the table for APIC IDs. The APIC and
topology core warn about the second attempt.

Restrict it to the early detection call.

Fixes: 81287ad65da5 ("x86/apic: Sanitize APIC address setup")
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/kernel/mpparse.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 1ccd30c..e89171b 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -197,12 +197,12 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
if (!smp_check_mpc(mpc, oem, str))
return 0;

- /* Initialize the lapic mapping */
- if (!acpi_lapic)
- register_lapic_address(mpc->lapic);
-
- if (early)
+ if (early) {
+ /* Initialize the lapic mapping */
+ if (!acpi_lapic)
+ register_lapic_address(mpc->lapic);
return 1;
+ }

/* Now process the configuration blocks. */
while (count < mpc->length) {