]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Defer setting of CR2 until #PF delivery
authorJim Mattson <jmattson@google.com>
Tue, 16 Oct 2018 21:29:22 +0000 (14:29 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Oct 2018 17:07:43 +0000 (19:07 +0200)
commit9c8a9378a13087417e090bd4a91910560700a5a0
tree8e719071b6732577b306b04dfb6fe886a244e51f
parent96f93cb7a20329c6bd692169e07d8bf78265fb34
kvm: x86: Defer setting of CR2 until #PF delivery

When exception payloads are enabled by userspace (which is not yet
possible) and a #PF is raised in L2, defer the setting of CR2 until
the #PF is delivered. This allows the L1 hypervisor to intercept the
fault before CR2 is modified.

For backwards compatibility, when exception payloads are not enabled
by userspace, kvm_multiple_exception modifies CR2 when the #PF
exception is raised.

Reported-by: Jim Mattson <jmattson@google.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h