Displaying 3 results from an estimated 3 matches for "switch_stack_to".
2020 Jun 23
2
Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace)
...ke this upon entering the handler;
build_pt_regs();
RSP = pt_regs->sp;
if (RSP in VC_IST_stack)
error("unallowed nesting")
if (RSP in current_kernel_stack)
RSP = round_down_to_8(RSP)
else
RSP = current_top_of_stack() // non-ist kernel stack
copy_pt_regs(pt_regs, RSP);
switch_stack_to(RSP);
To make this NMI safe, the NMI handler needs some logic too. Upon
entering NMI, it needs to check the return RSP, and if it is in the #VC
IST stack, it must do the above flow by itself and update the return RSP
and RIP. It needs to take into account the case when PT_REGS is not
fully populat...
2020 Jun 23
0
Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace)
...RSP = pt_regs->sp;
>
> if (RSP in VC_IST_stack)
> error("unallowed nesting")
>
> if (RSP in current_kernel_stack)
> RSP = round_down_to_8(RSP)
> else
> RSP = current_top_of_stack() // non-ist kernel stack
>
> copy_pt_regs(pt_regs, RSP);
> switch_stack_to(RSP);
>
> To make this NMI safe, the NMI handler needs some logic too. Upon
> entering NMI, it needs to check the return RSP, and if it is in the #VC
> IST stack, it must do the above flow by itself and update the return RSP
> and RIP. It needs to take into account the case when PT_...
2020 Apr 25
5
[PATCH] Allow RDTSC and RDTSCP from userspace
On Sat, Apr 25, 2020 at 1:23 PM Joerg Roedel <joro at 8bytes.org> wrote:
>
> On Sat, Apr 25, 2020 at 12:47:31PM -0700, Andy Lutomirski wrote:
> > I assume the race you mean is:
> >
> > #VC
> > Immediate NMI before IST gets shifted
> > #VC
> >
> > Kaboom.
> >
> > How are you dealing with this? Ultimately, I think that NMI will need