From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VemHf-000796-8t for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:39:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VemHZ-0000F3-MA for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:39:35 -0500 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:49825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VemHZ-0000Ev-ED for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:39:29 -0500 Received: by mail-ea0-f171.google.com with SMTP id h15so905020eak.2 for ; Fri, 08 Nov 2013 05:39:28 -0800 (PST) Date: Fri, 8 Nov 2013 14:39:25 +0100 From: Stefan Hajnoczi Message-ID: <20131108133925.GA5662@stefanha-thinkpad.redhat.com> References: <20131031150651.GI9423@HEDWIG.INI.CMU.EDU> <20131107180440.GC13775@HEDWIG.INI.CMU.EDU> <527BE9EF.50906@redhat.com> <20131107202842.GD13775@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] e1000: initial link negotiation on mac osx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: "pbonzini@redhat.com" , "Gabriel L. Somlo" , "qemu-devel@nongnu.org" , "jaceksburghardt@gmail.com" On Fri, Nov 08, 2013 at 12:12:52AM +0100, Alexander Graf wrote: > Am 07.11.2013 um 21:28 schrieb "Gabriel L. Somlo" : > > > Some guest operating systems' drivers (particularly Mac OS X) > > expect the link state to be pre-initialized by an earlier > > component such as a proprietary BIOS. This patch injects > > additional LSC events upon PHY reset, allowing the OS X driver > > to successfully complete initial link negotiation. This is a > > follow-up to commit 372254c6e5c078fb13b236bb648d2b9b2b0c70f1, > > which works around the OS X driver's failure to properly set > > up the MAC address. > > > > Signed-off-by: Gabriel Somlo > > --- > > > > On Thu, Nov 07, 2013 at 08:28:47PM +0100, Paolo Bonzini wrote: > >> Is there any way to work around this in the guest? Such as using a > >> UEFI driver for e1000 or something like that. > > > > Currently OS X boots on top of SeaBIOS and Chameleon, neither of which > > know anything about the e1000 hardware. On real hardware, the XNU e1000 > > driver expects the proprietary BIOS to set things up "just right", and > > doesn't have to bother jumping through all the hoops to properly > > initialize the hardware from scratch (after all, the XNU driver > > developers only have to care about a limited range of carefully > > controlled hardware). > > > > In the VM/guest scenario, QEMU is the only piece that has any knowledge > > of the e1000 hardware, so having it prep things for the guest would be > > the path of least resistance. Using a completely different alternative > > to SeaBIOS (one that would/could assume e1000 is present and would know > > enough about it to configure it just right) sounds a lot less feasible. > > I'm not sure I agree. We can easily modify SeaBIOS to just loop through all PCI devices, look for an e1000 and initialize it far enough for XNU, no? > > After all, it sounds like that's closer to the way a real Mac works. I'd much prefer Alex's suggestion so we avoid putting guest-specific hacks into QEMU. If there is really no better solution, please make an "extra" behavior disabled by default and accessible through a device property. For example -device e1000,xnu-preinit-hack=on. Stefan