Skip to contentSkip to conversation

Trivial patches for May 30 to June 8 2011

GIT PULL New Stefan Hajnoczi 2 participants 8 messages Jun 8, 2011 – Jun 9, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The following changes since commit a90d4690074526f54ad0851fce19fa6783f06803:

Add an isa device for SGA (2011-06-07 13:52:30 -0500)

are available in the git repository at:
git://repo.or.cz/qemu/stefanha.git trivial-patches

Alexander Graf (1):
slirp: fix guestfwd id

Alexandre Raymond (2):
Fix compilation warning due to missing header for sigaction Fix compilation warning due to missing header for sigaction (followup)

Jan Kiszka (1):
virtio: Move virtio-pci to hw library

Laurent Vivier (1):

      m68k: Replace gen_im32() by tcg_const_i32()

Martin Simmons (1):
target-i386: Make x86 mfence and lfence illegal without SSE2

 Makefile.objs           |    1 +
 Makefile.target         |    1 -
 audio/audio_pt_int.c    |    2 --
 audio/sdlaudio.c        |    1 -
 block/raw-posix.c       |    2 --
 bsd-user/syscall.c      |    1 -
 darwin-user/signal.c    |    3 ---
 exec.c                  |    1 -
 linux-user/signal.c     |    1 -
 net/slirp.c             |    2 +-
 net/tap.c               |    1 -
 posix-aio-compat.c      |    1 -
 qemu-char.c             |    1 -
 qemu-common.h           |    1 +
 qemu-progress.c         |    1 -
 savevm.c                |    1 -
 target-i386/helper.c    |    1 -
 target-i386/translate.c |    2 +-
 target-m68k/translate.c |   43 ++++++++++++++++++++-----------------------
 target-ppc/helper.c     |    1 -
 target-sparc/helper.c   |    1 -
 ui/curses.c             |    1 -
 ui/sdl.c                |    4 ----
 usb-bsd.c               |    1 -
 usb-linux.c             |    1 -
 25 files changed, 24 insertions(+), 52 deletions(-)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/6 Fix compilation warning due to missing header for sigaction

From: Alexandre Raymond <[email protected]>

Fix the following warning by including signal.h directly in qemu-common.h ----8<----
iohandler.c: In function ‘qemu_init_child_watch’:
iohandler.c:172: warning: implicit declaration of function ‘sigaction’ iohandler.c:172: warning: nested extern declaration of ‘sigaction’ ----8<----

---
 qemu-common.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
qemu-common.h +1 -0
index b851b20..39fabc9 100644
@@ -39,6 +39,7 @@ typedef struct Monitor Monitor;
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <assert.h>
+#include <signal.h>
 
 #ifdef _WIN32
 #include "qemu-os-win32.h"
Signature · 1 line
1.7.4.4
#2 lore raw

PATCH 2/6 Fix compilation warning due to missing header for sigaction (followup)

In reply to Stefan Hajnoczi

From: Alexandre Raymond <[email protected]>

This patch removes all references to signal.h when qemu-common.h is included as they become redundant.

---
 audio/audio_pt_int.c  |    2 --
 audio/sdlaudio.c      |    1 -
 block/raw-posix.c     |    2 --
 bsd-user/syscall.c    |    1 -
 darwin-user/signal.c  |    3 ---
 exec.c                |    1 -
 linux-user/signal.c   |    1 -
 net/tap.c             |    1 -
 posix-aio-compat.c    |    1 -
 qemu-char.c           |    1 -
 qemu-progress.c       |    1 -
 savevm.c              |    1 -
 target-i386/helper.c  |    1 -
 target-ppc/helper.c   |    1 -
 target-sparc/helper.c |    1 -
 ui/curses.c           |    1 -
 ui/sdl.c              |    4 ----
 usb-bsd.c             |    1 -
 usb-linux.c           |    1 -
 19 files changed, 0 insertions(+), 26 deletions(-)
audio/audio_pt_int.c +0 -2
index 908c569..9a9c306 100644
@@ -6,8 +6,6 @@
 #include "audio_int.h"
 #include "audio_pt_int.h"
 
-#include <signal.h>
-
 static void GCC_FMT_ATTR(3, 4) logerr (struct audio_pt *pt, int err,
                                        const char *fmt, ...)
 {
audio/sdlaudio.c +0 -1
index a847aa9..d24daa5 100644
@@ -32,7 +32,6 @@
 #elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #include <pthread.h>
 #endif
-#include <signal.h>
 #endif
 
 #define AUDIO_CAP "sdl"
block/raw-posix.c +0 -2
index 6b72470..9a72a17 100644
@@ -43,7 +43,6 @@
 
 #ifdef __sun__
 #define _POSIX_PTHREAD_SEMANTICS 1
-#include <signal.h>
 #include <sys/dkio.h>
 #endif
 #ifdef __linux__
@@ -53,7 +52,6 @@
 #include <linux/fd.h>
 #endif
 #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
-#include <signal.h>
 #include <sys/disk.h>
 #include <sys/cdio.h>
 #endif
bsd-user/syscall.c +0 -1
index eb1cdf2..d4d039a 100644
@@ -31,7 +31,6 @@
 #include <sys/syscall.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
-#include <signal.h>
 #include <utime.h>
 
 #include "qemu.h"
darwin-user/signal.c +0 -3
index 4862018..e2adca3 100644
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <signal.h>
 #include <errno.h>
 #include <sys/ucontext.h>
 
@@ -32,8 +31,6 @@
 #undef uc_link
 #endif
 
-#include <signal.h>
-
 #include "qemu.h"
 #include "qemu-common.h"
 
exec.c +0 -1
index 6f339ef..bffc201 100644
@@ -36,7 +36,6 @@
 #include "qemu-timer.h"
 #if defined(CONFIG_USER_ONLY)
 #include <qemu.h>
-#include <signal.h>
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/param.h>
 #if __FreeBSD_version >= 700104
linux-user/signal.c +0 -1
index c7a375f..11b25be 100644
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <signal.h>
 #include <errno.h>
 #include <assert.h>
 #include <sys/ucontext.h>
net/tap.c +0 -1
index b8cd252..1f26dc9 100644
@@ -27,7 +27,6 @@
 
 #include "config-host.h"
 
-#include <signal.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
posix-aio-compat.c +0 -1
index f3cc868..c4116e3 100644
@@ -17,7 +17,6 @@
 #include <unistd.h>
 #include <errno.h>
 #include <time.h>
-#include <signal.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
qemu-char.c +0 -1
index 5e04a20..fb13b28 100644
@@ -35,7 +35,6 @@
 
 #include <unistd.h>
 #include <fcntl.h>
-#include <signal.h>
 #include <time.h>
 #include <errno.h>
 #include <sys/time.h>
qemu-progress.c +0 -1
index 8ebe8ef..5f1b8df 100644
@@ -26,7 +26,6 @@
 #include "osdep.h"
 #include "sysemu.h"
 #include <stdio.h>
-#include <signal.h>
 
 struct progress_state {
     float current;
savevm.c +0 -1
index f4ff1a1..939845c 100644
@@ -23,7 +23,6 @@
  */
 #include <unistd.h>
 #include <fcntl.h>
-#include <signal.h>
 #include <time.h>
 #include <errno.h>
 #include <sys/time.h>
target-i386/helper.c +0 -1
index 5c4b288..509d68c 100644
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
-#include <signal.h>
 
 #include "cpu.h"
 #include "exec-all.h"
target-ppc/helper.c +0 -1
index 4700632..cf2a368 100644
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
-#include <signal.h>
 
 #include "cpu.h"
 #include "exec-all.h"
target-sparc/helper.c +0 -1
index b2d4d70..e9b42d0 100644
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <inttypes.h>
-#include <signal.h>
 
 #include "cpu.h"
 #include "exec-all.h"
ui/curses.c +0 -1
index 82bc614..d29b6cf 100644
@@ -24,7 +24,6 @@
 #include <curses.h>
 
 #ifndef _WIN32
-#include <signal.h>
 #include <sys/ioctl.h>
 #include <termios.h>
 #endif
ui/sdl.c +0 -4
index 14a62d9..f2bd4a0 100644
@@ -28,10 +28,6 @@
 #include <SDL.h>
 #include <SDL_syswm.h>
 
-#ifndef _WIN32
-#include <signal.h>
-#endif
-
 #include "qemu-common.h"
 #include "console.h"
 #include "sysemu.h"
usb-bsd.c +0 -1
index 9bab6e3..c1bcc4a 100644
@@ -39,7 +39,6 @@
 #else
 #include <bus/usb/usb.h>
 #endif
-#include <signal.h>
 
 /* This value has maximum potential at 16.
  * You should also set hw.usb.debug to gain
usb-linux.c +0 -1
index baa6574..fcfa09e 100644
@@ -37,7 +37,6 @@
 
 #include <dirent.h>
 #include <sys/ioctl.h>
-#include <signal.h>
 
 #include <linux/usbdevice_fs.h>
 #include <linux/version.h>
Signature · 1 line
1.7.4.4
#3 lore raw

PATCH 3/6 slirp: fix guestfwd id

In reply to Stefan Hajnoczi

From: Alexander Graf <[email protected]>

When using -net user,guestfwd=... Qemu immediately complains about the id being in invalid format. This is because we pass in an id that contains a colon, while the id restrictions don't allow colons.

This patch changes the colon into a dot, making guestfwd work again.

---
 net/slirp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/slirp.c +1 -1
index e387a11..e057a14 100644
@@ -614,7 +614,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
     }
 
     fwd = qemu_malloc(sizeof(struct GuestFwd));
-    snprintf(buf, sizeof(buf), "guestfwd.tcp:%d", port);
+    snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port);
     fwd->hd = qemu_chr_open(buf, p, NULL);
     if (!fwd->hd) {
         error_report("could not open guest forwarding device '%s'", buf);
Signature · 1 line
1.7.4.4
#4 lore raw

PATCH 4/6 m68k: Replace gen_im32() by tcg_const_i32()

In reply to Stefan Hajnoczi

From: Laurent Vivier <[email protected]>

---
 target-m68k/translate.c |   43 ++++++++++++++++++++-----------------------
 1 files changed, 20 insertions(+), 23 deletions(-)
target-m68k/translate.c +20 -23
index 9e5578d..26f0ee4 100644
@@ -171,9 +171,6 @@ typedef void (*disas_proc)(DisasContext *, uint16_t);
   static void disas_##name (DisasContext *s, uint16_t insn)
 #endif
 
-/* FIXME: Remove this.  */
-#define gen_im32(val) tcg_const_i32(val)
-
 /* Generate a load from the specified address.  Narrow values are
    sign extended to full register width.  */
 static inline TCGv gen_load(DisasContext * s, int opsize, TCGv addr, int sign)
@@ -339,7 +336,7 @@ static TCGv gen_lea_indexed(DisasContext *s, int opsize, TCGv base)
         if ((ext & 0x80) == 0) {
             /* base not suppressed */
             if (IS_NULL_QREG(base)) {
-                base = gen_im32(offset + bd);
+                base = tcg_const_i32(offset + bd);
                 bd = 0;
             }
             if (!IS_NULL_QREG(add)) {
@@ -355,7 +352,7 @@ static TCGv gen_lea_indexed(DisasContext *s, int opsize, TCGv base)
                 add = tmp;
             }
         } else {
-            add = gen_im32(bd);
+            add = tcg_const_i32(bd);
         }
         if ((ext & 3) != 0) {
             /* memory indirect */
@@ -536,15 +533,15 @@ static TCGv gen_lea(DisasContext *s, uint16_t insn, int opsize)
         case 0: /* Absolute short.  */
             offset = ldsw_code(s->pc);
             s->pc += 2;
-            return gen_im32(offset);
+            return tcg_const_i32(offset);
         case 1: /* Absolute long.  */
             offset = read_im32(s);
-            return gen_im32(offset);
+            return tcg_const_i32(offset);
         case 2: /* pc displacement  */
             offset = s->pc;
             offset += ldsw_code(s->pc);
             s->pc += 2;
-            return gen_im32(offset);
+            return tcg_const_i32(offset);
         case 3: /* pc index+displacement.  */
             return gen_lea_indexed(s, opsize, NULL_QREG);
         case 4: /* Immediate.  */
@@ -1209,16 +1206,16 @@ DISAS_INSN(arith_im)
         break;
     case 2: /* subi */
         tcg_gen_mov_i32(dest, src1);
-        gen_helper_xflag_lt(QREG_CC_X, dest, gen_im32(im));
+        gen_helper_xflag_lt(QREG_CC_X, dest, tcg_const_i32(im));
         tcg_gen_subi_i32(dest, dest, im);
-        gen_update_cc_add(dest, gen_im32(im));
+        gen_update_cc_add(dest, tcg_const_i32(im));
         s->cc_op = CC_OP_SUB;
         break;
     case 3: /* addi */
         tcg_gen_mov_i32(dest, src1);
         tcg_gen_addi_i32(dest, dest, im);
-        gen_update_cc_add(dest, gen_im32(im));
-        gen_helper_xflag_lt(QREG_CC_X, dest, gen_im32(im));
+        gen_update_cc_add(dest, tcg_const_i32(im));
+        gen_helper_xflag_lt(QREG_CC_X, dest, tcg_const_i32(im));
         s->cc_op = CC_OP_ADD;
         break;
     case 5: /* eori */
@@ -1228,7 +1225,7 @@ DISAS_INSN(arith_im)
     case 6: /* cmpi */
         tcg_gen_mov_i32(dest, src1);
         tcg_gen_subi_i32(dest, dest, im);
-        gen_update_cc_add(dest, gen_im32(im));
+        gen_update_cc_add(dest, tcg_const_i32(im));
         s->cc_op = CC_OP_SUB;
         break;
     default:
@@ -1324,8 +1321,8 @@ DISAS_INSN(clr)
     default:
         abort();
     }
-    DEST_EA(insn, opsize, gen_im32(0), NULL);
-    gen_logic_cc(s, gen_im32(0));
+    DEST_EA(insn, opsize, tcg_const_i32(0), NULL);
+    gen_logic_cc(s, tcg_const_i32(0));
 }
 
 static TCGv gen_get_ccr(DisasContext *s)
@@ -1589,7 +1586,7 @@ DISAS_INSN(jump)
     }
     if ((insn & 0x40) == 0) {
         /* jsr */
-        gen_push(s, gen_im32(s->pc));
+        gen_push(s, tcg_const_i32(s->pc));
     }
     gen_jmp(s, tmp);
 }
@@ -1617,7 +1614,7 @@ DISAS_INSN(addsubq)
             tcg_gen_addi_i32(dest, dest, val);
         }
     } else {
-        src2 = gen_im32(val);
+        src2 = tcg_const_i32(val);
         if (insn & 0x0100) {
             gen_helper_xflag_lt(QREG_CC_X, dest, src2);
             tcg_gen_subi_i32(dest, dest, val);
@@ -1666,7 +1663,7 @@ DISAS_INSN(branch)
     }
     if (op == 1) {
         /* bsr */
-        gen_push(s, gen_im32(s->pc));
+        gen_push(s, tcg_const_i32(s->pc));
     }
     gen_flush_cc_op(s);
     if (op > 1) {
@@ -1757,7 +1754,7 @@ DISAS_INSN(mov3q)
     val = (insn >> 9) & 7;
     if (val == 0)
         val = -1;
-    src = gen_im32(val);
+    src = tcg_const_i32(val);
     gen_logic_cc(s, src);
     DEST_EA(insn, OS_LONG, src, NULL);
 }
@@ -1883,7 +1880,7 @@ DISAS_INSN(shift_im)
     tmp = (insn >> 9) & 7;
     if (tmp == 0)
         tmp = 8;
-    shift = gen_im32(tmp);
+    shift = tcg_const_i32(tmp);
     /* No need to flush flags becuse we know we will set C flag.  */
     if (insn & 0x100) {
         gen_helper_shl_cc(reg, cpu_env, reg, shift);
@@ -2191,7 +2188,7 @@ DISAS_INSN(fpu)
         switch ((ext >> 10) & 7) {
         case 4: /* FPCR */
             /* Not implemented.  Always return zero.  */
-            tmp32 = gen_im32(0);
+            tmp32 = tcg_const_i32(0);
             break;
         case 1: /* FPIAR */
         case 2: /* FPSR */
@@ -2592,7 +2589,7 @@ DISAS_INSN(mac)
         /* Skip the accumulate if the value is already saturated.  */
         l1 = gen_new_label();
         tmp = tcg_temp_new();
-        gen_op_and32(tmp, QREG_MACSR, gen_im32(MACSR_PAV0 << acc));
+        gen_op_and32(tmp, QREG_MACSR, tcg_const_i32(MACSR_PAV0 << acc));
         gen_op_jmp_nz32(tmp, l1);
     }
 #endif
@@ -2626,7 +2623,7 @@ DISAS_INSN(mac)
             /* Skip the accumulate if the value is already saturated.  */
             l1 = gen_new_label();
             tmp = tcg_temp_new();
-            gen_op_and32(tmp, QREG_MACSR, gen_im32(MACSR_PAV0 << acc));
+            gen_op_and32(tmp, QREG_MACSR, tcg_const_i32(MACSR_PAV0 << acc));
             gen_op_jmp_nz32(tmp, l1);
         }
 #endif
Signature · 1 line
1.7.4.4
#5 lore raw

PATCH 5/6 target-i386: Make x86 mfence and lfence illegal without SSE2

In reply to Stefan Hajnoczi

From: Martin Simmons <[email protected]>

While trying to use qemu -cpu pentium3 to test for incorrect uses of certain SSE2 instructions, I found that QEMU allowed the mfence and lfence instructions to be executed even though Pentium 3 doesn't support them.

According to the processor specs (and experience on a real Pentium 3), these instructions are only available with SSE2, but QEMU is checking for SSE. The check for the related sfence instruction is correct (it works with SSE).

This trival patch fixes the test.

---
 target-i386/translate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-i386/translate.c +1 -1
index 199302e..10bd72a 100644
@@ -7538,7 +7538,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
             break;
         case 5: /* lfence */
         case 6: /* mfence */
-            if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE))
+            if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE2))
                 goto illegal_op;
             break;
         case 7: /* sfence / clflush */
Signature · 1 line
1.7.4.4
#6 lore raw

PATCH 6/6 virtio: Move virtio-pci to hw library

In reply to Stefan Hajnoczi

From: Jan Kiszka <[email protected]>

This module has no target dependencies (except for target_phys_addr_t size) and can thus be built as part of libhw.

---
 Makefile.objs   |    1 +
 Makefile.target |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)
Makefile.objs +1 -0
index 66ffad4..50fbb20 100644
@@ -170,6 +170,7 @@ user-obj-y += cutils.o cache-utils.o
 hw-obj-y =
 hw-obj-y += vl.o loader.o
 hw-obj-$(CONFIG_VIRTIO) += virtio.o virtio-console.o
+hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
 hw-obj-y += fw_cfg.o
 hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
 hw-obj-$(CONFIG_PCI) += msix.o msi.o
Makefile.target +0 -1
index 5c22df8..85480d8 100644
@@ -190,7 +190,6 @@ obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o
 # need to fix this properly
 obj-$(CONFIG_NO_PCI) += pci-stub.o
 obj-$(CONFIG_VIRTIO) += virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
 obj-y += vhost_net.o
 obj-$(CONFIG_VHOST_NET) += vhost.o
 obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p.o
Signature · 1 line
1.7.4.4
#7 lore raw
In reply to Stefan Hajnoczi
Quoted 6 lines · Stefan Hajnoczi

The following changes since commit a90d4690074526f54ad0851fce19fa6783f06803:

Add an isa device for SGA (2011-06-07 13:52:30 -0500)

are available in the git repository at:
git://repo.or.cz/qemu/stefanha.git trivial-patches

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 43 lines

Alexander Graf (1):
slirp: fix guestfwd id

Alexandre Raymond (2):
Fix compilation warning due to missing header for sigaction Fix compilation warning due to missing header for sigaction (followup)

Jan Kiszka (1):
virtio: Move virtio-pci to hw library

Laurent Vivier (1):

       m68k: Replace gen_im32() by tcg_const_i32()

Martin Simmons (1):
target-i386: Make x86 mfence and lfence illegal without SSE2

  Makefile.objs           |    1 +
  Makefile.target         |    1 -
  audio/audio_pt_int.c    |    2 --
  audio/sdlaudio.c        |    1 -
  block/raw-posix.c       |    2 --
  bsd-user/syscall.c      |    1 -
  darwin-user/signal.c    |    3 ---
  exec.c                  |    1 -
  linux-user/signal.c     |    1 -
  net/slirp.c             |    2 +-
  net/tap.c               |    1 -
  posix-aio-compat.c      |    1 -
  qemu-char.c             |    1 -
  qemu-common.h           |    1 +
  qemu-progress.c         |    1 -
  savevm.c                |    1 -
  target-i386/helper.c    |    1 -
  target-i386/translate.c |    2 +-
  target-m68k/translate.c |   43 ++++++++++++++++++++-----------------------
  target-ppc/helper.c     |    1 -
  target-sparc/helper.c   |    1 -
  ui/curses.c             |    1 -
  ui/sdl.c                |    4 ----
  usb-bsd.c               |    1 -
  usb-linux.c             |    1 -
  25 files changed, 24 insertions(+), 52 deletions(-)