Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3884710pxb; Wed, 13 Oct 2021 15:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdf4a0LacpTHZ8fonNriZoBZxn7GaCbW5xDBZGRwIyxC80stD79jJ3NBOwnEZEyAMoRul1 X-Received: by 2002:a50:cf48:: with SMTP id d8mr3051390edk.293.1634163557612; Wed, 13 Oct 2021 15:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634163557; cv=none; d=google.com; s=arc-20160816; b=fJ5oyaEqWZI7dGBRCXtkbe0hWglZWxUZX27Ip06Js1v/wC630vgyi+JFPsn8KpThvj 5C5T0kS8A9nBC/zVDGAuoG6W6MuMytffLNmIcvDsRpIxvpITM6c1gV3HnBY7wDEmzKf0 p8qTLGjnJtPGtCRt3WKoxx/l/3aRhhaID4PT+ZiJ/vrUMMbncpMisgaFWjAtZKPnk9Ct SOjr8E4YI8eEICRS+DzfnxVm0Uf1ZZq0Nsjkf7y6D0PHnoPh0mgEUbsFxiyyzqZvDYai i8fMVzhO9kv2mR68SYVJpBvjop7/7lfA7H7L692N/m2XkUao//T4eHPlCkGxRxSZrdNp iutQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Gd4cteDGr6xYmmq8pBoi3SACYwahRg0pd5fYr0WshOM=; b=ifQ1ECwTBh+ONInhL38ApaT1mFLfSa4KZK6MXkYVoNrXteVpRU4Dequ4qiiMlQsXEw t/gdWZc2ZN0HF9azWE7uRqDF9zFB/ZTvaw2ohlEe9lK6afjM4zQjT89eiKdfRGX6djwW 4c8FDI4DmlavuMPSqJnMYGhplmKfylS4CU0x7dYKaq61iywNR/5tfRoKwaWdafz6owLq 2hdod9gcKYLo57Z9nxcoTtf1Fk8Oh+G1jZapTO6bqbfGP7MEwkErMR4sGGC0xwprBw5k DTK9uZKpI6o7AxSnRC7vKCCqh+RnUyTUfXaJf3tA8cW+vwGTkdSb/2L2o6oWxTL1W5L6 +Z8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=U+1+Lcg3; 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 i2si1762225ejw.120.2021.10.13.15.18.26; Wed, 13 Oct 2021 15:19:17 -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=pass header.i=@infradead.org header.s=casper.20170209 header.b=U+1+Lcg3; 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 S230251AbhJMWSm (ORCPT + 99 others); Wed, 13 Oct 2021 18:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbhJMWSl (ORCPT ); Wed, 13 Oct 2021 18:18:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B975EC061570 for ; Wed, 13 Oct 2021 15:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=Gd4cteDGr6xYmmq8pBoi3SACYwahRg0pd5fYr0WshOM=; b=U+1+Lcg3OrODRzCOxAnG5CRqHg DoGaEeQYncnZQcYvHeKo01rxDNHC1ZEP6z6OfNdwAgZgmHLRjigusq/kuN08HHjo6RLvxNxP+K2Cp agEkwJGyqKqFRPPcxQUy2kiHZvNfuxxeo0Ge7yOWhYDwqH6KyAIa/uio4LW1dpBU90+A4zORxAltq QZ1iKs3L1UtQQrII/7kYnZ/NXaomnr7B7bCLN3ppmWjgJqH8Ls3Ts2yJQGpZCXLTYE0IwvdsdOMjD JfXwFbq8silhVRkuLY31qi1RDHqvpY/gOEjPJjlJSH56ylZuqXmLRw1G7WPqt7vx0Es9XIzpZEUY4 YMAKTVOw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mamWR-007qSg-Ld; Wed, 13 Oct 2021 22:15:02 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id ACAB9300252; Thu, 14 Oct 2021 00:14:51 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8E163207EF0DE; Thu, 14 Oct 2021 00:14:51 +0200 (CEST) Date: Thu, 14 Oct 2021 00:14:51 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, alexei.starovoitov@gmail.com, ndesaulniers@google.com Subject: Re: [PATCH 4/9] x86/alternative: Implement .retpoline_sites support Message-ID: References: <20211013122217.304265366@infradead.org> <20211013123645.002402102@infradead.org> <20211013211118.apsj66c6b6abubeo@treble> <20211013220520.xzsp5q2amuwy6n6o@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013220520.xzsp5q2amuwy6n6o@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 03:05:20PM -0700, Josh Poimboeuf wrote: > On Wed, Oct 13, 2021 at 11:43:43PM +0200, Peter Zijlstra wrote: > > On Wed, Oct 13, 2021 at 02:11:18PM -0700, Josh Poimboeuf wrote: > > > On Wed, Oct 13, 2021 at 02:22:21PM +0200, Peter Zijlstra wrote: > > > > +#ifdef CONFIG_X86_64 > > > > + > > > > +/* > > > > + * CALL/JMP *%\reg > > > > + */ > > > > +static int emit_indirect(int op, int reg, u8 *bytes) > > > > > > X86_64 is already equivalent to STACK_VALIDATION these days, but might > > > as well clarify here where the retpoline_sites dependency comes from by > > > changing this to '#ifdef CONFIG_STACK_VALIDATION'. > > > > Yeah, I was contemplating having x86_64 unconditionally select that. > > Maybe we should. > > As far as I can tell, it already does that: > > select HAVE_STACK_VALIDATION if X86_64 > select HAVE_STATIC_CALL_INLINE if HAVE_STACK_VALIDATION > select STACK_VALIDATION if HAVE_STACK_VALIDATION && (HAVE_STATIC_CALL_INLINE || RETPOLINE) Oh right, I thought there was still a possible hole in there, but I guess that's pretty solid. I suppose we should just remove the && ... from the last line.