lkml.org 
[lkml]   [2020]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] x86/kvm: Handle async page faults directly through do_page_fault()
From
Date
> On Feb 29, 2020, at 9:50 AM, Andy Lutomirski <luto@kernel.org> wrote:
>
> KVM overloads #PF to indicate two types of not-actually-page-fault
> events. Right now, the KVM guest code intercepts them by modifying
> the IDT and hooking the #PF vector. This makes the already fragile
> fault code even harder to understand, and it also pollutes call
> traces with async_page_fault and do_async_page_fault for normal page
> faults.
>
> Clean it up by moving the logic into do_page_fault() using a static
> branch. This gets rid of the platform trap_init override mechanism
> completely.
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>

Indeed the async-PF mechanism is only used by KVM, and there is no need for
over-engineering the solution just in case some other hypervisor ever
introduces support for a similar paravirtual feature.

Yet, this might be a slippery slope, making Linux optimized to run on KVM
(and maybe Xen). In other words, I wonder whether a similar change was
acceptable for a paravirtual feature that is only supported by a proprietary
hypervisor, such as Hyper-V or VMware.

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