qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Programmingkid <programmingkidx@gmail.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	jasowang@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4
Date: Fri, 1 Jan 2016 22:36:44 +0100	[thread overview]
Message-ID: <5686F16C.10205@redhat.com> (raw)
In-Reply-To: <9C26B2B6-1384-437E-B60F-8CC452F2F159@gmail.com>



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.
> 
> 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:
> 
> "sudo su" once to go into root.
> cp -R <path to xcode build directory>/AppleRTL8139.kext /tmp
> kextload /tmp/AppleRTL8139.kext
> Then review all the debug text I would see in the Console application.  
> kextunload /tmp/AppleRTL8139.kext  - unload the driver so I could test more changes without rebooting.
> 
> 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.

Since you have the source, why don't you fix the driver instead?

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 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.

Paolo

  parent reply	other threads:[~2016-01-01 21:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-29 17:59 [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4 Programmingkid
2015-12-29 21:04 ` Mark Cave-Ayland
2015-12-30  0:05   ` Programmingkid
2015-12-30  0:35     ` Programmingkid
2015-12-30 14:03       ` Mark Cave-Ayland
2015-12-30 16:47         ` Programmingkid
2015-12-30 16:58           ` Mark Cave-Ayland
2015-12-30 17:50             ` Programmingkid
2015-12-31 13:23               ` Mark Cave-Ayland
2015-12-31 18:26                 ` Programmingkid
2015-12-31 18:56                   ` Mark Cave-Ayland
2015-12-31 19:47                     ` Programmingkid
2016-01-02  4:00                     ` Programmingkid
2016-01-02  9:39                       ` Mark Cave-Ayland
2016-01-02 17:08                         ` Programmingkid
2016-01-02 20:46                           ` Mark Cave-Ayland
2016-01-01 21:36       ` Paolo Bonzini [this message]
2016-01-01 21:49         ` Programmingkid
2016-01-01 20:32 ` Paolo Bonzini
2016-01-01 20:42   ` Programmingkid
2016-01-01 22:36     ` Paolo Bonzini
2016-01-01 22:42       ` Programmingkid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5686F16C.10205@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).