]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
x86/kvm: Restrict ASYNC_PF to user space
authorThomas Gleixner <tglx@linutronix.de>
Fri, 24 Apr 2020 07:57:56 +0000 (09:57 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 19 May 2020 13:53:58 +0000 (15:53 +0200)
commit3a7c8fafd1b42adea229fd204132f6a2fb3cd2d9
treed6c61c727071a69330cf131d71f44c46ef1d6670
parent6bca69ada4bc20fa27eb44a5e09da3363d1752af
x86/kvm: Restrict ASYNC_PF to user space

The async page fault injection into kernel space creates more problems than
it solves. The host has absolutely no knowledge about the state of the
guest if the fault happens in CPL0. The only restriction for the host is
interrupt disabled state. If interrupts are enabled in the guest then the
exception can hit arbitrary code. The HALT based wait in non-preemotible
code is a hacky replacement for a proper hypercall.

For the ongoing work to restrict instrumentation and make the RCU idle
interaction well defined the required extra work for supporting async
pagefault in CPL0 is just not justified and creates complexity for a
dubious benefit.

The CPL3 injection is well defined and does not cause any issues as it is
more or less the same as a regular page fault from CPL3.

Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134059.369802541@linutronix.de
arch/x86/kernel/kvm.c