From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Sheng Yang <sheng@linux.intel.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] KVM: Interrupt mask notifiers for ioapic
Date: Mon, 05 Jan 2009 22:57:02 +0200 [thread overview]
Message-ID: <4962741E.7050204@redhat.com> (raw)
In-Reply-To: <20090105182930.GB5592@amt.cnet>
Marcelo Tosatti wrote:
> On Sun, Jan 04, 2009 at 06:14:44PM +0200, Avi Kivity wrote:
>
>> Allow clients to request notifications when the guest masks or unmasks a
>> particular irq line. This complements irq ack notifications, as the guest
>> will not ack an irq line that is masked.
>>
>> Currently implemented for the ioapic only.
>> +
>> +struct kvm_irq_mask_notifier {
>> + void (*func)(struct kvm_irq_mask_notifier *kimn, int masked);
>>
>
> bool masked?
>
>
Hey, I'm the bool fanatic!
>> @@ -128,6 +129,9 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
>> ioapic->redirtbl[index].bits |= (u32) val;
>> ioapic->redirtbl[index].fields.remote_irr = 0;
>> }
>> + mask_after = ioapic->redirtbl[index].fields.mask;
>> + if (mask_before != mask_after)
>> + kvm_fire_mask_notifiers(ioapic->kvm, index, mask_after);
>>
>
> This can generate "spurious acks", for example:
>
> - inject irq
> - guest masks, mask notifier cleans internal state to "acked".
> - guest writes EOI
>
> But I suppose thats fine, since PIT (for example) is getting spurious
> acks even without mask notifiers and so has to handle them.
>
If the mask happened for a long time then the guest would expect not to
receive those interrupts. If it happened due to scheduling then we need
to reinject them.
I suppose we could measure descheduled time and correct appropriately.
There previously existed logic that limited the pending count to some
value (10?) so there wouldn't be a stream of interrupts injected into
the guest endlessly.
I expect in most cases, masking of the timer interrupt would not happen
for short periods. You'd use eflags.if or apic.tpr to mask for short
periods.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2009-01-05 20:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-04 16:14 [PATCH 0/3] Reset PIT reinjection logic on irq unmask Avi Kivity
2009-01-04 16:14 ` [PATCH 1/3] KVM: Add CONFIG_HAVE_KVM_IRQCHIP Avi Kivity
2009-01-04 16:14 ` [PATCH 2/3] KVM: Interrupt mask notifiers for ioapic Avi Kivity
2009-01-05 7:06 ` Sheng Yang
2009-01-05 13:24 ` Avi Kivity
2009-01-05 18:29 ` Marcelo Tosatti
2009-01-05 20:57 ` Avi Kivity [this message]
2009-01-04 16:14 ` [PATCH 3/3] KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked Avi Kivity
2009-01-05 18:31 ` Marcelo Tosatti
2009-01-05 20:59 ` Avi Kivity
2009-01-05 21:58 ` Marcelo Tosatti
2009-01-06 8:25 ` Avi Kivity
2009-01-06 9:35 ` Dor Laor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4962741E.7050204@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=sheng@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).