Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1721755rdb; Sat, 3 Feb 2024 21:05:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6p7Lc7q8ZtDX/Aje+fkril3tVWCmA5FDiUJGNfN0IM7hLlSYP5EkYKNX+P3EoEuZ7CUKH X-Received: by 2002:a05:6a20:c702:b0:19e:5fc6:7cc8 with SMTP id hi2-20020a056a20c70200b0019e5fc67cc8mr2262697pzb.6.1707023131761; Sat, 03 Feb 2024 21:05:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707023131; cv=pass; d=google.com; s=arc-20160816; b=RsmUsO5s34MqsNdcvX5ph4daQ517j4zmus7BkcuW4TJkPKd4ziAlzmpsw2pRiR1+RQ ilZ/oH8iruoN2G/kFQz51hNNp/D87mMV1CRxdWLSuwMggfqT8abDWgy9NJuElDSSUZ6k bfINYKF1OUZhNHJmPyZ+dyIG/YtrpWgGGGSCAD8a/vVjrgXI7QemmHnSW+2mSO09yEUx rqswa4P9ToggjzPB+uEDiTqHbvyqkoD2glCgBTZ0c3fkKpJ+Bpo7LTCdjh/KnkhHtmAA mBO7/aXU756ghv0hNAriZJNKmOtMNKDXhWaa78GoEEUqV5LVh0YBFoSsVTTSpTNmLOVh dGPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=SdCRfDnpFif4GRGeLqr0U0lDC/ZI6O091y4/sovBbo8=; fh=AENzb2ulgoSTu7FEng5vikllGEmNIAf98X2pjZzEyDA=; b=AWnAkutXpJYMvE3sJnq7bk1YJgTDJsujMgYSap8zw1w7kFkVFbMPOqLZZo7IFOgifT xV2eyGF/skG3ihlqRFuFxR5/J2hSyQEnuSRU2WFnBPwCiXUDb5lCLuGg5CDmifn3UKna QoxTNOmwsvpvt9AHfyi0vMLFaWiz2SvFMYsq+RApkSeVpT8LcXM59/qme47vlOqGPv0z mJnxexOoXAOr/vXUqsDaL+O0wLhQgSFDEMW0iRnfgUWeKMLYu25V8nK0zfvm+3+ZOVdK fYcAMwQAwWRIXqWL+cn30pINtm5/aKWpegWpA+2/gFYOt53tKhTgPWDN22se2EthdeJz t72g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XduU2Sx7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51414-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXTDratdO+YTY7SPvX1BeZf05PCnpRG/lu0MzuwW3XKuKPu7dMmsjqSmw6ja7o34MzBdV/XEJAsgBi8iAVs/lpHKmcKALA0UVdkEHpinA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a23-20020a634d17000000b005dbd1e55743si4108149pgb.300.2024.02.03.21.05.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 21:05:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XduU2Sx7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51414-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51414-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EB458B21659 for ; Sun, 4 Feb 2024 03:54:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D9A21C13; Sun, 4 Feb 2024 03:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XduU2Sx7" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 EDC6B1C3D; Sun, 4 Feb 2024 03:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707018875; cv=none; b=CYamM+SRbtl/RRd6KdXW4JhsB6Itc+6xzG1U9EXPDLVRiCNu+xjVV+Fmw9tOzQT5N/PEcshPUKyJImHQWe3dkeathxGAfJi4NnnIyyGwgAFyKI83emaQWyquAWVYA8b8cD/WadOrYkwpoHT0lu3mYfik4Q3jJEyZnlHjlugUnY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707018875; c=relaxed/simple; bh=MbsFIpM7N+amsaNUWqQJtMZx6IckQhPTwMVERfrtk0A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZMSNUxWrK/apiBJWu986Iat/1/U4jmph1TAN/OHeTZg1yL1YNL95cIihn6qt8D4M1YbSMu1N1Uh0fon9STz5z6ofxAPRO4vc/ejw+IyIpbOkHCLJFZ/b8APKEAYCbl7Pt4AWTJywDsdSJn0k87xjMhnWc7VvLvVdcBIn+FMph5Q= 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=XduU2Sx7; arc=none smtp.client-ip=198.175.65.16 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=1707018874; x=1738554874; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=MbsFIpM7N+amsaNUWqQJtMZx6IckQhPTwMVERfrtk0A=; b=XduU2Sx7KcW6R6SABvKCEwGKU1Vqh9z1q7h7y+DS+FlhnZqeKweY05ci IX9fG2WCfRl2azERXrrtpKIOD6cAvbpaS+7WaHB8QGE3mQjm2d7myYR4D c8PDbVxjYh31+TZS1xph+lwGe9fAEtLaxP2JHN54MJmYIBzxpiFCjZdSm 6HoFjeT5DlsHjiDfOlnWlPVyKsWq4cgjgox9jbUm9jepKYCVwyCIGrsBO MNZDZaPnyqhB8CqEcZjY33yCNGWpdqLooJTGlnBePgQEwSOS7vEwOLVh2 E+cQnDczjMQbvQkOjGtClwcOx8IhUAZIFvyD69yu2n6VNZAgiPM1ybsR1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10973"; a="536103" X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="536103" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2024 19:54:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,242,1701158400"; d="scan'208";a="5173271" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2024 19:54:33 -0800 Date: Sat, 3 Feb 2024 19:55:52 -0800 From: Ricardo Neri To: Borislav Petkov Cc: "Rafael J. Wysocki" , Len Brown , Srinivas Pandruvada , Stanislaw Gruszka , Zhao Liu , Zhuocheng Ding , x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhao Liu Subject: Re: [PATCH 8/9] x86/hreset: Configure history reset Message-ID: <20240204035552.GC26316@ranerica-svr.sc.intel.com> References: <20240203040515.23947-1-ricardo.neri-calderon@linux.intel.com> <20240203040515.23947-9-ricardo.neri-calderon@linux.intel.com> <20240203093857.GBZb4JsahiDx2Ouegj@fat_crate.local> 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: <20240203093857.GBZb4JsahiDx2Ouegj@fat_crate.local> User-Agent: Mutt/1.9.4 (2018-02-28) On Sat, Feb 03, 2024 at 10:38:57AM +0100, Borislav Petkov wrote: > On Fri, Feb 02, 2024 at 08:05:14PM -0800, Ricardo Neri wrote: > > +static __always_inline void setup_hreset(struct cpuinfo_x86 *c) > > +{ > > + if (!cpu_feature_enabled(X86_FEATURE_HRESET)) > > + return; > > + > > + /* > > + * Use on all CPUs the hardware history features that the boot > > + * CPU supports. > > + */ > > + if (c == &boot_cpu_data) > > + hardware_history_features = cpuid_ebx(0x20); > > That's not what this does - that sets hardware_history_features on the > BSP. I meant to say that we will use the features that the BSP supports and use them to configure all other CPUs. I will reword the comment to make this clear. > > Why isn't this whole thing called in bsp_init_intel()? The register MSR_IA32_HW_HRESET_ENABLE needs to be configured on each CPU. I can set hardware_history_features from bsp_init_intel() but I still need to call setup_hreset() on every CPU.