lkml.org 
[lkml]   [2020]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/ioremap: Map EFI runtime services data as encrypted for SEV
On Tue, Mar 10, 2020 at 01:40:03PM +0100, Borislav Petkov wrote:
> On Tue, Feb 25, 2020 at 09:42:07AM -0600, Tom Lendacky wrote:
> > @@ -135,6 +135,13 @@ static void __ioremap_check_mem(resource_size_t addr, unsigned long size,
> > memset(desc, 0, sizeof(struct ioremap_desc));
> >
> > walk_mem_res(start, end, desc, __ioremap_collect_map_flags);
> > +
> > + /*
> > + * The EFI runtime services data area is not covered by walk_mem_res(),
> > + * but must be mapped encrypted when SEV is active.
> > + */
> > + if (sev_active() && efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA)
> > + desc->flags |= IORES_MAP_ENCRYPTED;
> > }
>
> Why isn't this done in __ioremap_check_encrypted() which is exactly for
> SEV stuff like that?

See the comment added in the patch, walk_mem_res() does not iterate over
the resource which contains EFI_RUNTIME_SERVICES_DATA, so
__ioremap_check_encrypted() will not be called on that resource.

walk_system_ram_range() might do the job, but calling it only for
EFI_RUNTIME_SERVICES_DATA has some overhead.

Regards,

Joerg

\
 
 \ /
  Last update: 2020-03-10 14:04    [W:0.079 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site