From patchwork Fri Feb 14 22:06:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 3654811 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A2E83BF13A for ; Fri, 14 Feb 2014 22:07:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84F5B201CE for ; Fri, 14 Feb 2014 22:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5B1A20160 for ; Fri, 14 Feb 2014 22:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753141AbaBNWHj (ORCPT ); Fri, 14 Feb 2014 17:07:39 -0500 Received: from mail-qa0-f50.google.com ([209.85.216.50]:42536 "EHLO mail-qa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbaBNWHi (ORCPT ); Fri, 14 Feb 2014 17:07:38 -0500 Received: by mail-qa0-f50.google.com with SMTP id cm18so19352081qab.9 for ; Fri, 14 Feb 2014 14:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=6oIH6glcuBcVae6CvkRXLxZyZIUBP4xsQLJr2XkgG5k=; b=qmsIXPNCUf4WG1ZJLBkpT8jW/e9IF38hLWgHY/HWH8JtODnD7Anc3OgbLlTH1f84/8 1xJxjB755da3UZlUb29FTAhJDIG7t/UHfmFHV0a4mEcl34eOUNSwyx6Tdv9k0MsqGjZQ fSWOwe4yqKn2EGdnr+Uo31fjspVRcyoq+a/nZ/TN3YzoABTfW23WjDe3VTYj/aKNnNLg NHG6WOsB9ADcbgySU4jPpLoqEAB93TvI2yWFB8gAodgGlXn0lj2YeoCAd9hVZjDO7DYu YuWFVkWBuOcoDEqqk9RN7qEmKGGSItG6n1c0MdpaMb2otmJQCf2ohinQyR356YY5wVct 0cqg== X-Received: by 10.140.97.137 with SMTP id m9mr16161611qge.95.1392415657478; Fri, 14 Feb 2014 14:07:37 -0800 (PST) Received: from ERROL.INI.CMU.EDU (ERROL.INI.CMU.EDU. [128.2.16.43]) by mx.google.com with ESMTPSA id v92sm9771307qge.6.2014.02.14.14.07.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 14 Feb 2014 14:07:37 -0800 (PST) Date: Fri, 14 Feb 2014 17:06:00 -0500 From: "Gabriel L. Somlo" To: Alexander Graf Cc: "Michael S. Tsirkin" , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" , "eddie.dong@intel.com" Subject: Re: RFC: ioapic polarity vs. qemu os-x guest Message-ID: <20140214220600.GI29329@ERROL.INI.CMU.EDU> References: <20140130204423.GK29329@ERROL.INI.CMU.EDU> <20140211182330.GC29329@ERROL.INI.CMU.EDU> <20140211195444.GB10951@redhat.com> <20140214211311.GH29329@ERROL.INI.CMU.EDU> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: --- but now OS X freezes during boot right after [ PCI configuration begin ] [ PCI configuration end, bridges 1, devices 10 ] RTC: Only single RAM bank (128 bytes) which all looks normal, except the process is supposed to continue on from there and doesn't :) On Linux, I get Fedora 20 live all the way up with no obvious/loud complaints, but mouse and keyboard don't work at all... I have to admit I'm a bit out of my depth here, though :) --Gabriel -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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(PCIDevice *d, int reg) static inline int pci_irq_state(PCIDevice *d, int irq_num) { - return (d->irq_state >> irq_num) & 0x1; + return !(d->irq_state >> irq_num) & 0x1; } static inline void pci_set_irq_state(PCIDevice *d, int irq_num, int level) { d->irq_state &= ~(0x1 << irq_num); - d->irq_state |= level << irq_num; + d->irq_state &= ~(level << irq_num); } static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) @@ -229,7 +229,7 @@ static void pcibus_reset(BusState *qbus) } for (i = 0; i < bus->nirq; i++) { - assert(bus->irq_count[i] == 0); + assert(bus->irq_count[i] != 0); } }