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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Jul 2015 11:56:38 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Andy Lutomirski <luto@...nel.org>
Cc:	X86 ML <x86@...nel.org>, linux-kernel@...r.kernel.org,
	Willy Tarreau <w@....eu>, Borislav Petkov <bp@...en8.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 1/5] x86/entry/32: Clean up enable_sep_cpu to prepare
 for 64-bit merge

On Thu, 23 Jul 2015 08:31:39 -0700
Andy Lutomirski <luto@...nel.org> wrote:

> Switch from wrmsr to wrmsrl_safe to prepare to merge the 32-bit and
> 64-bit code, and use __KERNEL_CS explicitly to initialize
> MSR_IA32_SYSENTER_CS.  While we're at it, tweak the whitespace a
> bit.

Saying "prepare to merge the 32-bit and 64-bit" isn't that informative
to why this patch is needed. Can you please describe in the change log
what can fault with the wrmsr call, when we do the merge?

Thanks!

-- Steve


> 
> Signed-off-by: Andy Lutomirski <luto@...nel.org>
> ---
>  arch/x86/kernel/cpu/common.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 922c5e0cea4c..9b3a43583f81 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -1001,15 +1001,13 @@ void enable_sep_cpu(void)
>  	 * We cache MSR_IA32_SYSENTER_CS's value in the TSS's ss1 field --
>  	 * see the big comment in struct x86_hw_tss's definition.
>  	 */
> -
>  	tss->x86_tss.ss1 = __KERNEL_CS;
> -	wrmsr(MSR_IA32_SYSENTER_CS, tss->x86_tss.ss1, 0);
> -
> -	wrmsr(MSR_IA32_SYSENTER_ESP,
> -	      (unsigned long)tss + offsetofend(struct tss_struct, SYSENTER_stack),
> -	      0);
>  
> -	wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long)entry_SYSENTER_32, 0);
> +	wrmsrl_safe(MSR_IA32_SYSENTER_CS, __KERNEL_CS);
> +	wrmsrl_safe(MSR_IA32_SYSENTER_ESP,
> +		    (unsigned long)tss +
> +		    offsetofend(struct tss_struct, SYSENTER_stack));
> +	wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (unsigned long)entry_SYSENTER_32);
>  
>  out:
>  	put_cpu();

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ