From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NeQwC-0006Qq-Gr for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:33:52 -0500 Received: from [199.232.76.173] (port=39988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NeQwB-0006QR-Ll for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:33:51 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NeQw5-0003Dp-7A for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:33:51 -0500 Received: from mx20.gnu.org ([199.232.41.8]:61838) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NeQw4-0003Bu-1Y for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:33:44 -0500 Received: from mail-ww0-f45.google.com ([74.125.82.45]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NeQvv-0006PY-GF for qemu-devel@nongnu.org; Mon, 08 Feb 2010 05:33:35 -0500 Received: by wwb17 with SMTP id 17so253186wwb.4 for ; Mon, 08 Feb 2010 02:33:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 8 Feb 2010 11:33:31 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCH] rtl8139 timer interrupt rewrote From: Frediano Ziglio Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Kovalenko Cc: qemu-devel@nongnu.org 2010/2/8 Igor Kovalenko : > On Sun, Feb 7, 2010 at 6:22 PM, Frediano Ziglio wrote: >> rewrote timer implementation for rtl8139. Add a QEMU >> timer only when needed (timeout status not set, timeout irq wanted and >> timer set). >> >> Signed-off-by: Frediano Ziglio >> -- >> diff --git a/hw/rtl8139.c b/hw/rtl8139.c >> index f04dd54..0d877b7 100644 >> --- a/hw/rtl8139.c >> +++ b/hw/rtl8139.c >> @@ -41,6 +41,10 @@ >> * segmentation offloading >> * Removed slirp.h dependency >> * Added rx/tx buffer reset when >> enabling rx/tx operation >> + * >> + * 2009-Feb-04 Frediano Ziglio: Rewrote timer support using QEMU timer only >> + * when strictly needed (required for for >> + * Darwin) >> */ >> >> #include "hw.h" >> @@ -61,7 +65,7 @@ >> #define RTL8139_CALCULATE_RXCRC 1 >> >> /* Uncomment to enable on-board timer interrupts */ >> -//#define RTL8139_ONBOARD_TIMER 1 >> +#define RTL8139_ONBOARD_TIMER 1 > > Please remove this macro. > Removed (see updated patch) >> >> +static void rtl8139_pre_save(void *opaque) >> +{ >> + RTL8139State* s = opaque; >> + >> + // set IntrStatus correctly >> + int64_t current_time = qemu_get_clock(vm_clock); >> + rtl8139_set_next_tctr_time(s, current_time); >> + s->TCTR = muldiv64(current_time - s->TCTR_base, PCI_FREQUENCY, >> + get_ticks_per_sec()); >> +} >> + > > Seems like TCTR is not used after restoring from saved state. Is it intentional? > Yes, wanted, mainly TCTR is computed from TCTR_base and tick counts so is currently quite unused but is computed for compatibility with previous state. > Can you please check if freebsd works with this change? > Yes, it works correctly. I don't know FreeBSD that much but I downloaded latest 8.0 live version, got a shell, configured with network manually with old ifconfig and tried some data exchange (mainly scp/ssh). Regards Frediano Ziglio