Received: by 10.213.65.68 with SMTP id h4csp935893imn; Wed, 14 Mar 2018 04:53:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELuGgVagM7MXqLSWW4fKLdwa/WsQx2S4eQo2tQ0crbWdbthDfnGjLL6diNYQEaQFB02OJGqU X-Received: by 10.99.161.2 with SMTP id b2mr3539582pgf.130.1521028397981; Wed, 14 Mar 2018 04:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521028397; cv=none; d=google.com; s=arc-20160816; b=lI/9lGeJOfJnSWCMLQSbRvEHDB1azIJb9I/ELBh7sltlYSCVjHStdKZu7D2R21lEG2 QC5lcF6P+IOP0aUFAwyv9QG+Mz26f72yV9kkdnkbychUhwqf9UkjYYGJIetPKTmeHEgq 0T1X8TBzT0m6+hU1EIxcIxcaBQAflaRY7kp97Zzo+WB5wTO3OhCVoPWSM/MXESWFDicz wStd+OV3J7MGJouE1ucPff9u71bMO6vL16UvEjcckBnNycX0sqrBFoSsGcJc1ajB5d8K esJxPx0XR91wuy23ilgQsYzKH5xh5vCVioypZtm0vgqRApglBZF5iUn7nhG/wtUu83RG q3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Adk5cSW18pAIUQkUqNGJnqCaszdNLVkrJJGDgUN0urs=; b=ajKRm8HyvBIkTXShgvioyXa+OIcMHHq71MiVcC2DoOkJM0vbJ39Of+ApnTPiCrN7Oa EtbzFpfHgnlP9Os0lAdeGvWlDTnEAn9HG1PF6PMDCaOoXlkp9/2op1jsf3kkqNHRognh hEYdf0hBj1zDT4LWxmcMKKIEio2NnU7x9OAXDG0ipKmH/Y7PWYzgFpmkhYtBmrtcQ66C oy0LazF0KgukeBPLvYrr+OS3gotxvE00GCqrIpO1v5qNMPCyaWfEYDId5z3v003mIP73 0BaVIvfdamUq8BcYpBYG2rFwqL2jNFOcMaapIKDOiq/fpUT6L2QHTY9pVs9cvKguTLQM 1GJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Fy/IEEpA; 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 m9-v6si1859055plt.6.2018.03.14.04.53.03; Wed, 14 Mar 2018 04:53:17 -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=Fy/IEEpA; 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 S1751886AbeCNLve (ORCPT + 99 others); Wed, 14 Mar 2018 07:51:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47124 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbeCNLvd (ORCPT ); Wed, 14 Mar 2018 07:51:33 -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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Adk5cSW18pAIUQkUqNGJnqCaszdNLVkrJJGDgUN0urs=; b=Fy/IEEpAuc+hTfJp9hFdXuxEW l/MISkC7tza1u2FoUYTfA0tZDj3A53n2uDBXY5hlqpgfpV0yd3ihX8N5LiekTRd0a1ZnJbBECO3fI I4WEdx/sonx8UhFh7IScTXukPAjvbdEm5bTJDYjPwVmNshQ8ewevI7ZT4Z3nHUqEhFTsiduZlN+gK 0AF/Ad+k8xLQRR1Q5z/WlAY1lewDAvu/0H/6B4+V4h2tXIasyL9Cf5f89jweP98AJGLcpnZ074rWz UTHVMtdhVQWgRjHQbMmhldhblAAKQqkjXiot5F1/dGIa7t5iOALMmDl5sWyEdNq+7/FVY8XHknBJh DfftKT7mg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ew4wK-0000gc-GQ; Wed, 14 Mar 2018 11:51:28 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E1B472029B0E0; Wed, 14 Mar 2018 12:51:25 +0100 (CET) Date: Wed, 14 Mar 2018 12:51:25 +0100 From: Peter Zijlstra To: Andy Whitcroft Cc: Thomas Gleixner , Ingo Molnar , David Woodhouse , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit Message-ID: <20180314115125.GS4043@hirez.programming.kicks-ass.net> References: <20180314112427.22351-1-apw@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180314112427.22351-1-apw@canonical.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2018 at 11:24:27AM +0000, Andy Whitcroft wrote: > In 9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps > for objtool") we added annotations for CALL_NOSPEC/JMP_NOSPEC on x86 64bit. > We did not annotate the 32bit path. Annotate it similarly. > > Signed-off-by: Andy Whitcroft > --- > arch/x86/include/asm/nospec-branch.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > While reviewing indirect calls in our builds I noted that the > i386 retpoline CALL_NOSPEC is not annotated safe even though > its amd64 equivalent is. I cannot see any reason this is not > also inherantly safe. Peter was there a reason that you did > not annotate this one too? Anyhow, on the assumption this was > just missed, this patch annotates it. Yeah, just an oversight aided by the fact that I (obviously) never build 32bit kernels. > diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h > index d0dabeae0505..07886162bdf8 100644 > --- a/arch/x86/include/asm/nospec-branch.h > +++ b/arch/x86/include/asm/nospec-branch.h > @@ -183,7 +183,10 @@ > * otherwise we'll run out of registers. We don't care about CET > * here, anyway. > */ > -# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n", \ > +# define CALL_NOSPEC \ > + ALTERNATIVE( \ > + ANNOTATE_RETPOLINE_SAFE \ > + "call *%[thunk_target]\n", \ > " jmp 904f;\n" \ > " .align 16\n" \ > "901: call 903f;\n" \ Acked-by: Peter Zijlstra (Intel)