[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221114114344.18650-27-jirislaby@kernel.org>
Date: Mon, 14 Nov 2022 12:43:24 +0100
From: "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Jiri Slaby <jslaby@...e.cz>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Martin Liska <mliska@...e.cz>
Subject: [PATCH 26/46] x86/apic, lto: Mark apic_driver*() as __noreorder
From: Jiri Slaby <jslaby@...e.cz>
The apic code assumes that the apic drivers are in a particular order in
memory. gcc LTO can violate this. So add __noreorder to apic_driver()
and apic_drivers() to avoid a boot BUG().
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Martin Liska <mliska@...e.cz>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
arch/x86/include/asm/apic.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 3415321c8240..9c5c69482ab0 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -363,12 +363,12 @@ extern struct apic *apic;
* to enforce the order with in them.
*/
#define apic_driver(sym) \
- static const struct apic *__apicdrivers_##sym __used \
+ static const struct apic *__apicdrivers_##sym __used __noreorder \
__aligned(sizeof(struct apic *)) \
__section(".apicdrivers") = { &sym }
#define apic_drivers(sym1, sym2) \
- static struct apic *__apicdrivers_##sym1##sym2[2] __used \
+ static struct apic *__apicdrivers_##sym1##sym2[2] __used __noreorder \
__aligned(sizeof(struct apic *)) \
__section(".apicdrivers") = { &sym1, &sym2 }
--
2.38.1
Powered by blists - more mailing lists