How To
Summary
In some systems, HLE "Hardware Lock Elision" is required to be off as a feature / flag on a RHEL systems for some application specific reasons. The steps below will let you know how to configure your system to disable this feature/flag, and how to identify the flag/feature identity number.
Steps
[root@knop1 ~]# cat /proc/cpuinfo | grep hle
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm
constant_tsc rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes
xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb tpr_shadow vnmi flexpriority ept vpid fsgsbase
bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt arat md_clear spec_ctrl
clearcpuid=BITNUM[,BITNUM...] [X86]
Disable CPUID feature X for the kernel. See
arch/x86/include/asm/cpufeatures.h for the valid bit
numbers. Note the Linux specific bits are not necessarily
stable over kernel options, but the vendor specific
ones should be.
Also note that user programs calling CPUID directly
or using the feature without checking anything
will still see it. This just prevents it from
being used by the kernel or shown in /proc/cpuinfo.
Also note the kernel might malfunction if you disable
some critical bits.
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
#define X86_FEATURE_TSC_ADJUST ( 9*32+ 1) /* TSC adjustment MSR 0x3B */
#define X86_FEATURE_SGX ( 9*32+ 2) /* Software Guard Extensions */
#define X86_FEATURE_BMI1 ( 9*32+ 3) /* 1st group bit manipulation extensions */
#define X86_FEATURE_HLE ( 9*32+ 4) /* Hardware Lock Elision */
9 × 32 + 4 = 292
Our decimal value for clearcpuid kernel parameter is 292 , clearcpuid=292
5. We will need to apply it to CMDLINE in grub so the system will boot with that parameter :
5.1. Modify the /etc/default/grub as shown and add ONLY clearcpuid=292 at the end of the CMDLINE like below :
[root@knop1 ~]# vi /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet elevator=noop clearcpuid=292 "
GRUB_DISABLE_RECOVERY="true"
5.2. Save and Quit.
5.3. Run the below command to rebuild the grub configuration file :
grub2-mkconfig -o /boot/grub2/grub.cfg
[root@knop1 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-957.65.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.65.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-957.61.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.61.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-957.56.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.56.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-cbb00030e5204543a0474ffff17ec26f
Found initrd image: /boot/initramfs-0-rescue-cbb00030e5204543a0474ffff17ec26f.img
done
5.4. Reboot the system and you will see that the feature is now disabled
5.5 When the system boots you can check by running the below command :
cat /proc/cpuinfo | grep -i hle
output should be looking like the below without the HLE feature/flag :
[root@knop1 ~]# cat /proc/cpuinfo | grep -i hle
[root@knop1 ~]#
Document Location
Worldwide
Product Synonym
Linux; RHEL;
Was this topic helpful?
Document Information
Modified date:
11 February 2021
UID
ibm16414755