Re: [PATCH 3/3] KVM: x86: do not scan IRR twice on APICv vmentry

From: Paolo Bonzini
Date: Fri Oct 14 2016 - 04:02:35 EST




On 14/10/2016 09:32, Yang Zhang wrote:
>>
>> -void __kvm_apic_update_irr(u32 *pir, void *regs)
>> +int __kvm_apic_update_irr(u32 *pir, void *regs)
>> {
>> - u32 i, pir_val;
>> + u32 i, vec;
>> + u32 pir_val, irr_val;
>> + int max_irr = -1;
>>
>> - for (i = 0; i <= 7; i++) {
>> + for (i = vec = 0; i <= 7; i++, vec += 32) {
>
> how about ignore the first 32 vectors since they cannot be used as
> normal interrupt except nmi interrupt which is special handled.

I think that, while they should not be used as normal interrupts,
there's nothing that prevents you from misusing them as normal interrupts.

Paolo