Re: [PATCH v2] x86/kernel: skip ROM range scans and validation for SEV-SNP guests

From: Ard Biesheuvel
Date: Fri Mar 08 2024 - 06:46:32 EST


On Fri, 8 Mar 2024 at 12:01, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Fri, Mar 08, 2024 at 11:30:50AM +0100, Ard Biesheuvel wrote:
> > Agree with the analysis and the conclusion. However, this will need to
> > be split into generic and x86 specific changes, given that the DMI
> > code is shared between all architectures, and explicitly checking for
> > SEV-SNP support in generic code is not appropriate.
> >
> > So what we will need is:
>
> I was actually thinking of:
>
> x86_init.resources.probe_roms = snp_probe_roms;
>
> and snp_probe_roms() is an empty stub.
>
> Problem solved without ugly sprinkling of checks everywhere.
>

Indeed. Setting the override could be done in
init_hypervisor_platform(), which is called right before from
setup_arch().