Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4555481ybb; Tue, 7 Apr 2020 09:42:30 -0700 (PDT) X-Google-Smtp-Source: APiQypJFvMYTqfjIdDdr+aHFpXLVKYcHBQTumfOhpW6Z3Ca8pSHDX8VUcxeGrOhbegraKugD+8mP X-Received: by 2002:a9d:7ccb:: with SMTP id r11mr2429795otn.204.1586277750667; Tue, 07 Apr 2020 09:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586277750; cv=none; d=google.com; s=arc-20160816; b=bopMsCqjwkrJS9Nh3+ip82nc3kDOM7lLbYrYAVYlipW0lxf5GDEnhRzgCsFTPCgdja DHvKX/QV6ZkujQw7Bxl17HkZ9lJI6FEE5Bz7pYhf5N2K2BCkJWtTcRIBLVSIFcztp+Rm f1bqomIlSoQe9P0OqquASWu1BD7fjSqZecnUvGoWKjHdSaK0u387iWh48aJ8l42KX5++ vPqJkmWxl7uQ0+MQkGb5m1RjbZOyQIfTdTBURLSolDGwUeinXdfPv6hb9nNLKXfA0I5h dxc6iqCOD1Wm+etfEe7L9odifYNdqG0+MHIgHVBxKmunnu2Z5+IG2a3yfnGXOB1OU/Yy QdTQ== 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=RA09IMm6IufQ7k2rknWhIbMWA7PHLNfk/QX/AiA8EGg=; b=Mtni/H5p9E59a36xDn1ibXDKZMzWAPCcvttwptr8yxAXoYSuoCncGCXSscs/0TK6b3 aU5v3orJdRgCQcCuBlxQ9AvZqNKjBK1jCOQwuXkFNYm1njK0siMRqbqHNbMfrPYD0XDL 3b2tV0I5k4xvuIUS7CALz++8JDON9Vkwn+avD58U9t0WpIJe0+3hnS/nfTgVnDxctY1D HJFAL2ThgNegFwf8G/N4Y9KGgPFk1732qATP21z+U2q1NOLQxMWAy2wqUsCntftxceAB 0kou0oz7Wuuzmd8I9bmt9yYpfkpL3mooLuYG94ZfLsRyMIoftAUHUJw+Z3JPyvHzr2uA 6oiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Iqjhmh94; 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 i12si846376oii.113.2020.04.07.09.42.18; Tue, 07 Apr 2020 09:42:30 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Iqjhmh94; 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 S1728169AbgDGQlt (ORCPT + 99 others); Tue, 7 Apr 2020 12:41:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37678 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbgDGQlt (ORCPT ); Tue, 7 Apr 2020 12:41:49 -0400 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=RA09IMm6IufQ7k2rknWhIbMWA7PHLNfk/QX/AiA8EGg=; b=Iqjhmh94wAOMY41anwB1Ld2+xf 0fuSWYvJuvoH2U6rFY8BCCT8sC+Q60Q6AZ8Wi+g0EA9vBTCpW4+gFMSdLcMTW03es0JTpsq8MfooW J5e9ipOoEp6x+5zeb1r+nLsgz6WHtMJ5C5rrSEhA86nx0P8IquIYv8ZyBCBEphQb/FH6VnYI0P/yY nFMqBPfb4frRZpLPDKZCgFuvU0MJP5z8mxmsByoXqfOJjRh2aQWz+yWtQ+HhMMGAsXYG8dGwfBDhe 8B2snWeYKUE68pPt88MHlm9V8Innlih+pYtT5WR4gT87W6Qt3+hbPYk/VXKfz2aldjHcEZ+URVNAw 8Zy89vKQ==; 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 1jLrIH-00005Z-MV; Tue, 07 Apr 2020 16:41:45 +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 C1AEC3011DD; Tue, 7 Apr 2020 18:41:43 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B348F2B0A1250; Tue, 7 Apr 2020 18:41:43 +0200 (CEST) Date: Tue, 7 Apr 2020 18:41:43 +0200 From: Peter Zijlstra To: Alexandre Chartre Cc: Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org, jthierry@redhat.com, tglx@linutronix.de Subject: Re: [PATCH V2 9/9] x86/speculation: Remove all ANNOTATE_NOSPEC_ALTERNATIVE directives Message-ID: <20200407164143.GG20730@hirez.programming.kicks-ass.net> References: <20200407073142.20659-1-alexandre.chartre@oracle.com> <20200407073142.20659-10-alexandre.chartre@oracle.com> <20200407132837.GA20730@hirez.programming.kicks-ass.net> <20200407133454.n55u5nx33ruj73gx@treble> <89b10eb8-c030-b954-6be3-8830fc6a8daa@oracle.com> <3eb36fd2-9827-4c1b-681c-9c1d65c7582f@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3eb36fd2-9827-4c1b-681c-9c1d65c7582f@oracle.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2020 at 06:18:51PM +0200, Alexandre Chartre wrote: > > On 4/7/20 4:32 PM, Alexandre Chartre wrote: > > > > On 4/7/20 3:34 PM, Josh Poimboeuf wrote: > > > On Tue, Apr 07, 2020 at 03:28:37PM +0200, Peter Zijlstra wrote: > > > > Josh, we should probably have objtool verify it doesn't emit ORC entries > > > > in alternative ranges. > > > > > > Agreed, it might be as simple as checking for insn->alt_group in the > > > INSN_STACK check or in update_insn_state(). > > > > > > > We could do that only for the "objtool orc generate" command. That way > > "objtool check" would still check the alternative, but "objtool orc generate" > > will just use the first half of the alternative (like it does today with > > ANNOTATE_NOSPEC_ALTERNATIVE). We can even keep all ANNOTATE_NOSPEC_ALTERNATIVE > > but only use them for "objtool orc generate". > > > > I have checked and objtool doesn't emit ORC entries for alternative: > decode_instructions() doesn't mark such section with sec->text = true > so create_orc_sections() doesn't emit corresponding ORC entries. > > So I think we can remove the ANNOTATE_NOSPEC_ALTERNATIVE directives, > this will allow objtool to check the instructions but it still won't > emit ORC entries (same behavior as today). In the future, if ORC > eventually supports alternative we will be ready to have objtool emit > ORC entries. I mean, we should make it warn for the case where you remove ANNOTATE_NOSPEC and it would like to generate ORC. Also, what's the point of having objtool grok this code and then not doing anything with it?