Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1499687
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 4/4] Add R3MWAIT to CPU features |
| Date | 2016-10-12 15:30 +0200 |
| Message-ID | <srrLA-4Wx-39@gated-at.bofh.it> (permalink) |
| References | <srqFP-4gb-5@gated-at.bofh.it> <srqPw-4jZ-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 12 Oct 2016, Grzegorz Andrejczuk wrote:
> diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
> index 8cb57df..e4ff3d0 100644
> --- a/arch/x86/kernel/cpu/scattered.c
> +++ b/arch/x86/kernel/cpu/scattered.c
> @@ -29,6 +29,7 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c)
> u32 max_level;
> u32 regs[4];
> const struct cpuid_bit *cb;
> + u64 misc_thd_enable;
>
> static const struct cpuid_bit cpuid_bits[] = {
> { X86_FEATURE_INTEL_PT, CR_EBX,25, 0x00000007, 0 },
> @@ -54,4 +55,8 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c)
> if (regs[cb->reg] & (1 << cb->bit))
> set_cpu_cap(c, cb->feature);
> }
> +
> + rdmsrl(MSR_PHI_MISC_THD_FEATURE, misc_thd_enable);
And what makes you sure that you can just use rdmsrl() unconditionally and
assume that the MSR is actually there? This breaks the world and some
more. Either make sure that this is only ran on PHI or simply use
rdmsrl_safe() which is safe everywhere,
> + if ((misc_thd_enable & MSR_PHI_MISC_THD_FEATURE_R3MWAIT) != 0)
if (misc_thd_enable & MSR_PHI_MISC_THD_FEATURE_R3MWAIT)
is entirely sufficient.
> + set_cpu_cap(c, X86_FEATURE_PHIR3MWAIT);
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 0/4] Enabling Ring 3 MONITOR/MWAIT feature for Knights Landing Grzegorz Andrejczuk <grzegorz.andrejczuk@intel.com> - 2016-10-12 14:20 +0200
[PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Grzegorz Andrejczuk <grzegorz.andrejczuk@intel.com> - 2016-10-12 14:20 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Thomas Gleixner <tglx@linutronix.de> - 2016-10-12 15:40 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Dave Hansen <dave.hansen@linux.intel.com> - 2016-10-12 16:50 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Thomas Gleixner <tglx@linutronix.de> - 2016-10-12 15:40 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Dave Hansen <dave.hansen@linux.intel.com> - 2016-10-12 18:40 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Thomas Gleixner <tglx@linutronix.de> - 2016-10-13 18:10 +0200
Re: [PATCH v2 2/4] Add enabling of the R3 MWAIT during boot for KNL Dave Hansen <dave.hansen@linux.intel.com> - 2016-10-12 19:30 +0200
[PATCH v2 4/4] Add R3MWAIT to CPU features Grzegorz Andrejczuk <grzegorz.andrejczuk@intel.com> - 2016-10-12 14:30 +0200
Re: [PATCH v2 4/4] Add R3MWAIT to CPU features Borislav Petkov <bp@suse.de> - 2016-10-12 15:00 +0200
Re: [PATCH v2 4/4] Add R3MWAIT to CPU features Thomas Gleixner <tglx@linutronix.de> - 2016-10-12 15:30 +0200
csiph-web