![]() Or some other obscure case where the culprit is hidden in kernel command And I won't wonder if all ofĪ sudden strange failures start to appear because code is queryingĬpuid features but some funny distro has disabled it in its kernel boot So opening the floodgates to people fiddling with this (not only On Fri, at 08:37:33PM +0400, Vladimir Davydov wrote:Īs they say in Star Wars: "I have a bad feeling about this." So, I think it logically extends the existing behavior. Yes, but who needs the current implementation of 'clearcpuid' which, in fact, just hides flags in /proc/cpuinfo while userspace apps will see and consequently use all CPU features? ![]() even on enabled hardware, only some of the bits are maskable. > If CPUID masking is supported, this will be reported inġ. > hypervisors that do not support/use Intel VT/AMD-V hardware-assisted > This can be useful for migration of virtual machines managed by > support it so that the features cleared won't be reported even by the > in kernel but also mask them in hardware for Intel and AMD CPUs that > The patch makes the clearcpuid boot option not only clear CPU features > irrespective of what features are cleared. ![]() > instruction, it will be reported about all features supported by the CPU > userpsace process checks CPU features directly using the cpuid > reported in /proc/cpuinfo and used by the kernel. > If 'clearcpuid=N' is specified in boot options, CPU feature #N won't be Unsigned int l2 = -474,6 +531,8 static void _cpuinit init_intel(struct cpuinfo_x86 *c) Static void _cpuinit init_intel(struct cpuinfo_x86 *c) + msr_cpuid_mask = intel_cpuid_mask_msr(c, &msr_ext_cpuid_mask) + unsigned int msr_cpuid_mask, msr_ext_cpuid_mask +static void _cpuinit intel_mask_cpu_caps(struct cpuinfo_x86 *c) +static unsigned int _cpuinit intel_cpuid_mask_msr(struct cpuinfo_x86 *c, +++ -358,6 +358,63 static void _cpuinit detect_vmx_virtcap(struct cpuinfo_x86 *c) + val &= ~((u64)cpu_caps_cleared microcode, &dummy) ĭiff -git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c + rdmsrl_amd_safe(MSR_AMD_CPUID_FEATURES_OVERRIDE, &val) +static void _cpuinit amd_mask_cpu_caps(struct cpuinfo_x86 *c) +#define MSR_AMD_EXT_CPUID_FEATURES_OVERRIDEĐxc0011005 +#define MSR_AMD_CPUID_FEATURES_OVERRIDE 0xc0011004 * Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ +#define X86_FEATURE_CPUIDMASK (3*32+29) /* CPUID feature masking */ #define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */ #define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ Hypervisors that do not support/use Intel VT/AMD-V hardware-assisted This can be useful for migration of virtual machines managed by Support it so that the features cleared won't be reported even by the In kernel but also mask them in hardware for Intel and AMD CPUs that The patch makes the clearcpuid boot option not only clear CPU features ![]() Irrespective of what features are cleared. Instruction, it will be reported about all features supported by the CPU Userpsace process checks CPU features directly using the cpuid Reported in /proc/cpuinfo and used by the kernel. If 'clearcpuid=N' is specified in boot options, CPU feature #N won't be
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |