From nobody Fri Dec 19 17:50:24 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5CE3C43217 for ; Mon, 14 Nov 2022 11:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236442AbiKNLqv (ORCPT ); Mon, 14 Nov 2022 06:46:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236769AbiKNLqF (ORCPT ); Mon, 14 Nov 2022 06:46:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCD523179 for ; Mon, 14 Nov 2022 03:45:03 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 81933B80E77 for ; Mon, 14 Nov 2022 11:45:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3997EC433D6; Mon, 14 Nov 2022 11:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426301; bh=5FX1a1JgcDe4CO/FI8j/3+v36Volg7rloP622gTjs4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OA+g6g1OOecEy+y6VOPK3J54mGvMkQm2tYT6ZFbxX+0wGYJHWM01XYB/5x9ld9PVo ktQcoiU9YUeFjxsllBKPobxgacW1tr1IHrVPZsiXK8EjBpyZvTtFrjM5G5dCk4x8HZ nc88qy7GvW16gdXTeBP4dZuKahL4Kr5aCEgo/L/GJirF85Y7RtvE3uyW/YtCECZ8Lr 01J3///gSOype8s079CsWY2X0rJMO1TSSGscywo63cbm0Jp6GtaC+Qd5PHI4hW1A9Q 828gJx3mCuVbH1A/6dw/5GGVj3d6bol7osArPmK8EJ1BAdoJMqnpdJWjNVVer16h8v sFHNuPR0rd9Vw== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Jiri Slaby , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, Martin Liska Subject: [PATCH 26/46] x86/apic, lto: Mark apic_driver*() as __noreorder Date: Mon, 14 Nov 2022 12:43:24 +0100 Message-Id: <20221114114344.18650-27-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Jiri Slaby 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 Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Martin Liska Signed-off-by: Jiri Slaby --- 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") =3D { &sym } =20 #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") =3D { &sym1, &sym2 } =20 --=20 2.38.1