Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3326769ybk; Tue, 19 May 2020 01:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyoae7tJRHt2xYaWmehc0eyj7immN/zFNjOC10Vo7BEdgryyZoTIxvdV4TJdN2GWfTAoqI X-Received: by 2002:a50:9e2a:: with SMTP id z39mr17927636ede.371.1589877657211; Tue, 19 May 2020 01:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589877657; cv=none; d=google.com; s=arc-20160816; b=l50C6eFOeJZ7+2GPiOTAhfhA24mhLw6gRuUdStdCMI/DGxPI9aZqL4bIuEl0TZO7hK 95YUzsGlw8S2B9OKAxEMlwDbAVeXHWQhPF/B0bBmV2T4FnwRPgYtIGXWI6Tt36YPA/mu FfbOHzz3SwectZYnDX4NGnpqKACJaKQecg/csoShtm4p4DtRTfdydcgy+rfYvwyag8+4 p9x6Jzt6pQAa/HxTQ9INQWPlU+HHi4EqXLfLjlt5s9FR5ts+dE21LvcOopEbpM2rspqP Z6foVfJvzDAQgrT01uowltMbEOwKM7xhwYsT2KvXsQzUL1DUgFjmpetzykY423r+7R7d k3Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pFkikJXoNytc03Bw/n9lcc4TGxhSfdZavl/JejOAmLk=; b=pQD2oK14ZCwQMDQ5uFTudj3sHZmPcia04RislwBJx46DJ9aE5RXD3OfGD9LKzOgZDx eoMezItclb2x1yzAVn8ywxgVDyzl53a51meQCbdiPcKRBMQa6nMOTrD81Mh930SniARs WEf7U4nSnVCW0pa6eGIsfz6+MQM1qmdVx9Mc+J/coLMnLI8LhAyolqOlvAYoWqFgn7R8 27bydngHQkFX2igZEeoUqFwmjQ8uhZ94HdyRb/gOl6GSXW5OSOGJ4sHVI5eP+i5cVRYo TrCIsjD4Lz7+NM3kKB8yRJlNT8rtQ6D+CDBRAtNov49jHNoOhqLIvfmDCT9Wt1FvNnnY Xmdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UC7WaKDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z97si6970702ede.412.2020.05.19.01.40.34; Tue, 19 May 2020 01:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UC7WaKDD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgESIjC (ORCPT + 99 others); Tue, 19 May 2020 04:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgESIjB (ORCPT ); Tue, 19 May 2020 04:39:01 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC7A9C061A0C for ; Tue, 19 May 2020 01:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pFkikJXoNytc03Bw/n9lcc4TGxhSfdZavl/JejOAmLk=; b=UC7WaKDDjEIr7TIYnFWbPUQWgo aa/zGvqRFxdWMd7zrh07rAL3bykA9IgujuC+xi6pN5uVdxw625DDlQPT75fwVNFC2mQ49uiyzGLXz MFaJ1Z427lIhiHI11v37AbYnjk9ca0Z4j3lJMtQIWjf6SJV50syqRvZWTq42IQ5+qa31iS/EgudUX mrpJVQ5XA7lngySwuWiwqJkj1d6Wod7hc9mQ6wQXiF1rMlbB+MZK2yIxYLB0FG2F5kRaffSkervxY T8xXwQsUYgCDkko5au/0XTksLDnBNrGUToyUT0r9Q+n0pAQR0xawXQPLHFIY87FO0whrmiruaNJu+ BRBDZ2QQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jaxle-0000vZ-Ah; Tue, 19 May 2020 08:38:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 28EF73008A8; Tue, 19 May 2020 10:38:26 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BF2F82105F3AF; Tue, 19 May 2020 10:38:26 +0200 (CEST) Date: Tue, 19 May 2020 10:38:26 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon , Tom Lendacky , Wei Liu , Michael Kelley , Jason Chen CJ , Zhao Yakui Subject: Re: [patch V6 00/37] x86/entry: Rework leftovers and merge plan Message-ID: <20200519083826.GC279861@hirez.programming.kicks-ass.net> References: <20200518160750.GA279861@hirez.programming.kicks-ass.net> <87367xvvmy.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87367xvvmy.fsf@nanos.tec.linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 18, 2020 at 10:24:53PM +0200, Thomas Gleixner wrote: > Peter Zijlstra writes: > > So on top of you entry-v8-full; I had to chase one of those > > instrumentation_end() escapes an (extended) basic block chase (again!). > > > > --- a/arch/x86/include/asm/bug.h > > +++ b/arch/x86/include/asm/bug.h > > @@ -79,8 +79,8 @@ do { \ > > do { \ > > instrumentation_begin(); \ > > _BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \ > > - instrumentation_end(); \ > > annotate_reachable(); \ > > + instrumentation_end(); \ > > } while (0) > > I just applied this part and rebuilt: > > vmlinux.o: warning: objtool: rcu_eqs_enter.constprop.77()+0xa9: call to > rcu_preempt_deferred_qs() leaves .noinstr.text section > > Did it go away after you disabled DEBUG_ENTRY perhaps? Hehe, then all complaints would be gone :-) So tglx/entry-v8-full + below patch: $ make O=defconfig-build clean ... $ make CC=gcc-9 O=defconfig-build/ vmlinux -j40 -s vmlinux.o: warning: objtool: exc_debug()+0x158: call to trace_hwlat_timestamp() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_nmi()+0x190: call to trace_hwlat_timestamp() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x46: call to mce_rdmsrl() leaves .noinstr.text section $ (it really isn't defconfig, but your config-fail + DEBUG_ENTRY) --- arch/x86/include/asm/bug.h | 2 +- include/linux/compiler.h | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index f128e5c2ed42..fb34ff641e0a 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -79,8 +79,8 @@ do { \ do { \ instrumentation_begin(); \ _BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \ - instrumentation_end(); \ annotate_reachable(); \ + instrumentation_end(); \ } while (0) #include diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 7db5902f8f6e..f6f54e8e0797 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -120,25 +120,30 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, /* Annotate a C jump table to allow objtool to follow the code flow */ #define __annotate_jump_table __section(.rodata..c_jump_table) +#ifdef CONFIG_DEBUG_ENTRY /* Begin/end of an instrumentation safe region */ -#define instrumentation_begin() ({ \ +#define instrumentation_begin() ({ \ asm volatile("%c0:\n\t" \ ".pushsection .discard.instr_begin\n\t" \ ".long %c0b - .\n\t" \ ".popsection\n\t" : : "i" (__COUNTER__)); \ }) -#define instrumentation_end() ({ \ - asm volatile("%c0:\n\t" \ +#define instrumentation_end() ({ \ + asm volatile("%c0: nop\n\t" \ ".pushsection .discard.instr_end\n\t" \ ".long %c0b - .\n\t" \ ".popsection\n\t" : : "i" (__COUNTER__)); \ }) +#endif /* CONFIG_DEBUG_ENTRY */ #else #define annotate_reachable() #define annotate_unreachable() #define __annotate_jump_table +#endif + +#ifndef instrumentation_begin #define instrumentation_begin() do { } while(0) #define instrumentation_end() do { } while(0) #endif