From patchwork Mon Dec 17 16:03:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154018 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2640818ljp; Mon, 17 Dec 2018 08:11:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vas6Zi8hCacv6QCAhGE5D0sUlJ7ntLN+7DciUk1Z5Ul87U0wJ1eIfrCfF2cxfsg3U1Cy8E X-Received: by 2002:a62:64d7:: with SMTP id y206mr13443048pfb.84.1545063099375; Mon, 17 Dec 2018 08:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545063099; cv=none; d=google.com; s=arc-20160816; b=moME/LVD3denVeH5krAEtAHNliVfX3n3o63EbMqtrx/3bvZNH7V3nxPzt6pDa4sfo6 VVIvyLgnATr12uzApXWv/A52+3khzvZBztVNC7RIokuf+jGMGujpEL8mgpWLNvIBhP0V IRrYS7fGqI79J4HOhcuxQmI0i4MGIIewLvya6svXcc0rC7fLLOhH0Fi/YFgw70Eh3Ihc JGfzoJ9ddr7vi/keHicoGcGDJBMBb9dT9ujO/LhD35DxhP6kHeLmlRuGpyCGwVHmkdqV YIXm8SRcMFE2VGiO5mq0POOJCHGLJgAhsazOUXm+vcHDolEEa/fUlHK9qHR4++HW+b8I VZWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=mXAOGKoN9nVQj5muokTwBydmcKVF/sl76L2EsO/amDk=; b=fYSk4QYXNLzNR7/hKuLFlNqH3axFj5O5opl8ueWj48iLeIzGdLbesIiaoUaSpqXx/g 6RSz1ySQQydwB03v8o6jDV5xvddSqMb01qC/Zo7NkF2F9a+/KkqbMN5AkM7nO+xGqB7N 2jIIcuUzr15SxIUt14zwZJoZJJkKWfF6EBtkICIToVHeEca4d/MdrTZochyCH2LhBxNb TExYt9UXvWb0bsHdYlb57OHo51xSo2tEw9pS0beBns87T2H66uiHoPkNkNiZ9gEJ03/N nkhdZDxk+K6bq1UFcHAZLf7oXpHc7LGAcAFrRpllOOUyB717LDSuQRiJnKeWNvmiLRRr aHhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="H2d1R/yM"; 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 r34si11262947pga.242.2018.12.17.08.11.39; Mon, 17 Dec 2018 08:11:39 -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="H2d1R/yM"; 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 S2388297AbeLQQLh (ORCPT + 31 others); Mon, 17 Dec 2018 11:11:37 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:65254 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388235AbeLQQLQ (ORCPT ); Mon, 17 Dec 2018 11:11:16 -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 wBHG3bRd008119; Tue, 18 Dec 2018 01:03:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com wBHG3bRd008119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545062620; bh=mXAOGKoN9nVQj5muokTwBydmcKVF/sl76L2EsO/amDk=; h=From:To:Cc:Subject:Date:From; b=H2d1R/yMkMpGJFlSf98Sf3rlDmcJdv4Hx08zt7v/X0XVWsWT6y1BnI0S7zSmEVB3o IIuz2RfHe0x+40P0XYACCdeRnVK/4lcLSpcPnScxQSjz8NKDgNXeiTx+fjuKnHJrcT crwPMcq5ic6k7riPgy6k+7lcN/elDCkJzPU08KHugllEeGv7UgJGzBWiK1Fe4JGX/4 cvN/ZLMocnp5nA+RqHvGV1T1/Hpy4NpRuA45c0+uwt3zYNwQ7MhD4aFd0rV1zjaH/j mDy9qjdPk1Kv9JHcAY0F2jn+oIGtTLInAUPWF9H/P671g7zZCIBKH1+XJ+NFqEfJk+ 8S1ssmjsiYUQw== 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 , Arnd Bergmann , Andrey Ryabinin , virtualization@lists.linux-foundation.org, Luc Van Oostenryck , Alok Kataria , Ard Biesheuvel , Jann Horn , linux-arch@vger.kernel.org, Alexey Dobriyan , linux-sparse@vger.kernel.org, Andrew Morton , linux-kbuild@vger.kernel.org, Yonghong Song , Michal Marek , Arnaldo Carvalho de Melo , Jan Beulich , Nadav Amit , David Woodhouse , Alexei Starovoitov , linux-kernel@vger.kernel.org Subject: [PATCH v3 00/12] x86, kbuild: revert macrofying inline assembly code Date: Tue, 18 Dec 2018 01:03:15 +0900 Message-Id: <1545062607-8599-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series reverts the in-kernel workarounds for inlining issues. The commit description of 77b0bf55bc67 mentioned "We also hope that GCC will eventually get fixed,..." Now, GCC provides a solution. https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html explains the new "asm inline" syntax. The performance issue will be eventually solved. [About Code cleanups] I know Nadam Amit is opposed to the full revert. He also claims his motivation for macrofying was not only performance, but also cleanups. IIUC, the criticism addresses the code duplication between C and ASM. If so, I'd like to suggest a different approach for cleanups. Please see the last 3 patches. IMHO, preprocessor approach is more straight-forward, and readable. Basically, this idea should work because it is what we already do for __ASM_FORM() etc. [Quick Test of "asm inline" of GCC 9] If you want to try "asm inline" feature, the patch is available: https://lore.kernel.org/patchwork/patch/1024590/ The number of symbols for arch/x86/configs/x86_64_defconfig: nr_symbols [1] v4.20-rc7 : 96502 [2] [1]+full revert : 96705 (+203) [3] [2]+"asm inline": 96568 (-137) [3]: apply my patch, then replace "asm" -> "asm_inline" for _BUG_FLAGS(), refcount_add(), refcount_inc(), refcount_dec(), annotate_reachable(), annotate_unreachable() Changes in v3: - Split into per-commit revert (per Nadav Amit) - Add some cleanups with preprocessor approach Changes in v2: - Revive clean-ups made by 5bdcd510c2ac (per Peter Zijlstra) - Fix commit quoting style (per Peter Zijlstra) Masahiro Yamada (12): Revert "x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs" Revert "x86/cpufeature: Macrofy inline assembly code to work around GCC inlining bugs" Revert "x86/extable: Macrofy inline assembly code to work around GCC inlining bugs" Revert "x86/paravirt: Work around GCC inlining bugs when compiling paravirt ops" Revert "x86/bug: Macrofy the BUG table section handling, to work around GCC inlining bugs" Revert "x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs" Revert "x86/refcount: Work around GCC inlining bug" Revert "x86/objtool: Use asm macros to work around GCC inlining bugs" Revert "kbuild/Makefile: Prepare for using macros in inline assembly code to work around asm() related GCC inlining bugs" linux/linkage: add ASM() macro to reduce duplication between C/ASM code x86/alternatives: consolidate LOCK_PREFIX macro x86/asm: consolidate ASM_EXTABLE_* macros Makefile | 9 +-- arch/x86/Makefile | 7 --- arch/x86/include/asm/alternative-asm.h | 22 +------ arch/x86/include/asm/alternative-common.h | 47 +++++++++++++++ arch/x86/include/asm/alternative.h | 30 +--------- arch/x86/include/asm/asm.h | 46 +++++---------- arch/x86/include/asm/bug.h | 98 +++++++++++++------------------ arch/x86/include/asm/cpufeature.h | 82 +++++++++++--------------- arch/x86/include/asm/jump_label.h | 22 +++++-- arch/x86/include/asm/paravirt_types.h | 56 +++++++++--------- arch/x86/include/asm/refcount.h | 81 +++++++++++-------------- arch/x86/kernel/macros.S | 16 ----- include/asm-generic/bug.h | 8 +-- include/linux/compiler.h | 56 ++++-------------- include/linux/linkage.h | 8 +++ scripts/Kbuild.include | 4 +- scripts/mod/Makefile | 2 - 17 files changed, 249 insertions(+), 345 deletions(-) create mode 100644 arch/x86/include/asm/alternative-common.h delete mode 100644 arch/x86/kernel/macros.S -- 2.7.4