From patchwork Mon Dec 17 16:03:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154009 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2636494ljp; Mon, 17 Dec 2018 08:08:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/VOXQlGN1I9Q9+59jIhebToPyFf9bpSohmaLohu+mW/h8pejmwR5xfar4eIOOxZBm7UwOis X-Received: by 2002:a63:d005:: with SMTP id z5mr12679531pgf.64.1545062890998; Mon, 17 Dec 2018 08:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545062890; cv=none; d=google.com; s=arc-20160816; b=DBn+cN2pcX4XG2hsFhT3uCLQPSa68yETnz5wi0Sn919lUdNxwFvuScGqce63PXtVNl EfKqIExduP6+Q+1vG9iry6vlvn/SyR2MdV6FW7Xu4kipJzVSpm48pSQtIPyZVSkwwK/J ajMVdc0CeQEBC4xs3vc7K6/rlZQKTNhPPyG+jVqh3DM2eHEVCYwRfvvfw1IZ4lYLX55X KbANbQZy6yoMroRS04f3RcXZVpC8gtoq+8egg2VO7IJU2S8tnaQloHt7JvYGLhj8NMj3 32+d1FouBRjhqzNnPTt7Iv0jMqFfazV0Vo/W4MtslV6dB4CTNLiMmV1SbMKcfBUywYmU /EuA== 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:dkim-signature:dkim-filter; bh=YEFM37VoP8iq6zt/Sfo/eyMOxoBwqOHgn1OHsnq/Cpg=; b=Yv+WUBJC3XBxxjq+saQUKBqKkzs1hSu8yQSyes++GZsHTiqoJIsMuP/ck93sDw5xIh z5Ug/x4b1FipXYe2xFcTQ+E2qO5VJR+8OVjxhGvx+OH27jCSs0QvilKjUxtn5sPo6Xzv lRZwIXGBn72dq5HUa+PwK7I12bY9VBMG38JtX0h9jlWu0fuoFqYOQMVpy1bW/fLwyWmr vN/9uzHfmwQVpUyRCxGgyBsD20l1RItmoxUjEKB5IALA5uh9KOUBKIASRz2MF9YI0IAy ABJuRHfmo0KU1hijZZvFwxYcDCZOp7YfeJPX9Y/I9VMiHYLV5SY4VMKyPE7cyowjIfDt tVFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SZyRKTc2; 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 e22si11257229pge.479.2018.12.17.08.08.10; Mon, 17 Dec 2018 08:08:10 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=SZyRKTc2; 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 S2388197AbeLQQII (ORCPT + 31 others); Mon, 17 Dec 2018 11:08:08 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:61926 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388037AbeLQQIF (ORCPT ); Mon, 17 Dec 2018 11:08:05 -0500 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-07.nifty.com with ESMTP id wBHG3bRl008119; Tue, 18 Dec 2018 01:03:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com wBHG3bRl008119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545062631; bh=YEFM37VoP8iq6zt/Sfo/eyMOxoBwqOHgn1OHsnq/Cpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SZyRKTc2cXrXSdD+byqOkkRXRbjEFecU2OrfzayHBhLpnlQmjrRR0X4d1rYdHi4Gw /zxv5vAt6rwxhcldHskdNvQBYucrTVRzueyL4ppQRbhSl4I64Q+fKzeawHK37OYDrA KQ8pfJXlpD/RFd5oLx+scOR/MiFCMMsJ9na7PqxrNBS0CCHYpRPbWPkkuO/bVvmalJ lUjPk4s1rlhnpfBCDp7VK2loB9lOiMRmI7u98ZN6Uk4MGyQ35OKUbZ/4sU3bHqmnkR J8g8lu5F7vELxXUPeqtzwgjsLdsL3ayHjA2F7or1g7LzFym8Lb9iuO8t/AWktmq91c UkRKkXTx9T43Q== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" Cc: Richard Biener , Segher Boessenkool , Peter Zijlstra , Juergen Gross , Josh Poimboeuf , Kees Cook , Linus Torvalds , Masahiro Yamada , Luc Van Oostenryck , linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, Nadav Amit Subject: [PATCH v3 08/12] Revert "x86/objtool: Use asm macros to work around GCC inlining bugs" Date: Tue, 18 Dec 2018 01:03:23 +0900 Message-Id: <1545062607-8599-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545062607-8599-1-git-send-email-yamada.masahiro@socionext.com> References: <1545062607-8599-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit c06c4d8090513f2974dfdbed2ac98634357ac475. The in-kernel workarounds will be replaced with GCC's new "asm inline" syntax. Signed-off-by: Masahiro Yamada --- arch/x86/kernel/macros.S | 2 -- include/linux/compiler.h | 56 +++++++++++------------------------------------- 2 files changed, 13 insertions(+), 45 deletions(-) -- 2.7.4 diff --git a/arch/x86/kernel/macros.S b/arch/x86/kernel/macros.S index cee28c3..cfc1c7d 100644 --- a/arch/x86/kernel/macros.S +++ b/arch/x86/kernel/macros.S @@ -5,5 +5,3 @@ * commonly used. The macros are precompiled into assmebly file which is later * assembled together with each compiled file. */ - -#include diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 06396c1..fc5004a 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -99,13 +99,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, * unique, to convince GCC not to merge duplicate inline asm statements. */ #define annotate_reachable() ({ \ - asm volatile("ANNOTATE_REACHABLE counter=%c0" \ - : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) #define annotate_unreachable() ({ \ - asm volatile("ANNOTATE_UNREACHABLE counter=%c0" \ - : : "i" (__COUNTER__)); \ + asm volatile("%c0:\n\t" \ + ".pushsection .discard.unreachable\n\t" \ + ".long %c0b - .\n\t" \ + ".popsection\n\t" : : "i" (__COUNTER__)); \ }) +#define ASM_UNREACHABLE \ + "999:\n\t" \ + ".pushsection .discard.unreachable\n\t" \ + ".long 999b - .\n\t" \ + ".popsection\n\t" #else #define annotate_reachable() #define annotate_unreachable() @@ -293,45 +302,6 @@ static inline void *offset_to_ptr(const int *off) return (void *)((unsigned long)off + *off); } -#else /* __ASSEMBLY__ */ - -#ifdef __KERNEL__ -#ifndef LINKER_SCRIPT - -#ifdef CONFIG_STACK_VALIDATION -.macro ANNOTATE_UNREACHABLE counter:req -\counter: - .pushsection .discard.unreachable - .long \counter\()b -. - .popsection -.endm - -.macro ANNOTATE_REACHABLE counter:req -\counter: - .pushsection .discard.reachable - .long \counter\()b -. - .popsection -.endm - -.macro ASM_UNREACHABLE -999: - .pushsection .discard.unreachable - .long 999b - . - .popsection -.endm -#else /* CONFIG_STACK_VALIDATION */ -.macro ANNOTATE_UNREACHABLE counter:req -.endm - -.macro ANNOTATE_REACHABLE counter:req -.endm - -.macro ASM_UNREACHABLE -.endm -#endif /* CONFIG_STACK_VALIDATION */ - -#endif /* LINKER_SCRIPT */ -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ /* Compile time object size, -1 for unknown */