lkml.org 
[lkml]   [2012]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86, efi: 1:1 pagetable mapping for virtual EFI calls
From
Date
On Fri, 2012-09-07 at 08:43 +0100, Jan Beulich wrote:
> >>> On 06.09.12 at 17:47, Matt Fleming <matt.fleming@intel.com> wrote:
> > On Thu, 2012-09-06 at 15:34 +0100, Jan Beulich wrote:
> >> >>> On 06.09.12 at 15:15, Matt Fleming <matt@console-pimps.org> wrote:
> >> > +
> >> > + pgd += i;
> >> > + save[i] = *pgd;
> >> > + set_pgd(pgd, efi_one_to_one_pgd[i]);
> >> > + }
> >>
> >> Did you, as an alternative, consider switching to a different
> >> CR3 instead of copying back and forth?
> >
> > I did consider it, but I couldn't convince myself whether or not the EFI
> > pagetable would need to be manually kept in sync with any other
> > pagetables. But now I look at the code a bit harder, it seems that
> > should be taken care of automatically. In fact, the tboot code seems to
> > do something similar. I'll try that approach.
>
> Actually, I think the copying approach is even broken - what if
> multiple threads currently on the same address space want to
> invoke a runtime call simultaneously? The first one to get here
> would save the right values, but the second one wouldn't.

Yeah, unfortunately I only realised that after I'd sent the patch.
Switching pagetables around efi calls is a much better approach.



\
 
 \ /
  Last update: 2012-09-07 10:43    [W:0.050 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site