From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2iMD-0003WI-7I for qemu-devel@nongnu.org; Thu, 03 Jul 2014 10:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2iM6-0007Xf-8e for qemu-devel@nongnu.org; Thu, 03 Jul 2014 10:51:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44977 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2iM6-0007XX-1C for qemu-devel@nongnu.org; Thu, 03 Jul 2014 10:51:22 -0400 Message-ID: <53B56DE8.9000903@suse.de> Date: Thu, 03 Jul 2014 16:51:20 +0200 From: Alexander Graf MIME-Version: 1.0 References: <53B3CE04.5020700@suse.de> <20140702204959.GY1688@ERROL.INI.CMU.EDU> <53B47366.6000101@suse.de> <20140702211425.GZ1688@ERROL.INI.CMU.EDU> <20140702220224.GA1688@ERROL.INI.CMU.EDU> <4CC5752B-B4BA-4624-9CFC-9C30010996C5@suse.de> <20140703131723.GB1688@ERROL.INI.CMU.EDU> <20140703135846.GC1688@ERROL.INI.CMU.EDU> <53B5625E.8030304@suse.de> <20140703141451.GD1688@ERROL.INI.CMU.EDU> In-Reply-To: <20140703141451.GD1688@ERROL.INI.CMU.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] e1000 autoneg timing, piix/osx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: "pbonzini@redhat.com" , "qemu-devel@nongnu.org" , "stefanha@redhat.com" , "Michael S. Tsirkin" On 03.07.14 16:14, Gabriel L. Somlo wrote: > On Thu, Jul 03, 2014 at 04:02:06PM +0200, Alexander Graf wrote: >> On 03.07.14 15:58, Gabriel L. Somlo wrote: >>> On Thu, Jul 03, 2014 at 03:20:50PM +0200, Alexander Graf wrote: >>>> On 03.07.2014, at 15:17, Gabriel L. Somlo wrote: >>>> >>>>> On Thu, Jul 03, 2014 at 10:04:55AM +0200, Alexander Graf wrote: >>>>>>> so Ethernet, SATA, and USB, all sharing IRQ 11. Is there an easy way >>>>>>> to force one of those to use a different IRQ ? >>>>> Oh, and on Q35, while Ethernet (and one of the USBs) is still on IRQ 11, >>>>> SATA ended up on IRQ 10, and things are fine there... >>>>> >>>>>> IIRC if you plug the device in a different slot, the irq distribution >>>>>> should be different :). >>>>> Sorry for being thick, but I'm still trying to figure out if there's a >>>>> command-line way of making that happen. Re-ordering the "-device" >>>>> arguments to qemu obviously doesn't make a difference in how they're >>>>> assigned... >>>> The magic word is "devfn" :). It's basically the token PCI uses to find out which slot and function id a device is on. You can set "devfn" with the "addr" attribute on -device. >>> OK. So simply doing "-device e1000-82545em,...,bus=pci.0,addr=5" to >>> move it up one slot from its default of "4" gets it set up with IRQ 10. >>> As long as it doesn't share an irq line with the SATA controller, the >>> network link gets detected just fine, same as on Q35. >>> >>> So this is not really an autonegotiation or timing bug, it's an >>> unfortunate side effect of the OS X built-in proprietary e1000 driver >>> not playing nice when IRQs are shared with SATA in particular. At >>> least as far as I'm able to tell so far... :) >>> >>> So I'll send out some autoneg cleanup patches after 2.1 is officially >>> out, but the "osx link on piix not working" mystery is solved as far >>> as I can tell :) >> Maybe only ICR bits that actually would trigger an interrupt get cleared? > you mean, modify e1000's mac_icr_read() to only clear bits on read if > the mask says they should be "active" at that moment ? > > The e1000 spec doesn't seem to say that though, it's "you read it, > it's now 0", regardless of the mask configuration. > > http://download.intel.com/design/network/manuals/8254x_GBe_SDM.pdf > on page 293. Hrm. So could we just delay notification of the LSC change until IMS.LCR = 1? In other words, when the guest writes IMS.LCR = 1, it was 0 before and the link is up, send an interrupt? Alex