Re: [PATCH 17/30] KVM: nSVM: synchronize VMCB controls updated by the processor on every vmexit

From: Paolo Bonzini
Date: Sat May 30 2020 - 01:15:11 EST


On 30/05/20 04:06, Krish Sadhukhan wrote:
>>
>> Â -ÂÂÂ nested_vmcb->control.int_ctlÂÂÂÂÂÂÂÂÂÂ = vmcb->control.int_ctl;
>> -ÂÂÂ nested_vmcb->control.int_vectorÂÂÂÂÂÂÂ = vmcb->control.int_vector;
>
>
> While it's not related to this patch, I am wondering if we need the
> following line in enter_svm_guest_mode():
>
> ÂÂÂ svm->vmcb->control.int_vector = nested_vmcb->control.int_vector;
>
> If int_vector is used only to trigger a #VMEXIT after we have decided to
> inject a virtual interrupt, we probably don't the vector value from the
> nested vmcb.

KVM does not use int_vector, but other hypervisor sometimes trigger
virtual interrupts using int_ctl+int_vector instead of eventinj.
(Unlike KVM they don't intercept EXIT_VINTR). Hyper-V operates like that.

Paolo