qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] rewrote timer implementation for rtl8139.


From: Frediano Ziglio
Subject: Re: [Qemu-devel] [PATCH] rewrote timer implementation for rtl8139.
Date: Sat, 20 Feb 2010 17:14:41 +0100

2010/2/20 Igor Kovalenko <address@hidden>:
> On Sat, Feb 20, 2010 at 2:26 AM, Anthony Liguori <address@hidden> wrote:
>> On 02/19/2010 04:22 PM, Alexander Graf wrote:
>>>
>>> On 19.02.2010, at 22:50, Anthony Liguori wrote:
>>>
>>>
>>>>
>>>> On 02/16/2010 02:35 AM, Frediano Ziglio wrote:
>>>>
>>>>>
>>>>> Add a QEMU timer only when needed (timeout status not set, timeout
>>>>> irq wanted and timer set).
>>>>>
>>>>> This patch is required for Darwin. Patch has been tested under
>>>>> FreeBSD, Darwin and Linux.
>>>>>
>>>>> Signed-off-by: Frediano Ziglio<address@hidden>
>>>>>
>>>>>
>>>>
>>>> Alex, I know you've played with this feature for OS X in the past.
>>>>
>>>> Is this something we should be enabling unconditionally?
>>>>
>>>
>>> I've played with it and realized that
>>>
>>> 1) OSX's rtl8139 driver uses this timer instead of tx/rx interrupts to
>>> process the queue
>>> 2) it was broken
>>>
>>> I haven't gotten around to test if this patch makes it work, but I'd
>>> suppose so.
>>>
>>> So yes, I think it should be enabled by default. It's a feature real hw
>>> has, so we should emulate it.
>>>
>>
>> The thing that concerns me is why it was disabled by default.  Igor, what
>> was the reasoning for disabling it if you recall?
>
> It was very inefficient pci timer implementation which fired callback
> frequently.
> Once it was found that (freebsd?) was relying on pci timer in realtek driver
> to communicate we just added missing piece.
>
> Now this patch fixes that inefficiency issue.
>

I'm not that use with this ML way... sorry if somebody will receive a
lot of SPAM...

I updated my patch with Anthony suggestions (just code style).

Previous code (current git) issue a timer every pci tick (about 33
millions per second!) in order to compute correctly TCTR. This patch
enable QEMU timers only when strictly needed (for interrupt purposes)
computing TCTR when needed (only on driver read).

I tested with patch under Linux, FreeBSD and Darwin (Mac OS X) and it
works correctly. I also bought a physical card to test the behaviour
with a small test program and test program work with emulated code too
(previously code does not). I sent the test program but I don't know
if is possible to integrate it into QEMU code (is a standalone test).

Frediano Ziglio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]