lkml.org 
[lkml]   [2016]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/5] KVM: x86: do not scan IRR twice on APICv vmentry
From
Date


On 03/11/2016 21:16, Radim Krčmář wrote:
> > + if (!pi_test_on(&vmx->pi_desc))
>
> We don't call vmx_hwapic_irr_update() when returning early.

This might be a good start, but it's on purpose: IRR is not changing and
the invariant _should_ be that RVI=highest-bit(IRR):

- IRR cleared by processor: see SDM 29.2.2 Virtual-interrupt delivery

- IRR set by processor: see SDM 29.6 Posted-interrupt processing

- IRR set by KVM: ON=1 so it doesn't exit here

- IRR cleared by KVM: might indeed be buggy here, but the next patch
does add a

+ kvm_x86_ops->hwapic_irr_update(vcpu,
+ apic_find_highest_irr(apic));

to apic_clear_irr, which doesn't fix the bug (and doesn't fix it also if
backported here).


So we're missing a place where IRR has changed but RVI is not being
updated. It should be related to vmx_check_nested_events and
kvm_cpu_has_interrupt as you said, but I cannot really see it.

Paolo

>> > + return;
>> > +
>> > + pi_clear_on(&vmx->pi_desc);
>> > + max_irr = kvm_apic_update_irr(vcpu, vmx->pi_desc.pir);
>> > + vmx_hwapic_irr_update(vcpu, max_irr);
>> > +}

\
 
 \ /
  Last update: 2016-11-04 10:39    [W:0.133 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site