Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp231540lqp; Fri, 12 Apr 2024 16:18:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHhfmUSa2HKdW1VUPsBQOQ+a8jq2EFSflLf91Dc2wQ5UG5GenGnvTcndf1owTl19vtHvxWbsSa7RR7XA1bqdqcjn07TkIui6rnjsbP2Q== X-Google-Smtp-Source: AGHT+IHFyi/Q7uujdpevcPP79+Q8K7y5h8GagPgcftE4vAEdrKnfYRqVVIzEVFBv6aiGkfQI0l8N X-Received: by 2002:a50:9e4e:0:b0:566:2f24:b063 with SMTP id z72-20020a509e4e000000b005662f24b063mr2934193ede.23.1712963920185; Fri, 12 Apr 2024 16:18:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712963920; cv=pass; d=google.com; s=arc-20160816; b=Eg5+aq3g1moRkhXHRXgw8zxvdfhJG4TvBc0qJkzaO5Iygm48836v0E5Uepb2vOMvvu jS42SaezpxwN3cXMnzizCVFkwKeD+RsarniGp4TFgmxzUxoQ3ewFjdH+5xfLkECfsKPq VTIFevio/h8dR00tqGPix4iJyHQT/n3lTen1EVx0OVawUnbHyZV/L0HKMt6JW/bY1gFP 8b4FvDu/nCENq1Cao9Ta7lO9qj6HR6+RZ9jV1eiwAybMvO+LX9l/ibZ6omjPRzRytJ6B isLytDjFLn9jocVPZQfxxIV6B+Y861/XuaV1jX1Z6a5NC10IZxuXWxYjtr5GDwqqVJl8 uq2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MkuMbrAsN7uKArQ+FyaFyT2lUHVy4HOOVSMB2cJ51KU=; fh=W9Rcs4VAg/DYjw+/+S8xv3mMbYvRNu6xLU0HHR1YY+c=; b=a7779asLgwh+IuRkK2PqzPTER6fiBp4K1xokv1OT6J2u97UykN9BoGp41lCaLBwGBi go7OW/lKvYlayRR/gjjQT/a6pIpVdnOsLvuT5aFM3B47psD4NMk9OxZCflmY71DeN50/ m0XXPTG3A/Hgm+/y1BhN6UpCEl03sW+3bkSx0w3T5dUkMYdtlKXniyKynHMIoHmGNFT8 m3UDDxw7ky+GouuAx1S9M5ZQtpamDLwx06B7zzLQLkFQYR3izDa0nYUpPHbDRuDSCQol Nv/hNUvAkZzfD39iPmK2XKt9iK37oo5ExgW1HvatYaZXF4c1w/AR8e08Viv7U3D38vgZ tyJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EY8z3CLX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-143426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a27-20020a509b5b000000b0056715a786ffsi2019370edj.544.2024.04.12.16.18.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 16:18:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EY8z3CLX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-143426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9AE561F22644 for ; Fri, 12 Apr 2024 23:18:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 267DB152510; Fri, 12 Apr 2024 23:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EY8z3CLX" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C87B44F88A for ; Fri, 12 Apr 2024 23:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712963913; cv=none; b=aIm0pvKiZDq9ItX9w3QG3ESR37hXd4GxHGYF7+GPSmz9Ir1z7KOb9aRoG1n0ztvK3gcqU7/C9qn8ZvEUazN5AhpPVA9sIgMqVUXM7tJm9RY2XQFdTiq+XLRF2+BpAqpCTd19eINrKROWlfqN1wkpYmnTT65UXSa8szvlvbxgRfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712963913; c=relaxed/simple; bh=T6w/dY9iG0zkHv9Tv196kf4Z/Xh1jcarNRLPTU311bE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZtvM2ZfLGkYNSVHUoOsRYfdxpDOuh9CZ8taMNQgh96CjHOM8J7wrNrjbDmuaFNwm8Cg9IUGZpAtZauB9RPbpMQROeKl1AaqG9CGG+nELKUVLdnPEDiSNqOQi5kUfA6Xrm7zam7P5SZhDEZQ5k1qE6tO6nvfi7++dHI5HF9qOCB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=EY8z3CLX; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712963912; x=1744499912; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=T6w/dY9iG0zkHv9Tv196kf4Z/Xh1jcarNRLPTU311bE=; b=EY8z3CLXqiK+YNDV31eWGkPRatNbo6DCS8VQdHqH1qaZrlkuVyD+2flX NT6JA7LUFIHXezZcXL/35YjDjIqubbQTqKR+Rxr2lfBXZkIbrMs3FdbsC Yjaumn2kmQGDW83f7Yr1yxNaIeYzLnf4HR6tKERslZg9bzoX+neZe96me C1W2kDwmgYXuBWTvC8BCSAsK6ivK4KSuOLW++3ZnZfd4195kfS2FLmWU3 A1pUXW4AWjgE5z9p0gwgpRJUMVqN0ku/aIGQfPdkGJC1hdRvCtz3STB7O VDH2DWpOu3KlloXS0rXy5Jhgmt3pZn9IvLYBMj10YnTuxFsXqAXccGlMb A==; X-CSE-ConnectionGUID: M4QYbQsDQlWI/tW647BBoQ== X-CSE-MsgGUID: xMTw5kaZR+a38A7fkwNPOg== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="12219493" X-IronPort-AV: E=Sophos;i="6.07,197,1708416000"; d="scan'208";a="12219493" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 16:18:31 -0700 X-CSE-ConnectionGUID: Sxtt5eLgTweMS8EKqszuMw== X-CSE-MsgGUID: PxE1jPwPQqK7Yakd622N0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,197,1708416000"; d="scan'208";a="25791259" Received: from ttmartin-mobl1.amr.corp.intel.com (HELO desk) ([10.209.4.27]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 16:18:30 -0700 Date: Fri, 12 Apr 2024 16:18:21 -0700 From: Pawan Gupta To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov , Ingo Molnar Subject: Re: [PATCH 2/3] x86/bugs: Fix BHI retpoline check Message-ID: <20240412231648.orlj7lomjaqqj7mz@desk> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 12, 2024 at 11:10:33AM -0700, Josh Poimboeuf wrote: > Confusingly, X86_FEATURE_RETPOLINE doesn't mean retpolines are enabled, > as it also includes the original "AMD retpoline" which isn't a retpoline > at all. > > Also replace cpu_feature_enabled() with boot_cpu_has() because this is > before alternatives are patched and cpu_feature_enabled()'s fallback > path is slower than plain old boot_cpu_has(). > > Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob") > Signed-off-by: Josh Poimboeuf Reviewed-by: Pawan Gupta