lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf8dec95-d85c-1074-fd65-d89230e930e1@intel.com>
Date:   Fri, 17 Sep 2021 10:52:02 +0800
From:   Chenyi Qiang <chenyi.qiang@...el.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Tony Luck <tony.luck@...el.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Xiaoyao Li <xiaoyao.li@...el.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH] x86/bus_lock: Don't assume the init value of
 DEBUGCTLMSR.BUS_LOCK_DETECT to be zero

Kindly ping for this minor change.

Thanks
Chenyi

On 9/1/2021 4:40 PM, Chenyi Qiang wrote:
> It's possible that BIOS/firmware has set DEBUGCTLMSR_BUS_LOCK_DETECT, or
> this kernel has been kexec'd from a kernel that enabled bus lock
> detection.
> 
> Disable bus lock detection explicitly if not wanted.
> 
> Signed-off-by: Chenyi Qiang <chenyi.qiang@...el.com>
> Reviewed-by: Tony Luck <tony.luck@...el.com>
> ---
>   arch/x86/kernel/cpu/intel.c | 27 ++++++++++++++-------------
>   1 file changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 8321c43554a1..38dda04d9342 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -1152,22 +1152,23 @@ static void bus_lock_init(void)
>   {
>   	u64 val;
>   
> -	/*
> -	 * Warn and fatal are handled by #AC for split lock if #AC for
> -	 * split lock is supported.
> -	 */
> -	if (!boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT) ||
> -	    (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) &&
> -	    (sld_state == sld_warn || sld_state == sld_fatal)) ||
> -	    sld_state == sld_off)
> +	if (!boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT))
>   		return;
>   
> -	/*
> -	 * Enable #DB for bus lock. All bus locks are handled in #DB except
> -	 * split locks are handled in #AC in the fatal case.
> -	 */
>   	rdmsrl(MSR_IA32_DEBUGCTLMSR, val);
> -	val |= DEBUGCTLMSR_BUS_LOCK_DETECT;
> +
> +	if ((boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) &&
> +	    (sld_state == sld_warn || sld_state == sld_fatal)) ||
> +	    sld_state == sld_off) {
> +		/*
> +		 * Warn and fatal are handled by #AC for split lock if #AC for
> +		 * split lock is supported.
> +		 */
> +		val &= ~DEBUGCTLMSR_BUS_LOCK_DETECT;
> +	} else {
> +		val |= DEBUGCTLMSR_BUS_LOCK_DETECT;
> +	}
> +
>   	wrmsrl(MSR_IA32_DEBUGCTLMSR, val);
>   }
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ