lkml.org 
[lkml]   [2021]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH Part1 RFC v2 16/20] x86/kernel: Validate rom memory before accessing when SEV-SNP is active
On Fri, Apr 30, 2021 at 07:16:12AM -0500, Brijesh Singh wrote:
> + /*
> + * The ROM memory is not part of the E820 system RAM and is not pre-validated
> + * by the BIOS. The kernel page table maps the ROM region as encrypted memory,
> + * the SEV-SNP requires the encrypted memory must be validated before the
> + * access. Validate the ROM before accessing it.
> + */
> + n = ((system_rom_resource.end + 1) - video_rom_resource.start) >> PAGE_SHIFT;
> + early_snp_set_memory_private((unsigned long)__va(video_rom_resource.start),
> + video_rom_resource.start, n);

From last review:

I don't like this sprinkling of SNP-special stuff that needs to be done,
around the tree. Instead, pls define a function called

snp_prep_memory(unsigned long pa, unsigned int num_pages, enum operation);

or so which does all the manipulation needed and the callsites only
simply unconditionally call that function so that all detail is
extracted and optimized away when not config-enabled.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-05-27 13:50    [W:0.332 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site