Re: [PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler

2020-09-01 Thread Joerg Roedel
On Mon, Aug 31, 2020 at 01:30:02PM +0200, Borislav Petkov wrote: > AFAICT, that STACK_TYPE_UNKNOWN gets set only by the plain > get_stack_info() function - not by the _noinstr() variant so you'd need > to check the return value of latter... You are right, it needs to check the return value of get_

Re: [PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler

2020-08-31 Thread Borislav Petkov
On Mon, Aug 24, 2020 at 10:54:43AM +0200, Joerg Roedel wrote: > @@ -674,6 +675,56 @@ asmlinkage __visible noinstr struct pt_regs > *sync_regs(struct pt_regs *eregs) > return regs; > } > > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(stru

Re: [PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler

2020-08-31 Thread Borislav Petkov
On Mon, Aug 24, 2020 at 10:54:43AM +0200, Joerg Roedel wrote: > @@ -446,6 +448,82 @@ _ASM_NOKPROBE(\asmsym) > SYM_CODE_END(\asmsym) > .endm > ifdeffery pls... > +/** > + * idtentry_vc - Macro to generate entry stub for #VC > + * @vector: Vector number > + * @asmsym: ASM symb

[PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler

2020-08-24 Thread Joerg Roedel
From: Joerg Roedel The #VC handler needs special entry code because: 1. It runs on an IST stack 2. It needs to be able to handle nested #VC exceptions To make this work the entry code is implemented to pretend it doesn't use an IST stack. When entered from user-mode or early SY