experimental FreeBSD qemu-devel git head port update for testing
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 <sys/param.h> to get the definition:
Index: qemu/vl.c
@@ -57,6 +57,7 @@
#include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__) #include <libutil.h>
+#include <sys/param.h>
#else
#include <util.h>
#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 <<EOF
+#include <time.h>
+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) {
Quoted 20 lines · Juergen Lock
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.htmlbut 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:
Quoted 8 lines
1. I had to replace the line
CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") by CFLAGS += -fno-stack-protectorin 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.Sas already mentioned for the 0.11 rc, see files/patch-pc-bios-optionrom-Makefile in the update.)
Less violent way to have it is:
CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
[..snip..]
Signature · 1 line
mailto:[email protected]
Quoted 31 lines · malc
Quoted 20 lines · Juergen Lock
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.htmlbut 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:
Quoted 8 lines
1. I had to replace the line
CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") by CFLAGS += -fno-stack-protectorin 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.Sas already mentioned for the 0.11 rc, see files/patch-pc-bios-optionrom-Makefile in the update.)
Quoted 5 lines
Less violent way to have it is:
CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
[..snip..]
Thanx, that seems to work as well.
Juergen
Quoted 11 lines · Juergen Lock
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,
Quoted 7 lines
http://lists.freebsd.org/pipermail/freebsd-emulation/2009-August/006646.htmlbut 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.)
[...]
Jung-uk Kim sent me a new pcap patch (thanx! :), and I have just included it in the mentioned update at
http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patch
Enjoy,
Juergen
Quoted 15 lines · Juergen Lock
Quoted 14 lines · Juergen Lock
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.htmlbut e.g. users of non-x86 targets probably will still be interested.
Quoted 8 lines
Quoted 4 lines
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.)
[...]Jung-uk Kim sent me a new pcap patch (thanx! :), and I have just included it in the mentioned update at
http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patch
New update at the same place, Jung-uk Kim sent me another version of the pcap patch and while I was at it I added the tap close patch and removed the dynticks patch since it seems to perform even worse than -clock unix on FreeBSD. :(
Happy testing...
Juergen
Quoted 21 lines · Juergen Lock
Quoted 20 lines · Juergen Lock
Quoted 18 lines · Juergen Lock
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.htmlbut 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.)
[...]
Quoted 8 lines
Quoted 3 lines
Jung-uk Kim sent me a new pcap patch (thanx! :), and I have just included it in the mentioned update at
http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patchNew update at the same place, Jung-uk Kim sent me another version of the pcap patch and while I was at it I added the tap close patch and removed the dynticks patch since it seems to perform even worse than -clock unix on FreeBSD. :(
I forgot to mention this update also fixes the build on FreeBSD 7 (libmath didn't get built properly), apologies if you were affected...
Juergen
Quoted 7 lines · Juergen Lock
Quoted 6 lines · Juergen Lock
Quoted 4 lines · Juergen Lock
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.)
[...]
Quoted 6 lines
Quoted 3 lines
Jung-uk Kim sent me a new pcap patch (thanx! :), and I have just included it in the mentioned update at
http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patchNew update at the same place, Jung-uk Kim sent me another version of the pcap patch
configure changes the LIBS variable (LIBS="$libpcap $LIBS"), which is not only used for the qemu binary, but also for qemu-nbd, qemu-io and qemu-img. Linking those with libpcap should not be required. Consider changing
LIBS="$libpcap $LIBS"
to
libs_softmmu="$libpcap $libs_softmmu"
which seems to fix this.
- Sebastian
Quoted 19 lines · Sebastian Herbszt
Quoted 7 lines · Juergen Lock
Quoted 6 lines · Juergen Lock
Quoted 4 lines · Juergen Lock
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.)
[...]Quoted 6 lines
Quoted 3 lines
Jung-uk Kim sent me a new pcap patch (thanx! :), and I have just included it in the mentioned update at
http://people.freebsd.org/~nox/qemu/qemu-devel-20090829.patchNew update at the same place, Jung-uk Kim sent me another version of the pcap patch
configure changes the LIBS variable (LIBS="$libpcap $LIBS"), which is not only used for the qemu binary, but also for qemu-nbd, qemu-io and qemu-img. Linking those with libpcap should not be required. Consider changing
Quoted 7 lines
LIBS="$libpcap $LIBS"
to
libs_softmmu="$libpcap $libs_softmmu"
which seems to fix this.
Thanx, seems to work, applied.
Juergen
Replace own invokation of $cc with compile_prog (patch will likely not apply).
- Sebastian
@@ -37,7 +37,7 @@
+ else
+ libpcap=-lwpcap
+ fi
-+ if ! $cc $ARCH_CFLAGS -o $TMPE $libpcap $TMPC 2> /dev/null ; then ++ if ! compile_prog "" "$libpcap" ; then
+ echo + echo "Error: Could not find pcap" + echo "Make sure to have the pcap libs and headers installed."
@@ -52,7 +52,7 @@
+ return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0); +}
+EOF
-+ if $cc $ARCH_CFLAGS -o $TMPE $libpcap $TMPC 2> /dev/null ; then ++ if compile_prog "" "$libpcap" ; then
+ pcap_create="yes"
+ fi
+ cat > $TMPC << EOF
@@ -61,10 +61,9 @@
+#include <net/bpf.h>
+int main(void) { return (BPF_MAJOR_VERSION); }
+EOF
-+ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then ++ if compile_prog "" "" ; then
+ bpf="yes"
+ fi
-+# LIBS="$libpcap $LIBS"
+ libs_softmmu="$libpcap $libs_softmmu"
+fi # test "$pcap"
+
@@ -72,7 +71,7 @@
This change seems wrong:
+ if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) {
-+ fprintf(stderr, "qemu: pcap_lookupdev: %s\n", errbuf);
++ fprintf(stderr, "qemu: pcap_create: %s\n", errbuf);
+ goto fail;
+ }
- Sebastian