Re: [PATCH v6 42/76] x86/sev-es: Setup early #VC handler

2021-09-05 Thread Juergen Gross via Virtualization
On 04.09.21 11:39, Lai Jiangshan wrote: @@ -363,6 +370,33 @@ SYM_CODE_START_LOCAL(early_idt_handler_common) jmp restore_regs_and_return_to_kernel SYM_CODE_END(early_idt_handler_common) +#ifdef CONFIG_AMD_MEM_ENCRYPT +/* + * VC Exception handler used during very early boot. The + *

Re: [PATCH v6 42/76] x86/sev-es: Setup early #VC handler

2020-09-01 Thread Borislav Petkov
On Tue, Sep 01, 2020 at 02:59:22PM +0200, Joerg Roedel wrote: > True, but having a separate function might be handy when support for #VE > and #HV is developed. Those might also need to setup their early > handlers here, no? Ok. -- Regards/Gruss, Boris.

Re: [PATCH v6 42/76] x86/sev-es: Setup early #VC handler

2020-09-01 Thread Joerg Roedel
On Mon, Aug 31, 2020 at 11:45:41AM +0200, Borislav Petkov wrote: > On Mon, Aug 24, 2020 at 10:54:37AM +0200, Joerg Roedel wrote: > > +#ifdef CONFIG_AMD_MEM_ENCRYPT > > + /* VMM Communication Exception */ > > + handler = fixup_pointer(vc_no_ghcb, physbase); > > + set_early_idt_handler(idt,

Re: [PATCH v6 42/76] x86/sev-es: Setup early #VC handler

2020-08-31 Thread Borislav Petkov
On Mon, Aug 24, 2020 at 10:54:37AM +0200, Joerg Roedel wrote: > +#ifdef CONFIG_AMD_MEM_ENCRYPT > +static void set_early_idt_handler(gate_desc *idt, int n, void *handler) > +{ > + struct idt_data data; > + gate_desc desc; > + > + init_idt_data(, n, handler); > + idt_init_desc(, ); >

[PATCH v6 42/76] x86/sev-es: Setup early #VC handler

2020-08-24 Thread Joerg Roedel
From: Joerg Roedel Setup an early handler for #VC exceptions. There is no GHCB mapped yet, so just re-use the vc_no_ghcb_handler. It can only handle CPUID exit-codes, but that should be enough to get the kernel through verify_cpu() and __startup_64() until it runs on virtual addresses.