On Fri, Nov 08, 2013 at 12:12:52AM +0100, Alexander Graf wrote: > Am 07.11.2013 um 21:28 schrieb "Gabriel L. Somlo" <gso...@gmail.com>: > > > 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 <so...@cmu.edu> > > --- > > > > 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