Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp64651imm; Wed, 3 Oct 2018 11:58:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV61dAtg/DCGX5ctPRdryCUrUI7/AxVBQEbk9JRT/YeKCWkXC+B8LuZ70WpqOzwjSbIe+ZH1n X-Received: by 2002:a17:902:b08e:: with SMTP id p14-v6mr3008006plr.241.1538593105574; Wed, 03 Oct 2018 11:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538593105; cv=none; d=google.com; s=arc-20160816; b=VzHO2u4ZZVuoCZVfzzjqct4jGddDxD8shoMm+wJ5Lc/0kkJmXIfZhW0RCntph1U38q GGXEDf0UH65zqqs4AIccUmh1ruUjLDvXITO0XM3wi/g69yjTCjHG+eTwHgxGCsQStpdz /CzmqbV/s/VE0AqKSD80bho8x7RcZgRRHY5FKGet6CLmotmeHmU23K6ao16tAxaW5BkI AFMLso6Gma6SQFii7ZcyxRafyE//cgwuZOWNwXKZGKAGRV/1xYoDA7QNmGTArHx25FAp u1hsvv/DL9OkwcIF6P+LLTKl37lYPBosmR14BkYhtY/6KpvMiMe/AWIC0W629qzVB84d lb7g== 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; bh=mSRn8s+ubBOS+VGAT++J2N1CC4JEB3eBkxP1+RCyCtM=; b=ErarPT/U5E/HIK4oi50oRc+pVB6fpbOPP1TU1uVdUEjABwTbWp2/pLWxJP8oiPc/g2 fx71cedlbRDg25iR8qjJXf7ZHWRy6S1W0mlO47Hb51DBOEa0uOWUyyNIhTKHjHo9k3tm SG9u/yIolCJ8WWmRRAEAdw2kbALGeDi6Dny+NiYbRlchMWsrLdK9W8RYZydoWFydFs3b zs4jaW1G0S4ueE51Lquaoq/gZ8royQgrD2DVFzxXK2KQloxDLh0h1GAjay834rIbT9aA njc/c0aoU5XWLy/L/aH9Pqy7VGUZ3zg0Tj0N3HDg8DLR6XzbZPvWH/7OyjCLbtzlf0AQ 1udA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si2397776pll.35.2018.10.03.11.58.10; Wed, 03 Oct 2018 11:58:25 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727353AbeJDBrY (ORCPT + 99 others); Wed, 3 Oct 2018 21:47:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43900 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726966AbeJDBrY (ORCPT ); Wed, 3 Oct 2018 21:47:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADE903082A26; Wed, 3 Oct 2018 18:57:45 +0000 (UTC) Received: from asgard.redhat.com (ovpn-200-25.brq.redhat.com [10.40.200.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCA7BBA5A; Wed, 3 Oct 2018 18:57:36 +0000 (UTC) Date: Wed, 3 Oct 2018 20:58:06 +0200 From: Eugene Syromiatnikov To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Subject: Re: [RFC PATCH v4 2/9] x86/cet/ibt: User-mode indirect branch tracking support Message-ID: <20181003185802.GE32759@asgard.redhat.com> References: <20180921150553.21016-1-yu-cheng.yu@intel.com> <20180921150553.21016-3-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180921150553.21016-3-yu-cheng.yu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 03 Oct 2018 18:57:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 08:05:46AM -0700, Yu-cheng Yu wrote: > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index bffa9ef47832..230f65ee881e 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -434,6 +435,23 @@ static __init int setup_disable_shstk(char *s) > __setup("no_cet_shstk", setup_disable_shstk); > #endif > > +#ifdef CONFIG_X86_INTEL_BRANCH_TRACKING_USER > +static __init int setup_disable_ibt(char *s) > +{ > + /* require an exact match without trailing characters */ > + if (strlen(s)) > + return 0; "s[0] (!= '\0')" will do the same check in constant time.