summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2013-05-05 20:27:15 +0000
committerJuergen Lock <nox@FreeBSD.org>2013-05-05 20:27:15 +0000
commit56931a5c0c35432ba64120ff13885f60b9508c40 (patch)
tree4ca5e5438834e4431f966a66492298e94d473152 /emulators
parent. Update to 7u21. (diff)
- Update to 1.4.1, announce posting is here:
https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg02956.html - Update to sson's latest bsd-user patches. - Add bugfix for mips64 target uncovered by --enable-debug. [1] Obtained from: qemu-devel mailinglist [1]
Notes
Notes: svn path=/head/; revision=317432
Diffstat (limited to 'emulators')
-rw-r--r--emulators/qemu-devel/Makefile3
-rw-r--r--emulators/qemu-devel/distinfo4
-rw-r--r--emulators/qemu-devel/files/patch-0001-target-mips-Fix-accumulator-arguments-to-gen_helper77
-rw-r--r--emulators/qemu-devel/files/patch-zb3-bsd-user-sson004c186
4 files changed, 266 insertions, 4 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile
index bb40de285037..d681d3799e7a 100644
--- a/emulators/qemu-devel/Makefile
+++ b/emulators/qemu-devel/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= qemu
-PORTVERSION= 1.4.0
-PORTREVISION= 1
+PORTVERSION= 1.4.1
CATEGORIES= emulators
MASTER_SITES= http://wiki.qemu.org/download/:release \
LOCAL/nox:snapshot
diff --git a/emulators/qemu-devel/distinfo b/emulators/qemu-devel/distinfo
index fd3c024c2812..177c7bae33c4 100644
--- a/emulators/qemu-devel/distinfo
+++ b/emulators/qemu-devel/distinfo
@@ -1,2 +1,2 @@
-SHA256 (qemu/1.4.0/qemu-1.4.0.tar.bz2) = 066297ed77408fb7588889c271a85cf3c259ad55c939315988e6062d7708eda8
-SIZE (qemu/1.4.0/qemu-1.4.0.tar.bz2) = 10419510
+SHA256 (qemu/1.4.1/qemu-1.4.1.tar.bz2) = 75063a9326221607de3599e89fb5af80f2d8080ddc55ca253fff113843432df1
+SIZE (qemu/1.4.1/qemu-1.4.1.tar.bz2) = 10417738
diff --git a/emulators/qemu-devel/files/patch-0001-target-mips-Fix-accumulator-arguments-to-gen_helper b/emulators/qemu-devel/files/patch-0001-target-mips-Fix-accumulator-arguments-to-gen_helper
new file mode 100644
index 000000000000..0858bd671d59
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-0001-target-mips-Fix-accumulator-arguments-to-gen_helper
@@ -0,0 +1,77 @@
+>From 61b79e34bc57df0aa0c8086bd86f4c8818618d0e Mon Sep 17 00:00:00 2001
+From: Richard Sandiford <rdsandiford@googlemail.com>
+Date: Sat, 4 May 2013 15:01:31 +0100
+Subject: [PATCH] target-mips: Fix accumulator arguments to gen_helper_dmult(u)
+
+gen_muldiv was passing int accumulator arguments directly
+to gen_helper_dmult(u). This patch fixes it to use TCGs,
+via the gen_helper_0e2i wrapper.
+
+Fixes an --enable-debug-tcg build failure reported by Juergen Lock.
+
+Signed-off-by: Richard Sandiford <rdsandiford@googlemail.com>
+---
+ target-mips/helper.h | 4 ++--
+ target-mips/op_helper.c | 8 ++++----
+ target-mips/translate.c | 4 ++--
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/target-mips/helper.h b/target-mips/helper.h
+index cfe98f1..7aa5f79 100644
+--- a/target-mips/helper.h
++++ b/target-mips/helper.h
+@@ -24,8 +24,8 @@ DEF_HELPER_FLAGS_1(clz, TCG_CALL_NO_RWG_SE, tl, tl)
+ #ifdef TARGET_MIPS64
+ DEF_HELPER_FLAGS_1(dclo, TCG_CALL_NO_RWG_SE, tl, tl)
+ DEF_HELPER_FLAGS_1(dclz, TCG_CALL_NO_RWG_SE, tl, tl)
+-DEF_HELPER_4(dmult, void, env, int, tl, tl)
+-DEF_HELPER_4(dmultu, void, env, int, tl, tl)
++DEF_HELPER_4(dmult, void, env, tl, tl, int)
++DEF_HELPER_4(dmultu, void, env, tl, tl, int)
+ #endif
+
+ DEF_HELPER_3(muls, tl, env, tl, tl)
+diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
+index c054300..01df687 100644
+--- a/target-mips/op_helper.c
++++ b/target-mips/op_helper.c
+@@ -268,14 +268,14 @@ target_ulong helper_mulshiu(CPUMIPSState *env, target_ulong arg1,
+ }
+
+ #ifdef TARGET_MIPS64
+-void helper_dmult(CPUMIPSState *env, int acc, target_ulong arg1,
+- target_ulong arg2)
++void helper_dmult(CPUMIPSState *env, target_ulong arg1,
++ target_ulong arg2, int acc)
+ {
+ muls64(&(env->active_tc.LO[acc]), &(env->active_tc.HI[acc]), arg1, arg2);
+ }
+
+-void helper_dmultu(CPUMIPSState *env, int acc, target_ulong arg1,
+- target_ulong arg2)
++void helper_dmultu(CPUMIPSState *env, target_ulong arg1,
++ target_ulong arg2, int acc)
+ {
+ mulu64(&(env->active_tc.LO[acc]), &(env->active_tc.HI[acc]), arg1, arg2);
+ }
+diff --git a/target-mips/translate.c b/target-mips/translate.c
+index 9ed6477..8205456 100644
+--- a/target-mips/translate.c
++++ b/target-mips/translate.c
+@@ -2777,11 +2777,11 @@ static void gen_muldiv(DisasContext *ctx, uint32_t opc,
+ opn = "ddivu";
+ break;
+ case OPC_DMULT:
+- gen_helper_dmult(cpu_env, acc, t0, t1);
++ gen_helper_0e2i(dmult, t0, t1, acc);
+ opn = "dmult";
+ break;
+ case OPC_DMULTU:
+- gen_helper_dmultu(cpu_env, acc, t0, t1);
++ gen_helper_0e2i(dmultu, t0, t1, acc);
+ opn = "dmultu";
+ break;
+ #endif
+--
+1.8.1.4
+
diff --git a/emulators/qemu-devel/files/patch-zb3-bsd-user-sson004c b/emulators/qemu-devel/files/patch-zb3-bsd-user-sson004c
new file mode 100644
index 000000000000..2101ab2bdd16
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-zb3-bsd-user-sson004c
@@ -0,0 +1,186 @@
+diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
+index dcf6f66..83ff852 100644
+--- a/bsd-user/bsdload.c
++++ b/bsd-user/bsdload.c
+@@ -154,19 +154,77 @@ abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
+ return sp;
+ }
+
++static int
++is_there(const char *candidate)
++{
++ struct stat fin;
++
++ /* XXX work around access(2) false positives for superuser */
++ if (access(candidate, X_OK) == 0 &&
++ stat(candidate, &fin) == 0 &&
++ S_ISREG(fin.st_mode) &&
++ (getuid() != 0 ||
++ (fin.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)) {
++ return (1);
++ }
++ return (0);
++}
++
++static int
++find_in_path(char *path, const char *filename, char *retpath, size_t rpsize)
++{
++ const char *d;
++ int found;
++
++ if (strchr(filename, '/') != NULL)
++ return (is_there(filename) ? 0 : -1);
++ found = 0;
++ while ((d = strsep(&path, ":")) != NULL) {
++ if (*d == '\0')
++ d = ".";
++ if (snprintf(retpath, rpsize, "%s/%s", d,
++ filename) >= (int)rpsize)
++ continue;
++ if (is_there((const char *)retpath)) {
++ found = 1;
++ break;
++ }
++ }
++ return (found);
++}
++
+ int loader_exec(const char * filename, char ** argv, char ** envp,
+ struct target_pt_regs * regs, struct image_info *infop,
+ struct bsd_binprm *bprm)
+ {
+ int retval;
+ int i;
++ char *p, *path, fullpath[PATH_MAX];
++ ssize_t pathlen;
+
+ bprm->p = TARGET_PAGE_SIZE*MAX_ARG_PAGES /*-sizeof(unsigned int) XXX */;
+ for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
+ bprm->page[i] = NULL;
+- retval = open(filename, O_RDONLY);
++
++ /* Find target executable in path, if not already fullpath. */
++ if ((p = getenv("PATH")) != NULL) {
++ pathlen = strlen(p) + 1;
++ path = malloc(pathlen);
++ if (NULL == path) {
++ fprintf(stderr, "Out of memory\n");
++ return (-1);
++ }
++ memcpy(path, p, pathlen);
++ if (find_in_path(path, filename, fullpath, sizeof(fullpath)))
++ retval = open(fullpath, O_RDONLY);
++ else
++ retval = open(filename, O_RDONLY);
++
++ } else
++ retval = open(filename, O_RDONLY);
+ if (retval < 0)
+ return retval;
++
+ bprm->fd = retval;
+ bprm->filename = (char *)filename;
+ bprm->argc = count(argv);
+diff --git a/bsd-user/main.c b/bsd-user/main.c
+index 99b94c1..9b526b3 100644
+--- a/bsd-user/main.c
++++ b/bsd-user/main.c
+@@ -1022,7 +1022,7 @@ void cpu_loop(CPUMIPSState *env)
+ switch(trapnr) {
+ case EXCP_SYSCALL: /* syscall exception */
+ syscall_num = env->active_tc.gpr[2]; /* v0 */
+- env->active_tc.PC += 4;
++ env->active_tc.PC += TARGET_INSN_SIZE;
+ if (syscall_num >= SYS_MAXSYSCALL) {
+ ret = -TARGET_ENOSYS;
+ } else {
+@@ -1094,7 +1094,11 @@ void cpu_loop(CPUMIPSState *env)
+ */
+ break;
+ }
+- /* XXX need to handle ERESTART */
++ if (-TARGET_ERESTART == ret) {
++ /* Backup the pc to point at the swi. */
++ env->active_tc.PC -= TARGET_INSN_SIZE;
++ break;
++ }
+ if ((unsigned int)ret >= (unsigned int)(-1133)) {
+ env->active_tc.gpr[7] = 1;
+ ret = -ret;
+diff --git a/bsd-user/mips/target_vmparam.h b/bsd-user/mips/target_vmparam.h
+index 6eca54f..abdb1dc 100644
+--- a/bsd-user/mips/target_vmparam.h
++++ b/bsd-user/mips/target_vmparam.h
+@@ -33,6 +33,8 @@ struct target_ps_strings {
+
+ #define TARGET_SZSIGCODE 0
+
++#define TARGET_INSN_SIZE 4
++
+ #else
+
+ #define TARGET_USRSTACK 0
+diff --git a/bsd-user/mips64/target_vmparam.h b/bsd-user/mips64/target_vmparam.h
+index 3fe93fb..3a3bb6e 100644
+--- a/bsd-user/mips64/target_vmparam.h
++++ b/bsd-user/mips64/target_vmparam.h
+@@ -31,6 +31,8 @@ struct target_ps_strings {
+
+ #define TARGET_PS_STRINGS (TARGET_USRSTACK - sizeof(struct target_ps_strings))
+
++#define TARGET_INSN_SIZE 4
++
+ #else
+
+ #define TARGET_USRSTACK 0
+diff --git a/bsd-user/signal.c b/bsd-user/signal.c
+index c4e8440..a26d40a 100644
+--- a/bsd-user/signal.c
++++ b/bsd-user/signal.c
+@@ -122,8 +122,9 @@ int
+ host_to_target_signal(int sig)
+ {
+
+- if (sig >= _NSIG)
++ if (sig < 0 || sig >= _NSIG)
+ return (sig);
++
+ return (host_to_target_signal_table[sig]);
+ }
+
+@@ -598,11 +599,13 @@ do_sigaction(int sig, const struct target_sigaction *act,
+ if (k->_sa_handler == TARGET_SIG_IGN) {
+ act1.sa_sigaction = (void *)SIG_IGN;
+ } else if (k->_sa_handler == TARGET_SIG_DFL) {
+- if (fatal_signal(sig))
++ if (fatal_signal(sig)) {
++ act1.sa_flags = SA_SIGINFO;
+ act1.sa_sigaction =
+ host_signal_handler;
+- else
++ } else {
+ act1.sa_sigaction = (void *)SIG_DFL;
++ }
+ } else {
+ act1.sa_flags = SA_SIGINFO;
+ act1.sa_sigaction = host_signal_handler;
+diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
+index 0f337e2..490227c 100644
+--- a/bsd-user/syscall.c
++++ b/bsd-user/syscall.c
+@@ -3120,6 +3120,15 @@ do_lock_umutex(abi_ulong target_addr, uint32_t id, struct timespec *ts,
+ 0, ts));
+ }
+
++ if (NULL == ts) {
++ /*
++ * In the case of no timeout do a restart on this syscall,
++ * if interrupted.
++ */
++ if (-TARGET_EINTR == ret)
++ ret = -TARGET_ERESTART;
++ }
++
+ return (0);
+ }
+