qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing
@ 2009-08-29 22:23 Juergen Lock
  2009-08-29 23:49 ` malc
  2009-09-02 17:56 ` [Qemu-devel] " Juergen Lock
  0 siblings, 2 replies; 10+ messages in thread
From: Juergen Lock @ 2009-08-29 22:23 UTC (permalink / raw)
  To: freebsd-emulation; +Cc: qemu-devel, Jung-uk Kim

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)
 {

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing
  2009-08-29 22:23 [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing Juergen Lock
@ 2009-08-29 23:49 ` malc
  2009-08-30 19:09   ` Juergen Lock
  2009-09-02 17:56 ` [Qemu-devel] " Juergen Lock
  1 sibling, 1 reply; 10+ messages in thread
From: malc @ 2009-08-29 23:49 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim

On Sun, 30 Aug 2009, Juergen Lock wrote:

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

Less violent way to have it is:

CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"")

[..snip..]

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing
  2009-08-29 23:49 ` malc
@ 2009-08-30 19:09   ` Juergen Lock
  0 siblings, 0 replies; 10+ messages in thread
From: Juergen Lock @ 2009-08-30 19:09 UTC (permalink / raw)
  To: malc; +Cc: freebsd-emulation, Juergen Lock, Jung-uk Kim, qemu-devel

On Sun, Aug 30, 2009 at 03:49:17AM +0400, malc wrote:
> On Sun, 30 Aug 2009, Juergen Lock wrote:
> 
> > 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.)
> 
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-08-29 22:23 [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing Juergen Lock
  2009-08-29 23:49 ` malc
@ 2009-09-02 17:56 ` Juergen Lock
  2009-09-04 19:34   ` Juergen Lock
  1 sibling, 1 reply; 10+ messages in thread
From: Juergen Lock @ 2009-09-02 17:56 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim

On Sun, Aug 30, 2009 at 12:23:39AM +0200, Juergen Lock wrote:
> 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.)
> [...]

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-02 17:56 ` [Qemu-devel] " Juergen Lock
@ 2009-09-04 19:34   ` Juergen Lock
  2009-09-05 15:03     ` Juergen Lock
  2009-09-11 22:04     ` Sebastian Herbszt
  0 siblings, 2 replies; 10+ messages in thread
From: Juergen Lock @ 2009-09-04 19:34 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim

On Wed, Sep 02, 2009 at 07:56:21PM +0200, Juergen Lock wrote:
> On Sun, Aug 30, 2009 at 12:23:39AM +0200, Juergen Lock wrote:
> > 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.)
> > [...]
> 
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-04 19:34   ` Juergen Lock
@ 2009-09-05 15:03     ` Juergen Lock
  2009-09-11 22:04     ` Sebastian Herbszt
  1 sibling, 0 replies; 10+ messages in thread
From: Juergen Lock @ 2009-09-05 15:03 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim

On Fri, Sep 04, 2009 at 09:34:35PM +0200, Juergen Lock wrote:
> On Wed, Sep 02, 2009 at 07:56:21PM +0200, Juergen Lock wrote:
> > On Sun, Aug 30, 2009 at 12:23:39AM +0200, Juergen Lock wrote:
> > > 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.)
> > > [...]
> > 
> > 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. :(

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-04 19:34   ` Juergen Lock
  2009-09-05 15:03     ` Juergen Lock
@ 2009-09-11 22:04     ` Sebastian Herbszt
  2009-09-12 18:35       ` Juergen Lock
  1 sibling, 1 reply; 10+ messages in thread
From: Sebastian Herbszt @ 2009-09-11 22:04 UTC (permalink / raw)
  To: Juergen Lock, Jung-uk Kim; +Cc: freebsd-emulation, qemu-devel

Juergen Lock wrote:
> On Wed, Sep 02, 2009 at 07:56:21PM +0200, Juergen Lock wrote:
>> On Sun, Aug 30, 2009 at 12:23:39AM +0200, Juergen Lock wrote:
>> >  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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-11 22:04     ` Sebastian Herbszt
@ 2009-09-12 18:35       ` Juergen Lock
  2009-09-13 14:38         ` Sebastian Herbszt
  2009-09-13 14:55         ` Sebastian Herbszt
  0 siblings, 2 replies; 10+ messages in thread
From: Juergen Lock @ 2009-09-12 18:35 UTC (permalink / raw)
  To: Sebastian Herbszt
  Cc: freebsd-emulation, Juergen Lock, Jung-uk Kim, qemu-devel

On Sat, Sep 12, 2009 at 12:04:11AM +0200, Sebastian Herbszt wrote:
> Juergen Lock wrote:
> > On Wed, Sep 02, 2009 at 07:56:21PM +0200, Juergen Lock wrote:
> >> On Sun, Aug 30, 2009 at 12:23:39AM +0200, Juergen Lock wrote:
> >> >  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
> 
> 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.

Thanx, seems to work, applied.

	Juergen

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-12 18:35       ` Juergen Lock
@ 2009-09-13 14:38         ` Sebastian Herbszt
  2009-09-13 14:55         ` Sebastian Herbszt
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Herbszt @ 2009-09-13 14:38 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, Jung-uk Kim, qemu-devel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: experimental FreeBSD qemu-devel git head port update for testing
  2009-09-12 18:35       ` Juergen Lock
  2009-09-13 14:38         ` Sebastian Herbszt
@ 2009-09-13 14:55         ` Sebastian Herbszt
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Herbszt @ 2009-09-13 14:55 UTC (permalink / raw)
  To: Juergen Lock; +Cc: freebsd-emulation, Jung-uk Kim, qemu-devel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-09-13 14:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-29 22:23 [Qemu-devel] experimental FreeBSD qemu-devel git head port update for testing Juergen Lock
2009-08-29 23:49 ` malc
2009-08-30 19:09   ` Juergen Lock
2009-09-02 17:56 ` [Qemu-devel] " Juergen Lock
2009-09-04 19:34   ` Juergen Lock
2009-09-05 15:03     ` Juergen Lock
2009-09-11 22:04     ` Sebastian Herbszt
2009-09-12 18:35       ` Juergen Lock
2009-09-13 14:38         ` Sebastian Herbszt
2009-09-13 14:55         ` Sebastian Herbszt

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