Re: [PATCH 2/4] Rewrite twisted maze of if() statements with more straightforward switch()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avi Kivity wrote:
> Gleb Natapov wrote:
>> Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx>
>>   
> 
> This is actually not just a rewrite, but also a bugfix:
> 
>> INTR_INFO);
>> @@ -3289,34 +3288,42 @@ static void vmx_complete_interrupts(struct
>> vcpu_vmx *vmx)
>>          vmx->vnmi_blocked_time +=
>>              ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time));
>>  
>> +    vmx->vcpu.arch.nmi_injected = false;
>> +    kvm_clear_exception_queue(&vmx->vcpu);
>> +    kvm_clear_interrupt_queue(&vmx->vcpu);
>> +
>> +    if (!idtv_info_valid)
>> +        return;
>> +
>>      vector = idt_vectoring_info & VECTORING_INFO_VECTOR_MASK;
>>      type = idt_vectoring_info & VECTORING_INFO_TYPE_MASK;
>> -    if (vmx->vcpu.arch.nmi_injected) {
>> +   
>> +    switch(type) {
>> +    case INTR_TYPE_NMI_INTR:
>> +        vmx->vcpu.arch.nmi_injected = true;
>>          /*
>>   
> 
> The existing code would leave nmi_injected == false if we exit on
> NMI_INTR, so we drop an NMI here.
> 

I think NMI_INTR and nmi_injected always go together. However, the
rework looks good and more logical to me, too. Will see that I can give
this (more precisely -v2) a try with our scenarios ASAP.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux