Re: [PATCH v2] x86/kvm: Handle async page faults directly through do_page_fault()

From: Paolo Bonzini
Date: Mon Mar 02 2020 - 05:41:28 EST


On 02/03/20 10:28, Nadav Amit wrote:
>
> 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.

Your concern is understandable. I think in this case Andy's patch makes
sense since there is a hooking mechanism that is used in exactly one
case and there are no performance issues in removing it. In fact if
more hypervisors implemented a #PF extension I would keep the static
branch, but use it to choose between a pvop and the default case; this
would be a much more localized change, so arguably better than trap_init.

Paolo