Received: from eggs.gnu.org ([2001:4830:134:3::10]:43704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF7Zo-0004Qn-Sk for qemu-devel@nongnu.org; Fri, 01 Jan 2016 16:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aF7Zl-0006Mi-Mr for qemu-devel@nongnu.org; Fri, 01 Jan 2016 16:49:36 -0500 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:36714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aF7Zl-0006Me-Hr for qemu-devel@nongnu.org; Fri, 01 Jan 2016 16:49:33 -0500 Received: by mail-ig0-x231.google.com with SMTP id ph11so213073162igc.1 for ; Fri, 01 Jan 2016 13:49:33 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <5686F16C.10205@redhat.com> Date: Fri, 1 Jan 2016 16:49:30 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <4A19E578-26E4-40D7-BC03-BC959D9567D2@gmail.com> References: <5682F552.90305@ilande.co.uk> <9C26B2B6-1384-437E-B60F-8CC452F2F159@gmail.com> <5686F16C.10205@redhat.com> Subject: Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jasowang@redhat.com, Mark Cave-Ayland , qemu-devel qemu-devel On Jan 1, 2016, at 4:36 PM, Paolo Bonzini wrote: >=20 >=20 > On 30/12/2015 01:35, Programmingkid wrote: >> After a lot of stepping thru code using gdb, I found out that a >> MemoryRegions's enabled member variable was set to false, causing a = zero >> value being returned every time. When I set the value to true, that = is >> when the magic started happening. For the first time, data between = the >> driver and the emulated nic matched. It didn't take me too long to >> figure out where to put the code needed to make communications = possible. >>=20 >> I would build the Mac OS X driver inside of QEMU using Mac OS 10.4 >> as a guest. I used XCode to build the driver. To run the driver I = used >> these commands: >>=20 >> "sudo su" once to go into root. >> cp -R /AppleRTL8139.kext /tmp >> kextload /tmp/AppleRTL8139.kext >> Then review all the debug text I would see in the Console = application. =20 >> kextunload /tmp/AppleRTL8139.kext - unload the driver so I could = test more changes without rebooting. >>=20 >> I would sometimes go into the Network Pane inside of the System >> Preferences to see if the nic was working. After a lot of hard work, >> I was able to watch a YouTube video inside of QEMU with this patch >> applied. >=20 > Since you have the source, why don't you fix the driver instead? I don't offer a fixed driver because I honestly don't know that the = driver is broken. It is also a lot more convenient for the user to just switch on a macro than have to install a custom driver (IMHO). >=20 > These changes to QEMU, unfortunately, are not correct. Reordering the > BARs breaks Linux in all likelihood, and the bus master enable bit is > there to avoid undesired memory corruptions on e.g. reset. (This does > not cover the fact that #ifdefs are not the way to handle > backwards-compatibility; 99% of the QEMU users do not build from = source). I didn't know that many users of QEMU do not build from source. I = thought it was the other way around. I don't like this solution also. A one size = fits all solution is what I was hoping for.=20 > I guess you _could_ add a property to ignore the bus master enable bit > on a per-device basis (or per-class using -global). But still, fixing > the driver seems much, much simpler. Both reordering the BARs, and > setting the bus master bit in the command register after = initialization > is complete, should be easy to do. Mark and I are working on an issue with the bus master bit in the = command register. It appears to be set to false sometime after Mac OS X starts booting. I = only found this out yesterday. Happy New Years to all=