From patchwork Tue Mar 24 00:13:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11454309 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C2C4174A for ; Tue, 24 Mar 2020 00:16:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E1862076F for ; Tue, 24 Mar 2020 00:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585008960; bh=Moxbntf9zF9rD6ma6/dXPCASl6yeSokO1k3lwybee9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=m5oOW4Ml5glNr15/zW9BN57ugh40MEuDmJrE5hhPYoRVKo0/zSh9i2cL7w32IEbw5 srl0InrZLwUFkFjGg244KlkC5/+rNnVAXa/WGnvL+1L+wIaFm9Dnt94XOQyx/uFZkZ u0AIHxlmCy9OcH4IGQcTMLoyenvW/X5sNyFpfjJQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727600AbgCXAP4 (ORCPT ); Mon, 23 Mar 2020 20:15:56 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:29779 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbgCXAPv (ORCPT ); Mon, 23 Mar 2020 20:15:51 -0400 Received: from grover.flets-west.jp (softbank126093102113.bbtec.net [126.93.102.113]) (authenticated) by conuserg-09.nifty.com with ESMTP id 02O0EHnq026701; Tue, 24 Mar 2020 09:14:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 02O0EHnq026701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585008861; bh=ObDKJrIo7JgfvIu0G1FSnalphKgwEZNqB/X4AcOMirk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nFo+E7c4XCHmTH87evd8pAgWpgmiYB2JqXqNB6atF4qa3TIx4l8nXZf3v7TCH/7HA VBqaup22kWK4ezgyUxkzcusu1EbFH8FqcQOYT+IMK8HfLXeSrSQ+ELEY+ShLac1+oA 0lUo7WlJJd2rmShpXXdGwNTvK1UgNgZhcAXdOUoGT4l7pS7q+CxiXTTFTh54JMk46a MbOS5p0jRnzbFrEXCVyleWTfaY4FhEddcg4TY51A11NFtKLh1yvfMey7hZ5E5u6orG D+GMno+4rP+RoY1NaMj3ZKWA8LeMQesKGz76rfxoFnCNgEXSSe2iwtsOamgr/1stvX mWu0ysWfpxFgQ== X-Nifty-SrcIP: [126.93.102.113] From: Masahiro Yamada To: x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Masahiro Yamada , Ingo Molnar , clang-built-linux@googlegroups.com Subject: [PATCH v2 3/9] x86: remove always-defined CONFIG_AS_CFI Date: Tue, 24 Mar 2020 09:13:52 +0900 Message-Id: <20200324001358.4520-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org> References: <20200324001358.4520-1-masahiroy@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org CONFIG_AS_CFI was introduced by commit e2414910f212 ("[PATCH] x86: Detect CFI support in the assembler at runtime"), and extended by commit f0f12d85af85 ("x86_64: Check for .cfi_rel_offset in CFI probe"). We raise the minimal supported binutils version from time to time. The last bump was commit 1fb12b35e5ff ("kbuild: Raise the minimum required binutils version to 2.21"). I confirmed the code in $(call as-instr,...) can be assembled by the binutils 2.21 assembler and also by LLVM integrated assembler. Remove CONFIG_AS_CFI, which is always defined. Signed-off-by: Masahiro Yamada Acked-by: Jason A. Donenfeld Reviewed-by: Nick Desaulniers --- If this series is applied, I can hard-code the assembler code, and delete CFI_* macros entirely. Changes in v2: None arch/x86/Makefile | 10 ++-------- arch/x86/include/asm/dwarf2.h | 36 ----------------------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 513a55562d75..72f8f744ebd7 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -177,12 +177,6 @@ ifeq ($(ACCUMULATE_OUTGOING_ARGS), 1) KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args,) endif -# Stackpointer is addressed different for 32 bit and 64 bit x86 -sp-$(CONFIG_X86_32) := esp -sp-$(CONFIG_X86_64) := rsp - -# do binutils support CFI? -cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_endproc,-DCONFIG_AS_CFI=1) # is .cfi_signal_frame supported too? cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1) cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1) @@ -196,8 +190,8 @@ sha1_ni_instr :=$(call as-instr,sha1msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA1_NI= sha256_ni_instr :=$(call as-instr,sha256msg1 %xmm0$(comma)%xmm1,-DCONFIG_AS_SHA256_NI=1) adx_instr := $(call as-instr,adox %r10$(comma)%r10,-DCONFIG_AS_ADX=1) -KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) -KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_AFLAGS += $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) +KBUILD_CFLAGS += $(cfi-sigframe) $(cfi-sections) $(asinstr) $(avx_instr) $(avx2_instr) $(avx512_instr) $(sha1_ni_instr) $(sha256_ni_instr) $(adx_instr) KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index 5a0502212bc5..90807583cad7 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -6,15 +6,6 @@ #warning "asm/dwarf2.h should be only included in pure assembly files" #endif -/* - * Macros for dwarf2 CFI unwind table entries. - * See "as.info" for details on these pseudo ops. Unfortunately - * they are only supported in very new binutils, so define them - * away for older version. - */ - -#ifdef CONFIG_AS_CFI - #define CFI_STARTPROC .cfi_startproc #define CFI_ENDPROC .cfi_endproc #define CFI_DEF_CFA .cfi_def_cfa @@ -55,31 +46,4 @@ #endif #endif -#else - -/* - * Due to the structure of pre-exisiting code, don't use assembler line - * comment character # to ignore the arguments. Instead, use a dummy macro. - */ -.macro cfi_ignore a=0, b=0, c=0, d=0 -.endm - -#define CFI_STARTPROC cfi_ignore -#define CFI_ENDPROC cfi_ignore -#define CFI_DEF_CFA cfi_ignore -#define CFI_DEF_CFA_REGISTER cfi_ignore -#define CFI_DEF_CFA_OFFSET cfi_ignore -#define CFI_ADJUST_CFA_OFFSET cfi_ignore -#define CFI_OFFSET cfi_ignore -#define CFI_REL_OFFSET cfi_ignore -#define CFI_REGISTER cfi_ignore -#define CFI_RESTORE cfi_ignore -#define CFI_REMEMBER_STATE cfi_ignore -#define CFI_RESTORE_STATE cfi_ignore -#define CFI_UNDEFINED cfi_ignore -#define CFI_ESCAPE cfi_ignore -#define CFI_SIGNAL_FRAME cfi_ignore - -#endif - #endif /* _ASM_X86_DWARF2_H */