[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzLmr/vmYZozeUKm@hirez.programming.kicks-ass.net>
Date: Tue, 27 Sep 2022 14:03:59 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Ricardo Neri <ricardo.neri@...el.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Ben Segall <bsegall@...gle.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Len Brown <len.brown@...el.com>, Mel Gorman <mgorman@...e.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Steven Rostedt <rostedt@...dmis.org>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Valentin Schneider <vschneid@...hat.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, "Tim C . Chen" <tim.c.chen@...el.com>
Subject: Re: [RFC PATCH 22/23] x86/hreset: Configure history reset
On Fri, Sep 09, 2022 at 04:12:04PM -0700, Ricardo Neri wrote:
> +static u32 hardware_history_features __read_mostly;
__ro_after_init ?
> +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);
> +
> + if (!hardware_history_features)
> + return;
> +
> + wrmsrl(MSR_IA32_HW_HRESET_ENABLE, hardware_history_features);
> +
> + pr_info_once("x86/cpu: Intel History Reset (HRESET) activated\n");
> +}
> +
> /* These bits should not change their value after CPU init is finished. */
> static const unsigned long cr4_pinned_mask =
> X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |
Powered by blists - more mailing lists