lkml.org 
[lkml]   [2020]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 15/26] x86/alternatives: Non-emulated text poking
On Tue, Apr 07, 2020 at 10:03:12PM -0700, Ankur Arora wrote:
> +static void __maybe_unused sync_one(void)
> +{
> + /*
> + * We might be executing in NMI context, and so cannot use
> + * IRET as a synchronizing instruction.
> + *
> + * We could use native_write_cr2() but that is not guaranteed
> + * to work on Xen-PV -- it is emulated by Xen and might not
> + * execute an iret (or similar synchronizing instruction)
> + * internally.
> + *
> + * cpuid() would trap as well. Unclear if that's a solution
> + * either.
> + */
> + if (in_nmi())
> + cpuid_eax(1);
> + else
> + sync_core();
> +}

That's not thinking staight; what do you think the INT3 does when it
happens inside an NMI ?

\
 
 \ /
  Last update: 2020-04-08 13:15    [W:0.180 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site