From owner-freebsd-emulation@FreeBSD.ORG Sun Jun 7 19:46:12 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10877106567C for ; Sun, 7 Jun 2009 19:46:12 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id C2DEF8FC0A for ; Sun, 7 Jun 2009 19:46:11 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id B7BA41E001DD; Sun, 7 Jun 2009 21:46:10 +0200 (CEST) Received: from triton.kn-bremen.de (noident@localhost [127.0.0.1]) by triton.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n57JgvRT017656; Sun, 7 Jun 2009 21:42:57 +0200 (CEST) (envelope-from nox@triton.kn-bremen.de) Received: (from nox@localhost) by triton.kn-bremen.de (8.14.3/8.14.3/Submit) id n57JguFt017655; Sun, 7 Jun 2009 21:42:56 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sun, 7 Jun 2009 21:42:56 +0200 To: freebsd-emulation@freebsd.org Message-ID: <20090607194256.GA17327@triton.kn-bremen.de> References: <4A2BC96B.9010209@demax.sk> <200906071727.n57HRCZK012510@triton.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906071727.n57HRCZK012510@triton.kn-bremen.de> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: sebosik@demax.sk Subject: qemu patch (was: em(4) patch for qemu/kvm/vbox guests) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 19:46:12 -0000 On Sun, Jun 07, 2009 at 07:27:12PM +0200, Juergen Lock wrote: > In article <4A2BC96B.9010209@demax.sk> you write: > >Hi > > > >I think its caused by internal control of MAC address validity in > >freebsd-sources ( sys/dev/e1000/if_em.c ) on line 4950. > >You can safely remove references to that function + function itself and than > >happily use if_em undex VBox as before. > > Actually that wasn't it, in fact commit 190872 changed the way mac addresses > are read (e1000_read_mac_addr_generic() in sys/dev/e1000/e1000_nvm.c) - if I > add the old way back for the case that the new code gets all zeros em(4) > works again: And I just submitted a qemu git patch for this problem on the qemu list; here is a version for 0.10.5, you can put it in /usr/ports/emulators/qemu/files/patch-e1000-fbsd8 : Index: qemu/hw/e1000.c @@ -1100,6 +1100,16 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, memmove(d->phy_reg, phy_reg_init, sizeof phy_reg_init); memset(d->mac_reg, 0, sizeof d->mac_reg); memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init); + /* + * FreeBSD 8.0-current svn rev >= 190872 expects the mac address here, + * see e1000_read_mac_addr_generic() in sys/dev/e1000/if_em.c: + * http://svn.freebsd.org/viewvc/base/head/sys/dev/e1000/e1000_nvm.c?view=markup&pathrev=190872 + * http://svn.freebsd.org/viewvc/base?view=revision&revision=190872 + */ + d->mac_reg[RA] = (nd->macaddr[3]<<24) | (nd->macaddr[2]<<16) | + (nd->macaddr[1]<<8) | nd->macaddr[0]; + d->mac_reg[RA+1] = (nd->macaddr[5]<<8) | nd->macaddr[4]; + d->rxbuf_min_shift = 1; memset(&d->tx, 0, sizeof d->tx);