From patchwork Mon Dec 17 16:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 154014 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2640327ljp; Mon, 17 Dec 2018 08:11:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uj6nWeymMdgGVDe3ZeGgWnW0BdQibVKYg7P2srJ43nZvfMkF7J1tLvCX1SN26dBdvyBa9Y X-Received: by 2002:a63:111c:: with SMTP id g28mr12552553pgl.85.1545063074430; Mon, 17 Dec 2018 08:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545063074; cv=none; d=google.com; s=arc-20160816; b=JqlatJKkdhHCyL6sfUGnHa69YYU1HbkV5qnA6HpPO90p5GT+5SiMpYaYLzmPppic/z Kv6MZ2IeMPwmbaVyZ/e5SxR4T3m1f0NDJGzc+vnvWBsbbaBe+nthuVXTs+pHKD8TdE8I WRNQuDQZHkbMBv+FyWuoy64gAxKkPBSo40PfM5e2k6WZ0Ie9r1EUdz2FpOSTfbIIm7nn wwv3E+i6MRZ9GWalh0OmLOZZqC1UVrJipgoxvwp5fjte1lHAhAvLV89aTo3HciM3iRoR cW4zPN7oXZpCoH6IHoY/Gz2KH/yeY+ezwNH9cW3MsuiidJIrNkPH528QvOjMqTKhedBg XuCQ== 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=dFD8Gwu+yAksuGT9Rgxw6GpB3bscgIYkgUVU4dNRgro=; b=IC0bRy0+IuLto7EgjANBMLQ3y3YdJdNrjvgBD0bh5aq45EEPSEGQlY9m0IlRh1NFDr ICOsqGGAkbJ/at+Y1GMZ2+cB32ZsimQLOxBk8Ew8HMnoOfq3lftN4EOMOzij5v43QS3M 5ol6Q0XcqhEWMMzN+RZCwxGPLx0MfBVziZt5NNhHFDrWeEnH127i90I0nBRC6OqfbqQ+ HF8S4LorHTs0OKtqWALgtwCNGABKAV6FNpm9/9FVlQJqkvfEtHuY6EaaOjbQJ/pIHhCF fw4E7mTwkqzZEqKCv7oqx9+mbrhwKjP8TWlygni9szDthvxJHqcjWeQOg+uMwbRyG9L5 NQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=c6TeJLgN; 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 l124si11528165pfl.284.2018.12.17.08.11.14; Mon, 17 Dec 2018 08:11:14 -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=c6TeJLgN; 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 S2388234AbeLQQLM (ORCPT + 31 others); Mon, 17 Dec 2018 11:11:12 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:65176 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbeLQQLJ (ORCPT ); Mon, 17 Dec 2018 11:11:09 -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 wBHG3bRj008119; Tue, 18 Dec 2018 01:03:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com wBHG3bRj008119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1545062629; bh=dFD8Gwu+yAksuGT9Rgxw6GpB3bscgIYkgUVU4dNRgro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6TeJLgNTA4bcMva8jdxX45ybV4vRZWXTAqdl67ttw7FPo3EjLPr48N+sGdg7zdFW 7Vrvy5bm3Hq7mjr9+GgUih0w0wXf/fgHbcPBQhDFLlD9y7fMhZdUn4XSagxch/OHq+ YYFPh4R/PygzJx4UeZrhWeni/GoU/2NYAB47PfaPP9Z9v6t2+4G4Czjz6sGBbPGkF2 bY3UhFLzExhQaJs4sao8TvaXQ7kDTBspHXqvxSFRgXAp6jU1ounhmLYaWLN+82FC2N s4C4K8e0ZovZlfYWYHYqkG7QGI5FYHQ+bBbS+SjygOV4oTkeyrWgNBP4Zg9kURcRek CZtA2Cc0Tx59g== 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 , David Woodhouse , linux-kernel@vger.kernel.org, Alexey Dobriyan , Nadav Amit Subject: [PATCH v3 06/12] Revert "x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs" Date: Tue, 18 Dec 2018 01:03:21 +0900 Message-Id: <1545062607-8599-7-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 77f48ec28e4ccff94d2e5f4260a83ac27a7f3099. 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/alternative-asm.h | 20 ++++++-------------- arch/x86/include/asm/alternative.h | 11 +++++++++-- arch/x86/kernel/macros.S | 1 - 3 files changed, 15 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h index 8e4ea39..31b627b 100644 --- a/arch/x86/include/asm/alternative-asm.h +++ b/arch/x86/include/asm/alternative-asm.h @@ -7,24 +7,16 @@ #include #ifdef CONFIG_SMP -.macro LOCK_PREFIX_HERE + .macro LOCK_PREFIX +672: lock .pushsection .smp_locks,"a" .balign 4 - .long 671f - . # offset + .long 672b - . .popsection -671: -.endm - -.macro LOCK_PREFIX insn:vararg - LOCK_PREFIX_HERE - lock \insn -.endm + .endm #else -.macro LOCK_PREFIX_HERE -.endm - -.macro LOCK_PREFIX insn:vararg -.endm + .macro LOCK_PREFIX + .endm #endif /* diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index d7faa16..4cd6a3b 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -31,8 +31,15 @@ */ #ifdef CONFIG_SMP -#define LOCK_PREFIX_HERE "LOCK_PREFIX_HERE\n\t" -#define LOCK_PREFIX "LOCK_PREFIX " +#define LOCK_PREFIX_HERE \ + ".pushsection .smp_locks,\"a\"\n" \ + ".balign 4\n" \ + ".long 671f - .\n" /* offset */ \ + ".popsection\n" \ + "671:" + +#define LOCK_PREFIX LOCK_PREFIX_HERE "\n\tlock; " + #else /* ! CONFIG_SMP */ #define LOCK_PREFIX_HERE "" #define LOCK_PREFIX "" diff --git a/arch/x86/kernel/macros.S b/arch/x86/kernel/macros.S index 852487a..f1fe1d5 100644 --- a/arch/x86/kernel/macros.S +++ b/arch/x86/kernel/macros.S @@ -8,4 +8,3 @@ #include #include -#include