Date: Sun, 6 Jul 2014 16:11:28 +0000 (UTC) From: Juergen Lock <nox@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r360935 - in head/emulators/qemu-devel: . files Message-ID: <201407061611.s66GBSFq078422@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nox Date: Sun Jul 6 16:11:28 2014 New Revision: 360935 URL: http://svnweb.freebsd.org/changeset/ports/360935 QAT: https://qat.redports.org/buildarchive/r360935/ Log: Four more bsd-user fixes, poudriere now builds more armv6 packages and sparc64 dynamic exectuables get a little further: - Fix crashes with long argv invocations. [1] - Fix ARMv6 stack alignment in a new thread. [1] - sparc64: sync ccr before changing carry flag. - Writing to readonly page can cause trap 0xc on FreeBSD too. - Bump PORTREVISION. Submitted by: sson [1] Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h (contents, props changed) head/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h (contents, props changed) head/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h (contents, props changed) head/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig (contents, props changed) Modified: head/emulators/qemu-devel/Makefile Modified: head/emulators/qemu-devel/Makefile ============================================================================== --- head/emulators/qemu-devel/Makefile Sun Jul 6 16:10:50 2014 (r360934) +++ head/emulators/qemu-devel/Makefile Sun Jul 6 16:11:28 2014 (r360935) @@ -3,7 +3,7 @@ PORTNAME= qemu PORTVERSION= 2.0.0 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= emulators MASTER_SITES= http://wiki.qemu.org/download/:release \ LOCAL/nox:snapshot @@ -72,6 +72,10 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch- EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-arm-signal EXTRA_PATCHES+= ${FILESDIR}/extra-patch-getvfsbyname EXTRA_PATCHES+= ${FILESDIR}/extra-patch-kernproc +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-target_os_stack.h +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-arm-target_arch_thread.h +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-sparc64-target_arch_cpu.h +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-trapsig .endif CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h Sun Jul 6 16:11:28 2014 (r360935) @@ -0,0 +1,15 @@ +diff --git a/bsd-user/arm/target_arch_thread.h b/bsd-user/arm/target_arch_thread.h +index e69f612..ee4d67d 100644 +--- a/bsd-user/arm/target_arch_thread.h ++++ b/bsd-user/arm/target_arch_thread.h +@@ -29,8 +29,8 @@ static inline void target_thread_set_upcall(CPUARMState *regs, abi_ulong entry, + * Make sure the stack is properly aligned. + * arm/include/param.h (STACKLIGN() macro) + */ +- sp = ((u_int)(stack_base + stack_size) & ~(8-1)) - +- sizeof(struct target_trapframe); ++ sp = (u_int)((stack_base + stack_size) - ++ sizeof(struct target_trapframe)) & ~0x7; + + /* sp = stack base */ + regs->regs[13] = sp; Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h Sun Jul 6 16:11:28 2014 (r360935) @@ -0,0 +1,50 @@ +diff --git a/bsd-user/freebsd/target_os_stack.h b/bsd-user/freebsd/target_os_stack.h +index c84b69e..73aea8f 100644 +--- a/bsd-user/freebsd/target_os_stack.h ++++ b/bsd-user/freebsd/target_os_stack.h +@@ -1,3 +1,22 @@ ++/* ++ * FreeBSD setup_initial_stack() implementation. ++ * ++ * Copyright (c) 2013-14 Stacey D. Son ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see <http://www.gnu.org/licenses/>. ++ */ ++ + #ifndef _TARGET_OS_STACK_H_ + #define _TARGET_OS_STACK_H_ + +@@ -64,9 +83,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, + return -1; + } + /* Add page sizes array. */ +- /* p -= sizeof(int); */ + p -= sizeof(abi_ulong); +- /* if (put_user_u32(TARGET_PAGE_SIZE, p)) { */ + if (put_user_ual(TARGET_PAGE_SIZE, p)) { + errno = EFAULT; + return -1; +@@ -85,9 +102,9 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, + } + + /* Make room for the argv and envp strings */ +- /* p = destp = roundup(p - TARGET_SPACE_USRSPACE - (TARGET_ARG_MAX - stringspace), sizeof(abi_ulong)); */ +- argvp = p - TARGET_SPACE_USRSPACE; +- p = destp = roundup(p - TARGET_SPACE_USRSPACE - TARGET_ARG_MAX, sizeof(abi_ulong)); ++ argvp = roundup(p - TARGET_SPACE_USRSPACE - (TARGET_ARG_MAX - stringspace), ++ sizeof(abi_ulong)); ++ p = destp = p - TARGET_SPACE_USRSPACE - TARGET_ARG_MAX; + + /* + * Add argv strings. Note that the argv[] vectors are added by Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h Sun Jul 6 16:11:28 2014 (r360935) @@ -0,0 +1,20 @@ +From nox Mon Sep 17 00:00:00 2001 +From: Juergen Lock <nox@jelal.kn-bremen.de> +Date: 06 Jul 2014 13:23:00 +0200 +Subject: sparc64-bsd-user: sync ccr before changing carry flag + +Sync ccr so that changing carry flag manually after syscall works +properly. + +Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> + +--- a/bsd-user/sparc64/target_arch_cpu.h ++++ b/bsd-user/sparc64/target_arch_cpu.h +@@ -77,6 +77,7 @@ static inline void target_cpu_loop(CPUSP + env->regwptr[2], env->regwptr[3], + env->regwptr[4], env->regwptr[5]); + } ++ cpu_put_ccr(env, cpu_get_ccr(env)); + if ((unsigned int)ret >= (unsigned int)(-515)) { + ret = -ret; + #if !defined(TARGET_ABI32) Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig Sun Jul 6 16:11:28 2014 (r360935) @@ -0,0 +1,22 @@ +From nox Mon Sep 17 00:00:00 2001 +From: Juergen Lock <nox@jelal.kn-bremen.de> +Date: 06 Jul 2014 16:37:00 +0200 +Subject: bsd-user: writing to readonly page can cause trap 0xc on FreeBSD too + +Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> + +--- a/user-exec.c ++++ b/user-exec.c +@@ -230,7 +230,12 @@ int cpu_signal_handler(int host_signum, + + pc = PC_sig(uc); + return handle_cpu_signal(pc, (unsigned long)info->si_addr, ++#if defined(__FreeBSD__) || defined(__DragonFly__) ++ (TRAP_sig(uc) == 0xe || ++ TRAP_sig(uc) == 0xc) ? ++#else + TRAP_sig(uc) == 0xe ? ++#endif + (ERROR_sig(uc) >> 1) & 1 : 0, + &MASK_sig(uc), puc); + }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407061611.s66GBSFq078422>