From patchwork Mon Dec 17 16:03:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154015 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2640503ljp; Mon, 17 Dec 2018 08:11:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/VzKmljpO9PbT/9uT+QAWXSCTEVd8c7WVX1s7muqswUL5ZdG93g8+kMR8B8/Vb4NRbelRVS X-Received: by 2002:a63:b0a:: with SMTP id 10mr9497347pgl.423.1545063083866; Mon, 17 Dec 2018 08:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545063083; cv=none; d=google.com; s=arc-20160816; b=0OI1NIarWjBLcLKtiBNLre9UeXHBG1JIJNHd+zievBe+smLtuYXhJR0kIrTad1LyR7 +UwWt7a59rJO4qWHGOgVknyhDwpuzKXVr6hwiV0WxHx3GxDN5kfUSk43TkYt1lMwzrtH Lt2OU+PxYilXLErPcyxfnrZ/zuFlzc5Q6C60OfSvkbbvVNMMxY8anubpQ5OEHWr3+UCg ehbKaYtbo0pzXa9hdJ/vfRMvh6ZAkIHXyNZQcfc95dvTPhW6Bkyptqyf+83XDDNfh4C0 ByX4qCTUsbt2K0OcvdGbLy0B3GTOzA6JVyxee/MBLkAosXeE4ZGBV4N3dRNedplNDKOm Hl2A== 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=kHNal4UmUGn0s8J+K0Ap+BknqWU9QPW2PO6e5dHn7Rg=; b=AkwIbxoyyhYkoLuQxfwKFgp031GvgvxnLCpvzNcZavdLB4/yqiIXbIhA821B127gvu USzpYMjdCPtxxRmtqI+8qJIb+RjsOeannJKHUjj4MxawKEUUvaRAa1hh7zUP0xV7IDKC 8tCZZCehJzgGuz9uVOoZ+ow20kbyXY4fJHPznPiRZzBcrhkJ3twjRN1ezp9x23IlDoXQ 1j9tNqm/HsnG8W12lPSohqRL889McdDFtqBGAHh83UrS/Qm/PDytYKGgBB+JYv/oW4TA ODduIXXcOgs3Bu7Xb4sdvyGKHOXmKMrXNxWDRizfka5JDPgg1K6fYucDb9YkcyTUoZw2 WAcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=iJkFFCqR; 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 j132si7406217pfc.84.2018.12.17.08.11.23; Mon, 17 Dec 2018 08:11:23 -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=iJkFFCqR; 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 S2388271AbeLQQLV (ORCPT + 31 others); Mon, 17 Dec 2018 11:11:21 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:65347 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbeLQQLU (ORCPT ); Mon, 17 Dec 2018 11:11:20 -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 wBHG3bRg008119; Tue, 18 Dec 2018 01:03:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com wBHG3bRg008119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545062624; bh=kHNal4UmUGn0s8J+K0Ap+BknqWU9QPW2PO6e5dHn7Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJkFFCqRQUQzPzByJamvTnfzkMZR+YgIQ8wx4pAK+/4Xpfltk8zvFCcDzMPkZQjo7 q0/F/MaxrxLoNISMfqPGOIqm0wRTdAnbChtFjAePEzf7M2ilHDWVlwv7kqvQtsW3mO jUur5BGmid1l4aAtAfyWgqHq7IKUE31dm4afZp7k9ZONdM0WSmkAraWfG7eI2ej+xF KL3pcI3+Dh9n5UwvGwkQGN1xSqe4aWfXBN9ow+CTZDTVZIvSgMdZK+apdggdE5aCfe qgpx1EA7nqI0nAx/3693NhGpCR5o8VzZodmT9lX1Dub8P6AJXBUqwawajgz1TtowHw FSw+aH+nCx/lw== 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 , Yonghong Song , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Nadav Amit , Jann Horn Subject: [PATCH v3 03/12] Revert "x86/extable: Macrofy inline assembly code to work around GCC inlining bugs" Date: Tue, 18 Dec 2018 01:03:18 +0900 Message-Id: <1545062607-8599-4-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 0474d5d9d2f7f3b11262f7bf87d0e7314ead9200. The in-kernel workarounds will be replaced with GCC's new "asm inline" syntax. Signed-off-by: Masahiro Yamada --- I blindly reverted here, but I will clean it up in a different way later. arch/x86/include/asm/asm.h | 53 +++++++++++++++++++++++++++++----------------- arch/x86/kernel/macros.S | 1 - 2 files changed, 33 insertions(+), 21 deletions(-) -- 2.7.4 diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 21b0867..6467757b 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -120,25 +120,12 @@ /* Exception table entry */ #ifdef __ASSEMBLY__ # define _ASM_EXTABLE_HANDLE(from, to, handler) \ - ASM_EXTABLE_HANDLE from to handler - -.macro ASM_EXTABLE_HANDLE from:req to:req handler:req - .pushsection "__ex_table","a" - .balign 4 - .long (\from) - . - .long (\to) - . - .long (\handler) - . + .pushsection "__ex_table","a" ; \ + .balign 4 ; \ + .long (from) - . ; \ + .long (to) - . ; \ + .long (handler) - . ; \ .popsection -.endm -#else /* __ASSEMBLY__ */ - -# define _ASM_EXTABLE_HANDLE(from, to, handler) \ - "ASM_EXTABLE_HANDLE from=" #from " to=" #to \ - " handler=\"" #handler "\"\n\t" - -/* For C file, we already have NOKPROBE_SYMBOL macro */ - -#endif /* __ASSEMBLY__ */ # define _ASM_EXTABLE(from, to) \ _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) @@ -161,7 +148,6 @@ _ASM_PTR (entry); \ .popsection -#ifdef __ASSEMBLY__ .macro ALIGN_DESTINATION /* check for bad alignment of destination */ movl %edi,%ecx @@ -185,7 +171,34 @@ _ASM_EXTABLE_UA(100b, 103b) _ASM_EXTABLE_UA(101b, 103b) .endm -#endif /* __ASSEMBLY__ */ + +#else +# define _EXPAND_EXTABLE_HANDLE(x) #x +# define _ASM_EXTABLE_HANDLE(from, to, handler) \ + " .pushsection \"__ex_table\",\"a\"\n" \ + " .balign 4\n" \ + " .long (" #from ") - .\n" \ + " .long (" #to ") - .\n" \ + " .long (" _EXPAND_EXTABLE_HANDLE(handler) ") - .\n" \ + " .popsection\n" + +# define _ASM_EXTABLE(from, to) \ + _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) + +# define _ASM_EXTABLE_UA(from, to) \ + _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess) + +# define _ASM_EXTABLE_FAULT(from, to) \ + _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) + +# define _ASM_EXTABLE_EX(from, to) \ + _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext) + +# define _ASM_EXTABLE_REFCOUNT(from, to) \ + _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount) + +/* For C file, we already have NOKPROBE_SYMBOL macro */ +#endif #ifndef __ASSEMBLY__ /* diff --git a/arch/x86/kernel/macros.S b/arch/x86/kernel/macros.S index 7baa40d..71d8b71 100644 --- a/arch/x86/kernel/macros.S +++ b/arch/x86/kernel/macros.S @@ -11,4 +11,3 @@ #include #include #include -#include