* [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing
@ 2016-07-31 14:18 Peter Xu
2016-08-01 10:58 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Peter Xu @ 2016-07-31 14:18 UTC (permalink / raw)
To: qemu-devel; +Cc: mst, pbonzini, peterx
For level triggered interrupts, we will get Remote IRR bit cleared after
guest kernel finished processing specific request. Before that, we
should ignore the same interrupt from triggering again.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
I discovered this during debugging some IR issues. Only did very
minimum test with e1000, but IIUC this should be the correct behavior
for level triggered interrupts, and before that we might be sending
some extra interrupts to guest (while we should not).
hw/intc/ioapic.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 2d3282a..350f761 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -129,9 +129,15 @@ static void ioapic_service(IOAPICCommonState *s)
}
continue;
}
-#else
- (void)coalesce;
#endif
+
+ if (coalesce) {
+ /* We are level triggered interrupts, and the
+ * guest should be still working on previous one,
+ * so skip it. */
+ continue;
+ }
+
/* No matter whether IR is enabled, we translate
* the IOAPIC message into a MSI one, and its
* address space will decide whether we need a
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing
2016-07-31 14:18 [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing Peter Xu
@ 2016-08-01 10:58 ` Paolo Bonzini
2016-08-01 14:02 ` Peter Xu
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-08-01 10:58 UTC (permalink / raw)
To: Peter Xu, qemu-devel; +Cc: mst
On 31/07/2016 16:18, Peter Xu wrote:
> For level triggered interrupts, we will get Remote IRR bit cleared after
> guest kernel finished processing specific request. Before that, we
> should ignore the same interrupt from triggering again.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>
> I discovered this during debugging some IR issues. Only did very
> minimum test with e1000, but IIUC this should be the correct behavior
> for level triggered interrupts, and before that we might be sending
> some extra interrupts to guest (while we should not).
>
> hw/intc/ioapic.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 2d3282a..350f761 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -129,9 +129,15 @@ static void ioapic_service(IOAPICCommonState *s)
> }
> continue;
> }
> -#else
> - (void)coalesce;
> #endif
> +
> + if (coalesce) {
> + /* We are level triggered interrupts, and the
> + * guest should be still working on previous one,
> + * so skip it. */
> + continue;
> + }
> +
> /* No matter whether IR is enabled, we translate
> * the IOAPIC message into a MSI one, and its
> * address space will decide whether we need a
>
The patch is okay for 2.7, as it matches what is done in the KVM
split-irqchip case.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing
2016-08-01 10:58 ` Paolo Bonzini
@ 2016-08-01 14:02 ` Peter Xu
0 siblings, 0 replies; 3+ messages in thread
From: Peter Xu @ 2016-08-01 14:02 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, mst
On Mon, Aug 01, 2016 at 12:58:42PM +0200, Paolo Bonzini wrote:
>
>
> On 31/07/2016 16:18, Peter Xu wrote:
> > For level triggered interrupts, we will get Remote IRR bit cleared after
> > guest kernel finished processing specific request. Before that, we
> > should ignore the same interrupt from triggering again.
> >
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> >
> > I discovered this during debugging some IR issues. Only did very
> > minimum test with e1000, but IIUC this should be the correct behavior
> > for level triggered interrupts, and before that we might be sending
> > some extra interrupts to guest (while we should not).
> >
> > hw/intc/ioapic.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> > index 2d3282a..350f761 100644
> > --- a/hw/intc/ioapic.c
> > +++ b/hw/intc/ioapic.c
> > @@ -129,9 +129,15 @@ static void ioapic_service(IOAPICCommonState *s)
> > }
> > continue;
> > }
> > -#else
> > - (void)coalesce;
> > #endif
> > +
> > + if (coalesce) {
> > + /* We are level triggered interrupts, and the
> > + * guest should be still working on previous one,
> > + * so skip it. */
> > + continue;
> > + }
> > +
> > /* No matter whether IR is enabled, we translate
> > * the IOAPIC message into a MSI one, and its
> > * address space will decide whether we need a
> >
>
> The patch is okay for 2.7, as it matches what is done in the KVM
> split-irqchip case.
Cool. It'll be nice to have it in 2.7 as well. Thanks,
-- peterx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-01 14:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-31 14:18 [Qemu-devel] [PATCH for 2.8?] x86: ioapic: ignore level irq during processing Peter Xu
2016-08-01 10:58 ` Paolo Bonzini
2016-08-01 14:02 ` Peter Xu
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).