From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0438BC433E6 for ; Thu, 11 Feb 2021 00:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA41864DD1 for ; Thu, 11 Feb 2021 00:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbhBKAwd (ORCPT ); Wed, 10 Feb 2021 19:52:33 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35526 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhBKAvJ (ORCPT ); Wed, 10 Feb 2021 19:51:09 -0500 Date: Thu, 11 Feb 2021 00:50:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1613004626; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2XVOHnUUrTxPAaH3KOwdh/vGwIiTcz9Kgj265LbFboA=; b=Exrc3H/QCYCNtIcy3nZFqSm85vwS/fApPPrHE7ZYgozrv/B5tgX9DLN6Q2aoPeAatxFTAo QPwHer5qHl8EQNJ339rC7HQT23z2pVMezaNvg66aPXzkJEf1njzgeqQdq3DGxdvUGXmOhl AcUzusv4NbKO6loTk/LO6j0BfpkLi3RIxgrQ8orsRrU2basiwv+tLSTEiw1/XKNosmqkWw jxaVSUTi0cfO4xcVUkfZcSS4jFFeMtFA9qEE39Zedu2OQgSNeL7aqZfDV91uH/lxxMnErE vGpg16ZAb5Ujb5npSYkwxSzMt/I19giM3SRep3m9tceDKQs/pgJx1yMfTba+tg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1613004626; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2XVOHnUUrTxPAaH3KOwdh/vGwIiTcz9Kgj265LbFboA=; b=ejuFf95yUcHPaSgMXcGzZUbBE5RuYrQ3YpLQSIx+B3m3BSfYBmE1SQJdBsQ7j0JZICFc95 DwO6MxzZfzWjefDQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/entry] x86/apic: Split out spurious handling code Cc: Thomas Gleixner , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210210002512.469379641@linutronix.de> References: <20210210002512.469379641@linutronix.de> MIME-Version: 1.0 Message-ID: <161300462610.23325.8050669891207216296.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/entry branch of tip: Commit-ID: 3c5e0267ec3e6ed7d3f1793273cbf0beb4f86a74 Gitweb: https://git.kernel.org/tip/3c5e0267ec3e6ed7d3f1793273cbf0beb4f86a74 Author: Thomas Gleixner AuthorDate: Wed, 10 Feb 2021 00:40:45 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 10 Feb 2021 23:34:14 +01:00 x86/apic: Split out spurious handling code sysvec_spurious_apic_interrupt() calls into the handling body of __spurious_interrupt() which is not obvious as that function is declared inside the DEFINE_IDTENTRY_IRQ(spurious_interrupt) macro. As __spurious_interrupt() is currently always inlined this ends up with two copies of the same code for no reason. Split the handling function out and invoke it from both entry points. Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20210210002512.469379641@linutronix.de --- arch/x86/kernel/apic/apic.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 6bd20c0..02956c0 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2133,18 +2133,11 @@ void __init register_lapic_address(unsigned long address) * Local APIC interrupts */ -/** - * spurious_interrupt - Catch all for interrupts raised on unused vectors - * @regs: Pointer to pt_regs on stack - * @vector: The vector number - * - * This is invoked from ASM entry code to catch all interrupts which - * trigger on an entry which is routed to the common_spurious idtentry - * point. - * - * Also called from sysvec_spurious_apic_interrupt(). +/* + * Common handling code for spurious_interrupt and spurious_vector entry + * points below. No point in allowing the compiler to inline it twice. */ -DEFINE_IDTENTRY_IRQ(spurious_interrupt) +static noinline void handle_spurious_interrupt(u8 vector) { u32 v; @@ -2179,9 +2172,23 @@ out: trace_spurious_apic_exit(vector); } +/** + * spurious_interrupt - Catch all for interrupts raised on unused vectors + * @regs: Pointer to pt_regs on stack + * @vector: The vector number + * + * This is invoked from ASM entry code to catch all interrupts which + * trigger on an entry which is routed to the common_spurious idtentry + * point. + */ +DEFINE_IDTENTRY_IRQ(spurious_interrupt) +{ + handle_spurious_interrupt(vector); +} + DEFINE_IDTENTRY_SYSVEC(sysvec_spurious_apic_interrupt) { - __spurious_interrupt(regs, SPURIOUS_APIC_VECTOR); + handle_spurious_interrupt(SPURIOUS_APIC_VECTOR); } /*