Received: by 10.223.185.116 with SMTP id b49csp1027179wrg; Wed, 14 Feb 2018 10:26:38 -0800 (PST) X-Google-Smtp-Source: AH8x226FKHSgX6Mg706S5iIT9n20M/9CrAAd15yYuKPTMrWLwsjLXqQrOozzGYn2GhzO7dtvVFoR X-Received: by 10.98.71.217 with SMTP id p86mr105101pfi.81.1518632798706; Wed, 14 Feb 2018 10:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518632798; cv=none; d=google.com; s=arc-20160816; b=Ehi0WcI4sv6aLLafZqM96IxbVfP888v2QO/ctxvTItF2lJWjjCsyYpxXt5/A42WDr/ fLafGvuG3Xk6s6gUYhJmNHUMhk+n9d2vmoQJmc5Ls6E9N3zQbfVhE6O8iTuodi0+UZx4 K4UIhbyLbjojBmWSW1X9GsTB5Egon5gGhOthEgWFwgGzOwcCZx01OC5JH9ECOqFUWj9j YPEpbAKi65Bdv8L0ULRTMDAeQFMNbyUFE3ED5PJBvG8wCxRa5z3yEqsoXotcftUV2CAh UcmJw4z+hCzgKBTAC0e4pBYJJnHucS2PJ3V99Yl2AQBTK0kDmk4xdQuv1Nsqdu8Ia6cI zYPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Jciio8L/ku1NkNs7lKpQ5LsGxGEohfUG3n1nFhKS+A8=; b=HMzfj2c8mnpLQUkiZJTzciNL0lrHwB2QQ4BhBX1SVh5+fB1Q0oyq6B0mG5m/4txnz5 ANK1MueSH/u9LoO5BOTdLsBgqTSGd4jfIeOtx6aiHCznIguRM7ULcYDYN9uvMsM/Lh/P lxYqHOFimM0txsL/V6XQdDV0Wy1GBnYd8mV6AkUvmugQ4gP9KxkHHuOvr4wBdNAzc67h pp0OyqOcoptXBZUsR/ey+R6HheNE9VujDn9koJa4DziKrQQlnc5s1Fc1MVNLqT7zi6jT XTjn+cknc9yo/jjmDkgOdkXyTBhieiyt2iurQGIhMis5PmRQcdvkoGEqC6x8iMSPgyOE He3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si5517983pfp.91.2018.02.14.10.26.24; Wed, 14 Feb 2018 10:26:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161955AbeBNSYC (ORCPT + 99 others); Wed, 14 Feb 2018 13:24:02 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:48106 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161820AbeBNSWe (ORCPT ); Wed, 14 Feb 2018 13:22:34 -0500 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id 84E32200906; Wed, 14 Feb 2018 18:22:33 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id A422520648; Wed, 14 Feb 2018 19:22:12 +0100 (CET) From: Dominik Brodowski To: linux-kernel@vger.kernel.org, mingo@kernel.org, x86@kernel.org Cc: torvalds@linux-foundation.org, luto@kernel.org, ak@linux.intel.com, tglx@linutronix.de, dan.j.williams@intel.com Subject: [RFC PATCH 1/4] x86/entry/64: move PUSH_AND_CLEAR_REGS from interrupt macro to helper function Date: Wed, 14 Feb 2018 19:21:10 +0100 Message-Id: <20180214182113.27247-2-linux@dominikbrodowski.net> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180214182113.27247-1-linux@dominikbrodowski.net> References: <20180214182113.27247-1-linux@dominikbrodowski.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PUSH_AND_CLEAR_REGS macro is able to insert the GP registers "above" the original return address. This allows us to move a sizeable part of the interrupt entry macro to an interrupt entry helper function: text data bss dec hex filename 20987 0 0 20987 51fb entry_64.o-orig 17905 0 0 17905 45f1 entry_64.o Suggested-by: Linus Torvalds Signed-off-by: Dominik Brodowski --- arch/x86/entry/entry_64.S | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 5d9cb0f037e4..de8a0da0d347 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -526,6 +526,15 @@ END(irq_entries_start) * * Entry runs with interrupts off. */ +ENTRY(interrupt_helper) + UNWIND_HINT_FUNC + cld + + PUSH_AND_CLEAR_REGS save_ret=1 + ENCODE_FRAME_POINTER 8 + + ret +END(interrupt_helper) /* 0(%rsp): ~(interrupt number) */ .macro interrupt func @@ -537,8 +546,7 @@ END(irq_entries_start) call switch_to_thread_stack 1: - PUSH_AND_CLEAR_REGS - ENCODE_FRAME_POINTER + call interrupt_helper testb $3, CS(%rsp) jz 1f -- 2.16.1