Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4508268imd; Tue, 30 Oct 2018 03:11:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5cw/8qa7tUXO6vKQsPBh3QPudGn41rlTZrDA9SuE04wk0KyBjSMCNfPFZj31u93ZuT8895M X-Received: by 2002:a63:1919:: with SMTP id z25-v6mr17095954pgl.135.1540894272594; Tue, 30 Oct 2018 03:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540894272; cv=none; d=google.com; s=arc-20160816; b=ZebBaQ1FYsfq/nsWPeIQwibtAg2t0SzIo7go1bE8vPcdCpBHmb4sEaJPrFXykLn+6V E2AE6I2CeIMX+cSEDyF/QUYVJKD5M2jyRrb/Uw8YP87W2NaXxvjX+/z9ZDZeUQy07VbK 2Rj5PWwV2ExNfDYVu6d1BN6w2hsG+H00/VqNNOpniz0OoYw7iKmKnpyk3Td/CnptggDv 8ZHZROi5pPt6TJqtO6+hSQ5c9hwh1bi7AoGdEBcyQqUD6frEoc2ld/sc4tb/YPACvnbK OIs3m9nMTLlsuqzO0hHj1dLQasDfwTPyc+82UAqwvaVT2ev2RXyyIc0OVRjwvtuepAAx 7KFw== 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; bh=XhjwoH8+GWRr9XXZHE455Tgdoy/5aq911Rln+JBJLFo=; b=YJ7ONqv6cV37z5EO4w0k+AR9fKXVi3oog8H0JHJ+YVCOwp83BqI7xEIQCx0PaOa/OI ZNn2CkOyJl+lW4MMTchjpJpFWbUHyoB3Sz56Z9pH7RtTJykZNQt5Hk/tRqPvVqk//K3c lBYac+RVtDoNEDH69Pg0zN52w+xDb0H/HHkKS6ngdJEkQp6kbhkyouaJufQSl6xzEVfg XUlcKyh7PC6Y0rC7K3gxazlwjyt+59F0FuTiO5iguCIhTbL2mcofcZMQXBqkFmGz4Q2y eJRSZZijh5i/7AofQrODCUKXz8SZmbgxZh/fa4JS0e9Lh99nSWzl79WhywtL3Lx2zlAl uBPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Xs5fUYIj; 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 c2-v6si12776261plb.123.2018.10.30.03.10.56; Tue, 30 Oct 2018 03:11:12 -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=merlin.20170209 header.b=Xs5fUYIj; 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 S1726693AbeJ3TDY (ORCPT + 99 others); Tue, 30 Oct 2018 15:03:24 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45812 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbeJ3TDY (ORCPT ); Tue, 30 Oct 2018 15:03:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=XhjwoH8+GWRr9XXZHE455Tgdoy/5aq911Rln+JBJLFo=; b=Xs5fUYIjEeq4A48Ki5QEecCX6 jRRlB+fSYqGu/oVTVjXx3OeOITN0VzerRSF4vpbyPYNRDwHStHm3uNZwn4BO0LkBG2E/SnZumcFay mxmcCfY71ifxIwRDw9FnVPKxz1rohN5/7KbI8s42U19dLpcBhdUB1Ikugdr9hM/fmWtNX2edRPGIn 42rpTN0YidmvDvrWuch5rYOBe2P9p3tQFnX4hVfShh+LLikUQYueBbEAr32YYaXgkRQJPLSefO9KF nBaQRRq7kn5QT/9fp/ZEtWFQs6uszUA0Es3qUmMCYMR0hYzjK/420w4wNaYWWsgo0O+pQK+jNgas/ Ja1LVAlaw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHQyD-00021w-O4; Tue, 30 Oct 2018 10:09:58 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 28A1E2029FA14; Tue, 30 Oct 2018 11:09:54 +0100 (CET) Date: Tue, 30 Oct 2018 11:09:54 +0100 From: Peter Zijlstra To: Masahiro Yamada Cc: zhenzhong.duan@oracle.com, Linux Kernel Mailing List , Ingo Molnar , Andy Lutomirski , konrad.wilk@oracle.com, David Woodhouse , Thomas Gleixner , srinivas.eeda@oracle.com, Borislav Petkov , Daniel Borkmann , Michal Marek , "H. Peter Anvin" Subject: Re: [PATCH 1/3] retpolines: Only enable retpoline when compiler support it Message-ID: <20181030100954.GF744@hirez.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Oct 30, 2018 at 06:39:24PM +0900, Masahiro Yamada wrote: > Hi, > > > > On Tue, Oct 30, 2018 at 3:57 PM Zhenzhong Duan > wrote: > > > > Since retpoline capable compilers are widely available, make > > CONFIG_RETPOLINE hard depend on it. > > > > Change KBUILD to use CONFIG_RETPOLINE_SUPPORT to avoid conflict with > > CONFIG_RETPOLINE which is used by kernel. > > > > With all that stuff, the check of RETPOLINE is changed to > > CONFIG_RETPOLINE. > > > > This change is based on suggestion in https://lkml.org/lkml/2018/9/18/1016 > > > > Signed-off-by: Zhenzhong Duan > > Cc: Thomas Gleixner > > Cc: Peter Zijlstra > > Cc: Borislav Petkov > > Cc: Daniel Borkmann > > Cc: David Woodhouse > > Cc: H. Peter Anvin > > Cc: Ingo Molnar > > Cc: Konrad Rzeszutek Wilk > > Cc: Andy Lutomirski > > Cc: Masahiro Yamada > > Cc: Michal Marek > > --- > > > Instead of adding another CONFIG option, > does it make sense to add compiler support checks > to 'depends on' syntax ? > > > config RETPOLINE > bool "Avoid speculative indirect branches in kernel" > depends on $(cc-option,-mindirect-branch=thunk-extern > -mindirect-branch-register) || \ > $(cc-option,-mretpoline-external-thunk) > default y > select STACK_VALIDATION if HAVE_STACK_VALIDATION That seems to be what we did for stackprotector, which is similar in that it used to fail the build. So yes, this seems sane.