On Wed, Nov 21, 2012 at 1:15 PM, Marc Zyngier <marc.zyngier@xxxxxxx> wrote: > While the vgic code doesn't really care about an edge interrupt > having its line "lowered", doing so makes more sense from a timer > perspective, and clearly indicates that this is an edge-triggered > interrupt. > I am extremely confused. The architected timers on an A15 is always level interrupt, correct? We present an A15 to the guest so the guest kernel expects that this is the case and that's what the emulated cfg register will contain. So I don't understand your reference to the edge thingy above? If I understand the patch correctly, this relates to the fact that the timer interrupts are active-LOW, and then I get all scared, because I think I always assumed that when we set level==1 in the kvm_irq_level struct we mean "raise an interrupt", regardless of wether the line is active-LOW or active-HIGH. Otherwise we will never inject an interrupt that is active-LOW when it's active, but always inject that interrupt when it's inactive. > Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx> > --- > arch/arm/kvm/timer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm/kvm/timer.c b/arch/arm/kvm/timer.c > index a241298..b9e573f 100644 > --- a/arch/arm/kvm/timer.c > +++ b/arch/arm/kvm/timer.c > @@ -42,6 +42,9 @@ static void kvm_timer_inject_irq(struct kvm_vcpu *vcpu) > kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, > vcpu->arch.timer_cpu.irq->irq, > vcpu->arch.timer_cpu.irq->level); > + kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, > + vcpu->arch.timer_cpu.irq->irq, > + !vcpu->arch.timer_cpu.irq->level); regardless of the above, this looks super screwy and must be explained with a comment. If we start supporting a core where the timer interrupt is edge-based, than we never raise a timer interrupt, which is just plain weird. > } > > static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id) > -- > 1.7.12 > > > > _______________________________________________ > kvmarm mailing list > kvmarm@xxxxxxxxxxxxxxxxxxxxx > https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm