Re: [PATCH] x86/sev-es: Do not use copy_from_kernel_nofault in early #VC handler

From: Dave Hansen
Date: Fri Sep 08 2023 - 10:49:04 EST


On 9/8/23 06:13, Tom Lendacky wrote:
> On 9/7/23 14:12, Dave Hansen wrote:
>> But seriously, is it even *possible* to spin up a SEV-SNP VM what
>> doesn't have NX?
>
> It is a common path, so while an SEV guest would have NX support, you
> would first have to determine that it is an SEV guest. That would take
> issuing a CPUID instruction in order to determine if a particular MSR
> can be read...

I was thinking more along the lines of telling folks that if they want
to turn SEV-SNP support on, they also have to give up on running on a
!NX system. That would be a _bit_ nicer than just refusing to boot on
all !NX systems.

> Ultimately, we could probably pass the encryption mask from the
> decompressor to the kernel and avoid some of the checks during early
> boot of the kernel proper. Is it possible to boot an x86 kernel without
> going through the decompressor?

I think it's possible, but it's very unusual.