From owner-freebsd-emulation@FreeBSD.ORG Sat Aug 29 22:27:52 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 AF11B106564A for ; Sat, 29 Aug 2009 22:27:52 +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 306348FC14 for ; Sat, 29 Aug 2009 22:27:51 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 709B71E00363; Sun, 30 Aug 2009 00:27:50 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n7TMNdmU093634; Sun, 30 Aug 2009 00:23:39 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n7TMNdT5093633; Sun, 30 Aug 2009 00:23:39 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sun, 30 Aug 2009 00:23:39 +0200 To: freebsd-emulation@FreeBSD.org Message-ID: <20090829222339.GA93608@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: qemu-devel@nongnu.org, Jung-uk Kim Subject: experimental FreeBSD qemu-devel git head port update for testing 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: Sat, 29 Aug 2009 22:27:52 -0000 Hi! Jan Kiszka asked me if the unstable guest timer irq problem still exists on qemu git head, so I made an update for that today: http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patch (and found out it does.) The bad news (for FreeBSD users anyway) is kqemu support has now been removed as `promised' (by the upstream qemu developers), so testing this version is probably less interesting for many FreeBSD users than the qemu 0.11 stable branch snapshot I posted about here, http://lists.freebsd.org/pipermail/freebsd-emulation/2009-August/006646.html but e.g. users of non-x86 targets probably will still be interested. Also the pcap patch stopped working in this snapshot and I don't yet know why. (I think the original version of that patch was submitted by Jung-uk Kim, maybe he has an idea; Cc'd.) Other misc notes: 1. I had to replace the line CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") by CFLAGS += -fno-stack-protector in qemu/pc-bios/optionrom/Makefile because now make complained about recursive use of CFLAGS (in addition to forcing use of a newer as(1) for multiboot.S as already mentioned for the 0.11 rc, see files/patch-pc-bios-optionrom-Makefile in the update.) 2. vl.c references __FreeBSD_version in a few places but still didn't #include to get the definition: Index: qemu/vl.c @@ -57,6 +57,7 @@ #include #if defined(__FreeBSD__) || defined(__DragonFly__) #include +#include #else #include #endif 3. Do you guys think the posix timer patch is ready to be committed now? It _might_ cause -lrt to end up in $LIBS twice now tho. (not on FreeBSD since clock_gettime() is in libc there.) Btw it (-clock dynticks) also does't help the mentioned timer irq problems... Index: qemu/configure @@ -1538,6 +1538,20 @@ LIBS="-lrt $LIBS" fi +########################################## +# posix timer probe +cat > $TMPC < +int main(void) { timer_create(CLOCK_REALTIME, (struct sigevent *)NULL, (timer_t *)NULL); return 0; } +EOF +posixtimer=no +if compile_prog "" "" ; then + posixtimer=yes +elif compile_prog "" "-lrt" ; then + posixtimer=yes + LIBS="-lrt $LIBS" +fi + # Determine what linker flags to use to force archive inclusion check_linker_flags() { @@ -1872,6 +1886,9 @@ if test "$fdt" = "yes" ; then echo "CONFIG_FDT=y" >> $config_host_mak fi +if test "$posixtimer" = "yes" ; then + echo "CONFIG_POSIX_TIMER=y" >> $config_host_mak +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then Index: qemu/vl.c @@ -918,12 +918,16 @@ static int unix_start_timer(struct qemu_alarm_timer *t); static void unix_stop_timer(struct qemu_alarm_timer *t); -#ifdef __linux__ +#ifdef CONFIG_POSIX_TIMER static int dynticks_start_timer(struct qemu_alarm_timer *t); static void dynticks_stop_timer(struct qemu_alarm_timer *t); static void dynticks_rearm_timer(struct qemu_alarm_timer *t); +#endif + +#ifdef __linux__ + static int hpet_start_timer(struct qemu_alarm_timer *t); static void hpet_stop_timer(struct qemu_alarm_timer *t); @@ -1001,9 +1005,11 @@ static struct qemu_alarm_timer alarm_timers[] = { #ifndef _WIN32 -#ifdef __linux__ +#ifdef CONFIG_POSIX_TIMER {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer, dynticks_stop_timer, dynticks_rearm_timer, NULL}, +#endif +#ifdef __linux__ /* HPET - if available - is preferred */ {"hpet", 0, hpet_start_timer, hpet_stop_timer, NULL, NULL}, /* ...otherwise try RTC */ @@ -1361,7 +1367,7 @@ return delta; } -#if defined(__linux__) || defined(_WIN32) +#if defined(CONFIG_POSIX_TIMER) || defined(_WIN32) static uint64_t qemu_next_deadline_dyntick(void) { int64_t delta; @@ -1506,6 +1512,10 @@ close(rtc_fd); } +#endif /* defined(__linux__) */ + +#ifdef CONFIG_POSIX_TIMER + static int dynticks_start_timer(struct qemu_alarm_timer *t) { struct sigevent ev; @@ -1577,7 +1587,7 @@ } } -#endif /* defined(__linux__) */ +#endif /* defined(CONFIG_POSIX_TIMER) */ static int unix_start_timer(struct qemu_alarm_timer *t) { Signed-off-by: Juergen Lock