Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-17 Thread Gabriel L. Somlo
On Mon, Feb 17, 2014 at 02:38:09PM -0500, Gabriel L. Somlo wrote: > Oh, I think I'm starting to comprehend the problem here. The bits of > "*irq_state" are indexed by "irq_source_id", which is dynamically > assigned by kvm_request_irq_source_id(). > > So, doing the OR thing when assuming always-ac

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-17 Thread Gabriel L. Somlo
On Mon, Feb 17, 2014 at 07:06:11PM +0100, Paolo Bonzini wrote: > Il 17/02/2014 19:01, Gabriel L. Somlo ha scritto: > >On Mon, Feb 17, 2014 at 12:57:00PM -0500, Gabriel L. Somlo wrote: > >>On Sun, Feb 16, 2014 at 06:23:11PM +0200, Michael S. Tsirkin wrote: > >>>Well there is a bigger issue: any inte

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-17 Thread Paolo Bonzini
Il 17/02/2014 19:01, Gabriel L. Somlo ha scritto: On Mon, Feb 17, 2014 at 12:57:00PM -0500, Gabriel L. Somlo wrote: On Sun, Feb 16, 2014 at 06:23:11PM +0200, Michael S. Tsirkin wrote: Well there is a bigger issue: any interrupt with multiple sources is broken. __kvm_irq_line_state does a logic

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-17 Thread Gabriel L. Somlo
On Mon, Feb 17, 2014 at 12:57:00PM -0500, Gabriel L. Somlo wrote: > On Sun, Feb 16, 2014 at 06:23:11PM +0200, Michael S. Tsirkin wrote: > > Well there is a bigger issue: any interrupt with > > multiple sources is broken. > > > > __kvm_irq_line_state does a logical OR of all sources, > > before XOR

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-17 Thread Gabriel L. Somlo
On Sun, Feb 16, 2014 at 06:23:11PM +0200, Michael S. Tsirkin wrote: > Well there is a bigger issue: any interrupt with > multiple sources is broken. > > __kvm_irq_line_state does a logical OR of all sources, > before XOR with polarity. > > This makes no sense if polarity is active low. So, do yo

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Michael S. Tsirkin
On Sun, Feb 16, 2014 at 07:47:00AM -0700, Alex Williamson wrote: > On Sun, 2014-02-16 at 13:41 +0200, Michael S. Tsirkin wrote: > > On Fri, Feb 14, 2014 at 11:13:04PM +0100, Alexander Graf wrote: > > > > > > On 14.02.2014, at 23:06, Gabriel L. Somlo wrote: > > > > > > > On Fri, Feb 14, 2014 at 1

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Peter Maydell
On 16 February 2014 11:34, Michael S. Tsirkin wrote: > Hmm no this is all wrong, from API point of view, > devices shoud not care about value of interrupt. > They just assert/deassert interrupts. > It so happens that 1 means assert 0 means deassert. Yeah, we generally model things as active-high

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Alex Williamson
On Sun, 2014-02-16 at 13:41 +0200, Michael S. Tsirkin wrote: > On Fri, Feb 14, 2014 at 11:13:04PM +0100, Alexander Graf wrote: > > > > On 14.02.2014, at 23:06, Gabriel L. Somlo wrote: > > > > > On Fri, Feb 14, 2014 at 10:21:09PM +0100, Alexander Graf wrote: > > >> > > >> Can't you just turn the

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Michael S. Tsirkin
On Fri, Feb 14, 2014 at 11:13:04PM +0100, Alexander Graf wrote: > > On 14.02.2014, at 23:06, Gabriel L. Somlo wrote: > > > On Fri, Feb 14, 2014 at 10:21:09PM +0100, Alexander Graf wrote: > >> > >> Can't you just turn the polarity around in the pci host adapter? > > > > I tried this: > > > > d

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Michael S. Tsirkin
On Fri, Feb 14, 2014 at 04:13:11PM -0500, Gabriel L. Somlo wrote: > On Tue, Feb 11, 2014 at 09:54:44PM +0200, Michael S. Tsirkin wrote: > > On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: > > > 1. Regarding KVM and the polarity xor line in the patch above: Does > > > anyone have e

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Michael S. Tsirkin
On Fri, Feb 14, 2014 at 04:13:11PM -0500, Gabriel L. Somlo wrote: > On Tue, Feb 11, 2014 at 09:54:44PM +0200, Michael S. Tsirkin wrote: > > On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: > > > 1. Regarding KVM and the polarity xor line in the patch above: Does > > > anyone have e

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-16 Thread Michael S. Tsirkin
On Fri, Feb 14, 2014 at 11:13:04PM +0100, Alexander Graf wrote: > > On 14.02.2014, at 23:06, Gabriel L. Somlo wrote: > > > On Fri, Feb 14, 2014 at 10:21:09PM +0100, Alexander Graf wrote: > >> > >> Can't you just turn the polarity around in the pci host adapter? > > > > I tried this: > > > > d

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-14 Thread Alexander Graf
On 14.02.2014, at 23:06, Gabriel L. Somlo wrote: > On Fri, Feb 14, 2014 at 10:21:09PM +0100, Alexander Graf wrote: >> >> Can't you just turn the polarity around in the pci host adapter? > > I tried this: > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index 1221f32..0e86d21 100644 > --- a/hw/p

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-14 Thread Gabriel L. Somlo
On Fri, Feb 14, 2014 at 10:21:09PM +0100, Alexander Graf wrote: > > Can't you just turn the polarity around in the pci host adapter? I tried this: diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1221f32..0e86d21 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -118,13 +118,13 @@ static int pci_bar

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-14 Thread Alexander Graf
> Am 14.02.2014 um 22:13 schrieb "Gabriel L. Somlo" : > >> On Tue, Feb 11, 2014 at 09:54:44PM +0200, Michael S. Tsirkin wrote: >>> On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: >>> 1. Regarding KVM and the polarity xor line in the patch above: Does >>> anyone have experience

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-14 Thread Gabriel L. Somlo
On Tue, Feb 11, 2014 at 09:54:44PM +0200, Michael S. Tsirkin wrote: > On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: > > 1. Regarding KVM and the polarity xor line in the patch above: Does > > anyone have experience with any *other* guests which insist on setting > > level-trigge

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-11 Thread Gabriel L. Somlo
On Tue, Feb 11, 2014 at 09:54:44PM +0200, Michael S. Tsirkin wrote: > On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: > > I'm trying to get OS X to work as a QEMU guest, and one of the few > > remaining "mysteries" I need to solve is that the OS X guest hangs > > during boot, wait

Re: [Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-11 Thread Michael S. Tsirkin
On Tue, Feb 11, 2014 at 01:23:31PM -0500, Gabriel L. Somlo wrote: > Hi, > > I'm trying to get OS X to work as a QEMU guest, and one of the few > remaining "mysteries" I need to solve is that the OS X guest hangs > during boot, waiting for its boot disk to be available, unless the > following KVM p

[Qemu-devel] RFC: ioapic polarity vs. qemu os-x guest

2014-02-11 Thread Gabriel L. Somlo
Hi, I'm trying to get OS X to work as a QEMU guest, and one of the few remaining "mysteries" I need to solve is that the OS X guest hangs during boot, waiting for its boot disk to be available, unless the following KVM patch is applied: diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index ce