Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-10 Thread Peter Xu
On Tue, May 10, 2016 at 10:58:02AM +0200, Paolo Bonzini wrote: > > > On 10/05/2016 08:09, Peter Xu wrote: > > On Mon, May 09, 2016 at 01:58:48PM +0200, Paolo Bonzini wrote: > >> Is this enough too? > >> > >> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > >> index 378e663..2443a35 100644 > >>

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-10 Thread Paolo Bonzini
On 10/05/2016 08:09, Peter Xu wrote: > On Mon, May 09, 2016 at 01:58:48PM +0200, Paolo Bonzini wrote: >> Is this enough too? >> >> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c >> index 378e663..2443a35 100644 >> --- a/hw/intc/ioapic.c >> +++ b/hw/intc/ioapic.c >> @@ -72,6 +72,7 @@ static void

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-09 Thread Peter Xu
On Mon, May 09, 2016 at 01:58:48PM +0200, Paolo Bonzini wrote: > Is this enough too? > > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c > index 378e663..2443a35 100644 > --- a/hw/intc/ioapic.c > +++ b/hw/intc/ioapic.c > @@ -72,6 +72,7 @@ static void ioapic_service(IOAPICCommonState *s) >

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-09 Thread Paolo Bonzini
On 26/04/2016 09:34, Peter Xu wrote: > +/* > + * This is to satisfy the hack in Linux kernel. One hack of it is to > + * simulate clearing the Remote IRR bit of IOAPIC entry using the > + * following: > + * > + * "For IO-APIC's with EOI register, we use that to do an explicit EOI. > + * Otherwise

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-28 Thread Radim Krčmář
2016-04-28 13:27+0800, Peter Xu: > On Wed, Apr 27, 2016 at 04:31:13PM +0200, Radim Krčmář wrote: > > [...] > >> >> > I am still looking into guest part codes. Although the above patch >> >> > should solve the issue, there are still issues in guest codes when >> >> > IR is enabled: >> >> > >> >>

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-27 Thread Peter Xu
On Thu, Apr 28, 2016 at 02:06:17PM +0800, Peter Xu wrote: > On Wed, Apr 27, 2016 at 04:31:13PM +0200, Radim Krčmář wrote: > > >> > + */ > > >> > +static inline void > > >> > +ioapic_fix_edge_remote_irr(uint64_t *entry) > > >> > +{ > > >> > +if (*entry & IOAPIC_LVT_TRIGGER_MODE) { > > >> > +

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-27 Thread Peter Xu
On Wed, Apr 27, 2016 at 04:31:13PM +0200, Radim Krčmář wrote: > >> > + */ > >> > +static inline void > >> > +ioapic_fix_edge_remote_irr(uint64_t *entry) > >> > +{ > >> > +if (*entry & IOAPIC_LVT_TRIGGER_MODE) { > >> > +/* Level triggered interrupts, make sure remote IRR is zero */ > >>

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-27 Thread Peter Xu
On Wed, Apr 27, 2016 at 04:31:13PM +0200, Radim Krčmář wrote: [...] > >> > I am still looking into guest part codes. Although the above patch > >> > should solve the issue, there are still issues in guest codes when > >> > IR is enabled: > >> > > >> > - mismatched "vector" in IOAPIC entry and IR

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-27 Thread Radim Krčmář
2016-04-27 15:29+0800, Peter Xu: > On Tue, Apr 26, 2016 at 04:19:00PM +0200, Radim Krčmář wrote: >> 2016-04-26 15:34+0800, Peter Xu: >> > diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c >> > @@ -281,6 +281,36 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned >> > int size) >> > +/* >> > + *

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-27 Thread Peter Xu
On Tue, Apr 26, 2016 at 04:19:00PM +0200, Radim Krčmář wrote: > 2016-04-26 15:34+0800, Peter Xu: > > Hi, Jan, > > > > The above issue should be caused by EOI missing of level-triggered > > interrupts. Before that, I was always using edge-triggered > > interrupts for test, so didn't encounter this

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 18:07, Radim Krčmář wrote: > 2016-04-26 17:28+0200, Jan Kiszka: >> On 2016-04-26 16:59, Radim Krčmář wrote: >>> 2016-04-26 16:24+0200, Jan Kiszka: On 2016-04-26 13:40, Peter Xu wrote: > Currently, all the interrupts will be translated into one MSI in > vtd_generate_msi_me

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Radim Krčmář
2016-04-26 17:28+0200, Jan Kiszka: > On 2016-04-26 16:59, Radim Krčmář wrote: >> 2016-04-26 16:24+0200, Jan Kiszka: >>> On 2016-04-26 13:40, Peter Xu wrote: Currently, all the interrupts will be translated into one MSI in vtd_generate_msi_message(), in which only 8 bits of dest_id is used

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 16:59, Radim Krčmář wrote: > 2016-04-26 16:24+0200, Jan Kiszka: >> On 2016-04-26 13:40, Peter Xu wrote: >>> Currently, all the interrupts will be translated into one MSI in >>> vtd_generate_msi_message(), in which only 8 bits of dest_id is used >>> (msg.dest = irq->dest). We may possi

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Radim Krčmář
2016-04-26 16:24+0200, Jan Kiszka: > On 2016-04-26 13:40, Peter Xu wrote: >> Currently, all the interrupts will be translated into one MSI in >> vtd_generate_msi_message(), in which only 8 bits of dest_id is used >> (msg.dest = irq->dest). We may possibly need to use the high 32 bits >> of MSI addr

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 13:40, Peter Xu wrote: > On Tue, Apr 26, 2016 at 12:51:44PM +0200, Jan Kiszka wrote: >> On 2016-04-26 12:38, Peter Xu wrote: >> Hi, Jan, >> >> The above issue should be caused by EOI missing of level-triggered >> interrupts. Before that, I was always using edge-trigger

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Radim Krčmář
2016-04-26 15:34+0800, Peter Xu: > Hi, Jan, > > The above issue should be caused by EOI missing of level-triggered > interrupts. Before that, I was always using edge-triggered > interrupts for test, so didn't encounter this one. Would you please > help try below patch? It can be applied directly o

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Peter Xu
On Tue, Apr 26, 2016 at 12:51:44PM +0200, Jan Kiszka wrote: > On 2016-04-26 12:38, Peter Xu wrote: > Hi, Jan, > > The above issue should be caused by EOI missing of level-triggered > interrupts. Before that, I was always using edge-triggered > interrupts for test, so didn't

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 12:38, Peter Xu wrote: Hi, Jan, The above issue should be caused by EOI missing of level-triggered interrupts. Before that, I was always using edge-triggered interrupts for test, so didn't encounter this one. Would you please help try below patch? It can

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Peter Xu
On Tue, Apr 26, 2016 at 10:15:46AM +0200, Jan Kiszka wrote: > On 2016-04-26 09:57, Jan Kiszka wrote: > > On 2016-04-26 09:34, Peter Xu wrote: > >> On Mon, Apr 25, 2016 at 09:24:12AM +0200, Jan Kiszka wrote: > >>> On 2016-04-25 09:18, Peter Xu wrote: > On Mon, Apr 25, 2016 at 07:16:19AM +0200,

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 09:57, Jan Kiszka wrote: > On 2016-04-26 09:34, Peter Xu wrote: >> On Mon, Apr 25, 2016 at 09:24:12AM +0200, Jan Kiszka wrote: >>> On 2016-04-25 09:18, Peter Xu wrote: On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: > On 2016-04-19 10:38, Peter Xu wrote:

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Jan Kiszka
On 2016-04-26 09:34, Peter Xu wrote: > On Mon, Apr 25, 2016 at 09:24:12AM +0200, Jan Kiszka wrote: >> On 2016-04-25 09:18, Peter Xu wrote: >>> On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: On 2016-04-19 10:38, Peter Xu wrote: >>> >>> [...] >>> > By default, IR is disabled to

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-26 Thread Peter Xu
On Mon, Apr 25, 2016 at 09:24:12AM +0200, Jan Kiszka wrote: > On 2016-04-25 09:18, Peter Xu wrote: > > On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: > >> On 2016-04-19 10:38, Peter Xu wrote: > > > > [...] > > > >>> By default, IR is disabled to be better compatible with current > >>

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-25 Thread Radim Krčmář
2016-04-25 09:24+0200, Jan Kiszka: > On 2016-04-25 09:18, Peter Xu wrote: >> On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: >>> On 2016-04-19 10:38, Peter Xu wrote: - EIM support >>> >>> That should be fairly easy, I already played with it (hack in EIM cap, >>> change vtd_remap_ir

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-25 Thread Jan Kiszka
On 2016-04-25 09:18, Peter Xu wrote: > On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: >> On 2016-04-19 10:38, Peter Xu wrote: > > [...] > >>> By default, IR is disabled to be better compatible with current >>> QEMU. To enable IR, we can using the following command to boot a >>> IR-su

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-25 Thread Peter Xu
On Mon, Apr 25, 2016 at 07:16:19AM +0200, Jan Kiszka wrote: > On 2016-04-19 10:38, Peter Xu wrote: [...] > > By default, IR is disabled to be better compatible with current > > QEMU. To enable IR, we can using the following command to boot a > > IR-supported VM with virtio-net device with vhost (

Re: [Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-24 Thread Jan Kiszka
On 2016-04-19 10:38, Peter Xu wrote: > Jan, Michael, > > Still haven't got your response from v3 review comments, but I > decided to move on to provide a workable version first (v3 is > missing the first patch, so it is not working). Also, misc issues > are addressed from Radim. Anyway, I am alway

[Qemu-devel] [PATCH v4 00/16] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-04-19 Thread Peter Xu
Jan, Michael, Still haven't got your response from v3 review comments, but I decided to move on to provide a workable version first (v3 is missing the first patch, so it is not working). Also, misc issues are addressed from Radim. Anyway, I am always ready for v5 and further. :) Github branch for