]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Optimization: Dont set KVM_REQ_EVENT when VMExit with nested_run_pending
authorLiran Alon <liran.alon@oracle.com>
Fri, 23 Mar 2018 00:01:34 +0000 (03:01 +0300)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 28 Mar 2018 20:47:06 +0000 (22:47 +0200)
commitfd2b7c573296494584c84a227dde5562a02b79a8
tree8589e07e7ab89837bcc71e9ec595bc6b87cc54c9
parent983aafab8e7070d803841c043dc77b97ff4cfa52
KVM: nVMX: Optimization: Dont set KVM_REQ_EVENT when VMExit with nested_run_pending

When vCPU runs L2 and there is a pending event that requires to exit
from L2 to L1 and nested_run_pending=1, vcpu_enter_guest() will request
an immediate-exit from L2 (See req_immediate_exit).

Since now handling of req_immediate_exit also makes sure to set
KVM_REQ_EVENT, there is no need to also set it on vmx_vcpu_run() when
nested_run_pending=1.

This optimizes cases where VMRESUME was executed by L1 to enter L2 and
there is no pending events that require exit from L2 to L1. Previously,
this would have set KVM_REQ_EVENT unnecessarly.

Signed-off-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c