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]
Message-ID: <f4aaf005-8b72-9b68-87bc-8019f0199f0d@oracle.com>
Date:   Thu, 18 Nov 2021 09:31:27 +0000
From:   Liam Merwick <liam.merwick@...cle.com>
To:     Lai Jiangshan <jiangshanlai@...il.com>,
        linux-kernel@...r.kernel.org
Cc:     x86@...nel.org, Lai Jiangshan <laijs@...ux.alibaba.com>,
        Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>, Juergen Gross <jgross@...e.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Joerg Roedel <jroedel@...e.de>,
        Javier Martinez Canillas <javierm@...hat.com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Brijesh Singh <brijesh.singh@....com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH V5 46/50] x86/sev: Use C entry code

On 10/11/2021 11:57, Lai Jiangshan wrote:
> From: Lai Jiangshan <laijs@...ux.alibaba.com>
> 
> Use DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE to emit C entry function and
> use the function directly in entry_64.S.
> 

A drive-by comment as I was looking for SEV commits...

Typo in definition names, ETNRY -> ENTRY, (which impacts most patches 
between 38-48) would likely cause confusion in the future.

Regards,
Liam


> Signed-off-by: Lai Jiangshan <laijs@...ux.alibaba.com>
> ---
>   arch/x86/entry/entry_64.S       | 22 +---------------------
>   arch/x86/include/asm/idtentry.h |  1 +
>   arch/x86/kernel/Makefile        |  1 +
>   3 files changed, 3 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index 944cf85e67da..dfef02696319 100644
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -527,28 +527,8 @@ SYM_CODE_START(\asmsym)
>   
>   	UNWIND_HINT_REGS
>   
> -	/*
> -	 * paranoid_entry returns SWAPGS flag for paranoid_exit in EBX.
> -	 * EBX == 0 -> SWAPGS, EBX == 1 -> no SWAPGS
> -	 */
> -	call	paranoid_entry
> -
> -	UNWIND_HINT_REGS
> -
> -	/* Update pt_regs */
> -	movq	ORIG_RAX(%rsp), %rsi	/* get error code into 2nd argument*/
> -	movq	$-1, ORIG_RAX(%rsp)	/* no syscall to restart */
> -
>   	movq	%rsp, %rdi		/* pt_regs pointer */
> -
> -	call	kernel_\cfunc
> -
> -	/*
> -	 * No need to switch back to the IST stack. The current stack is either
> -	 * identical to the stack in the IRET frame or the VC fall-back stack,
> -	 * so it is definitely mapped even with PTI enabled.
> -	 */
> -	call	paranoid_exit
> +	call	ist_kernel_\cfunc
>   	jmp	restore_regs_and_return_to_kernel
>   
>   	/* Switch to the regular task stack */
> diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
> index 931b689f464c..84ce63f03c7f 100644
> --- a/arch/x86/include/asm/idtentry.h
> +++ b/arch/x86/include/asm/idtentry.h
> @@ -426,6 +426,7 @@ __visible __entry_text void ist_##func(struct pt_regs *regs)		\
>    * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE
>    */
>   #define DEFINE_IDTENTRY_VC_KERNEL(func)				\
> +	DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE(kernel_##func)	\
>   	DEFINE_IDTENTRY_RAW_ERRORCODE(kernel_##func)
>   
>   /**
> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
> index 28815c2e6cb2..9535d03aaa61 100644
> --- a/arch/x86/kernel/Makefile
> +++ b/arch/x86/kernel/Makefile
> @@ -52,6 +52,7 @@ CFLAGS_head$(BITS).o	+= -fno-stack-protector
>   CFLAGS_cc_platform.o	+= -fno-stack-protector
>   CFLAGS_traps.o		+= -fno-stack-protector
>   CFLAGS_nmi.o		+= -fno-stack-protector
> +CFLAGS_sev.o		+= -fno-stack-protector
>   
>   CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
>   
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ