On Tue, Mar 08, 2011 at 03:57:43PM +0200, Avi Kivity wrote: > Move the exit reason checks to the front of the function, for early > exit in the common case. > > Signed-off-by: Avi Kivity <avi@xxxxxxxxxx> > --- > arch/x86/kvm/vmx.c | 15 +++++++++------ > 1 files changed, 9 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 6eadeaf..36fbe11 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -3879,17 +3879,20 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) > > static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx) > { > - u32 exit_intr_info = vmx->exit_intr_info; > + u32 exit_intr_info; > + > + if (!(vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY > + || vmx->exit_reason == EXIT_REASON_EXCEPTION_NMI)) > + return; > + > + exit_intr_info = vmx->exit_intr_info; So you're saving a vmread on exception and mce_during_vmentry exits? Managing nmi_known_unmasked appears tricky... perhaps worthwhile to have it in a helper that sets the bit in interruptibility info + nmi_known_unmasked. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html