From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D91C4ECDE5F for ; Sat, 21 Jul 2018 05:08:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9DDF8206B7 for ; Sat, 21 Jul 2018 05:08:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DDF8206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727622AbeGUF7v (ORCPT ); Sat, 21 Jul 2018 01:59:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40772 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbeGUF7v (ORCPT ); Sat, 21 Jul 2018 01:59:51 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0EDD3720; Sat, 21 Jul 2018 05:08:29 +0000 (UTC) Date: Sat, 21 Jul 2018 07:08:27 +0200 From: Greg KH To: Nick Desaulniers Cc: stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Juergen Gross , linux-kernel@vger.kernel.org Subject: Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline Message-ID: <20180721050827.GD27598@kroah.com> References: <20180718090702.GA6212@kroah.com> <20180720223642.126080-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180720223642.126080-1-ndesaulniers@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote: > native_save_fl() is marked static inline, but by using it as > a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined. > > paravirt's use of native_save_fl() also requires that no GPRs other than > %rax are clobbered. > > Compilers have different heuristics which they use to emit stack guard > code, the emittance of which can break paravirt's callee saved assumption > by clobbering %rcx. > > Marking a function definition extern inline means that if this version > cannot be inlined, then the out-of-line version will be preferred. By > having the out-of-line version be implemented in assembly, it cannot be > instrumented with a stack protector, which might violate custom calling > conventions that code like paravirt rely on. > > The semantics of extern inline has changed since gnu89. This means that > folks using GCC versions >= 5.1 may see symbol redefinition errors at > link time for subdirs that override KBUILD_CFLAGS (making the C standard > used implicit) regardless of this patch. This has been cleaned up > earlier in the patch set, but is left as a note in the commit message > for future travelers. > > Reports: > https://lkml.org/lkml/2018/5/7/534 > https://github.com/ClangBuiltLinux/linux/issues/16 > > Discussion: > https://bugs.llvm.org/show_bug.cgi?id=37512 > https://lkml.org/lkml/2018/5/24/1371 > > Thanks to the many folks that participated in the discussion. > > Acked-by: Juergen Gross > Debugged-by: Alistair Strachan > Debugged-by: Matthias Kaehlcke > Reported-by: Sedat Dilek > Signed-off-by: Nick Desaulniers > Suggested-by: Arnd Bergmann > Suggested-by: H. Peter Anvin > Suggested-by: Tom Stellar > Tested-by: Sedat Dilek > --- > Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to > actual definitions" which doesn't apply cleanly, and not really worth > backporting IMO. It's simpler to change this patch from upstream: > + #include > rather than > + #include Yeah, that makes sense, thanks for the backport. I'll queue it up after the next round of stable kernels comes out in a few days. greg k-h