From owner-freebsd-emulation@FreeBSD.ORG Sun Oct 11 23:06:54 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE4F1065676 for ; Sun, 11 Oct 2009 23:06:54 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id A61718FC08 for ; Sun, 11 Oct 2009 23:06:53 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id E7A571E006E1; Mon, 12 Oct 2009 01:06:51 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9BMIf75056212; Mon, 12 Oct 2009 00:18:41 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9BMIfZB056211; Mon, 12 Oct 2009 00:18:41 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Mon, 12 Oct 2009 00:18:40 +0200 To: freebsd-emulation@FreeBSD.org Message-ID: <20091011221840.GA55502@triton8.kn-bremen.de> References: <20091007220549.GA65997@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091007220549.GA65997@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: qemu-devel@nongnu.org, Aleksej Saushev , Toni Subject: Re: playing with qemu usermode emulation on FreeBSD... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2009 23:06:54 -0000 On Thu, Oct 08, 2009 at 12:05:49AM +0200, Juergen Lock wrote: > I recently noticed there are x86 bsd-user targets now (yeah I totally > missed those commits...) and now got it working a tiny little bit: > I can run > qemu-x86_64 -bsd freebsd /rescue/echo foo bar > here on FreeBSD 8/amd64 and it echoes foo bar as expected, but > segfaults afterwards. :) (in pthread_setcancelstate() invoked from > a guest write() syscall, in case anyone is wondering.) Other things > I tried either exit with errors or segfault as well, and i386 hosts > probably still don't work at all yet. (qemu-i386 here on amd64 does > at least something, but probably needs lock_user() treatment for all > kinds of syscalls, I only tried adding that for sysctl so far.) > > Anyway, here is an emulators/qemu-devel git head snapshot port > update with my current patches (files/patch-bsd-user), feel free to > test/debug/improve: > http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch > (For the folks reading this on the qemu list: I shall start doing > `proper' patch submissions later, this is more for the FreeBSD folks > and because I was asked to send what I have...) New version at the same place, which now runs FreeBSD/{i386,sparc64} /rescue/echo on FreeBSD/amd64, the FreeBSD/amd64 target now segfaults in pthread_setcancelstate() invoked from the final writev() tho. Oh and I also uploaded the snapshot tarball so others can now actually build the port too... :) And I have switched to the cpu-exec.c patch posted by Aleksej Saushev on the qemu list and added back amd64 code there. Here is the bsd-user patch again: Index: qemu/bsd-user/elfload.c @@ -126,6 +126,8 @@ static inline void init_thread(struct ta regs->rax = 0; regs->rsp = infop->start_stack; regs->rip = infop->entry; + if (1 /* bsd_type == target_freebsd */) + regs->rdi = infop->start_stack; } #else @@ -249,8 +251,13 @@ static inline void init_thread(struct ta #else if (personality(infop->personality) == PER_LINUX32) regs->u_regs[14] = infop->start_stack - 16 * 4; - else + else { regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS; + if (1 /* bsd_type == target_freebsd */) { + regs->u_regs[8] = infop->start_stack; + regs->u_regs[11] = infop->start_stack; + } + } #endif } Index: qemu/bsd-user/freebsd/strace.list @@ -39,6 +39,7 @@ { TARGET_FREEBSD_NR_ftruncate, "ftruncate", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_futimes, "futimes", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_getdirentries, "getdirentries", NULL, NULL, NULL }, +{ TARGET_FREEBSD_NR_freebsd6_mmap, "freebsd6_mmap", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_getegid, "getegid", "%s()", NULL, NULL }, { TARGET_FREEBSD_NR_geteuid, "geteuid", "%s()", NULL, NULL }, { TARGET_FREEBSD_NR_getfh, "getfh", NULL, NULL, NULL }, Index: qemu/bsd-user/main.c @@ -179,27 +179,86 @@ void cpu_loop(CPUX86State *env, enum BSD switch(trapnr) { case 0x80: /* syscall from int $0x80 */ - env->regs[R_EAX] = do_openbsd_syscall(env, - env->regs[R_EAX], - env->regs[R_EBX], - env->regs[R_ECX], - env->regs[R_EDX], - env->regs[R_ESI], - env->regs[R_EDI], - env->regs[R_EBP]); + if (bsd_type == target_freebsd) { + abi_ulong params = (abi_ulong) env->regs[R_ESP] + + sizeof(int32_t); + int32_t syscall_nr = env->regs[R_EAX]; + int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8; + + if (syscall_nr == TARGET_FREEBSD_NR_syscall) { + get_user_s32(syscall_nr, params); + params += sizeof(int32_t); + } else if (syscall_nr == TARGET_FREEBSD_NR___syscall) { + get_user_s32(syscall_nr, params); + params += sizeof(int64_t); + } + get_user_s32(arg1, params); + params += sizeof(int32_t); + get_user_s32(arg2, params); + params += sizeof(int32_t); + get_user_s32(arg3, params); + params += sizeof(int32_t); + get_user_s32(arg4, params); + params += sizeof(int32_t); + get_user_s32(arg5, params); + params += sizeof(int32_t); + get_user_s32(arg6, params); + params += sizeof(int32_t); + get_user_s32(arg7, params); + params += sizeof(int32_t); + get_user_s32(arg8, params); + env->regs[R_EAX] = do_freebsd_syscall(env, + syscall_nr, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8); + } else { //if (bsd_type == target_openbsd) + env->regs[R_EAX] = do_openbsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EBX], + env->regs[R_ECX], + env->regs[R_EDX], + env->regs[R_ESI], + env->regs[R_EDI], + env->regs[R_EBP]); + } + if (((abi_ulong)env->regs[R_EAX]) >= (abi_ulong)(-515)) + env->eflags |= CC_C; + else + env->eflags &= ~CC_C; break; #ifndef TARGET_ABI32 case EXCP_SYSCALL: - /* linux syscall from syscall intruction */ - env->regs[R_EAX] = do_openbsd_syscall(env, - env->regs[R_EAX], - env->regs[R_EDI], - env->regs[R_ESI], - env->regs[R_EDX], - env->regs[10], - env->regs[8], - env->regs[9]); + /* syscall from syscall intruction */ + if (bsd_type == target_freebsd) + env->regs[R_EAX] = do_freebsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EDI], + env->regs[R_ESI], + env->regs[R_EDX], + env->regs[R_ECX], + env->regs[8], + env->regs[9], 0, 0); + else { //if (bsd_type == target_openbsd) + env->regs[R_EAX] = do_openbsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EDI], + env->regs[R_ESI], + env->regs[R_EDX], + env->regs[10], + env->regs[8], + env->regs[9]); + } env->eip = env->exception_next_eip; + if (((abi_ulong)env->regs[R_EAX]) >= (abi_ulong)(-515)) + env->eflags |= CC_C; + else + env->eflags &= ~CC_C; break; #endif #if 0 @@ -459,13 +518,17 @@ void cpu_loop(CPUSPARCState *env, enum B case 0x80: #else case 0x100: + /* FreeBSD uses 0x141 for syscalls too */ + case 0x141: + if (bsd_type != target_freebsd) + goto badtrap; #endif syscall_nr = env->gregs[1]; if (bsd_type == target_freebsd) ret = do_freebsd_syscall(env, syscall_nr, env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwptr[3], - env->regwptr[4], env->regwptr[5]); + env->regwptr[4], env->regwptr[5], 0, 0); else if (bsd_type == target_netbsd) ret = do_netbsd_syscall(env, syscall_nr, env->regwptr[0], env->regwptr[1], @@ -587,6 +650,9 @@ void cpu_loop(CPUSPARCState *env, enum B } break; default: +#ifdef TARGET_SPARC64 + badtrap: +#endif printf ("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(env, stderr, fprintf, 0); exit (1); Index: qemu/bsd-user/qemu.h @@ -130,7 +130,8 @@ abi_long do_brk(abi_ulong new_brk); void syscall_init(void); abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, - abi_long arg5, abi_long arg6); + abi_long arg5, abi_long arg6, abi_long arg7, + abi_long arg8); abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); Index: qemu/bsd-user/syscall.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -40,20 +41,222 @@ static abi_ulong target_brk; static abi_ulong target_original_brk; -#define get_errno(x) (x) +static inline abi_long get_errno(abi_long ret) +{ + if (ret == -1) + /* XXX need to translate host -> target errnos here */ + return -(errno); + else + return ret; +} + #define target_to_host_bitmask(x, tbl) (x) +static inline int is_error(abi_long ret) +{ + return (abi_ulong)ret >= (abi_ulong)(-4096); +} + void target_set_brk(abi_ulong new_brk) { target_original_brk = target_brk = HOST_PAGE_ALIGN(new_brk); } +/* do_obreak() must return target errnos. */ +static abi_long do_obreak(abi_ulong new_brk) +{ + abi_ulong brk_page; + abi_long mapped_addr; + int new_alloc_size; + + if (!new_brk) + return 0; + if (new_brk < target_original_brk) + return -TARGET_EINVAL; + + brk_page = HOST_PAGE_ALIGN(target_brk); + + /* If the new brk is less than this, set it and we're done... */ + if (new_brk < brk_page) { + target_brk = new_brk; + return 0; + } + + /* We need to allocate more memory after the brk... */ + new_alloc_size = HOST_PAGE_ALIGN(new_brk - brk_page + 1); + mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size, + PROT_READ|PROT_WRITE, + MAP_ANON|MAP_FIXED|MAP_PRIVATE, -1, 0)); + + if (!is_error(mapped_addr)) + target_brk = new_brk; + else + return mapped_addr; + + return 0; +} + +#ifdef __FreeBSD__ +/* + * XXX this uses the undocumented oidfmt interface to find the kind of + * a requested sysctl, see /sys/kern/kern_sysctl.c:sysctl_sysctl_oidfmt() + * (this is mostly copied from src/sbin/sysctl/sysctl.c) + */ +static int +oidfmt(int *oid, int len, char *fmt, uint32_t *kind) +{ + int qoid[CTL_MAXNAME+2]; + uint8_t buf[BUFSIZ]; + int i; + size_t j; + + qoid[0] = 0; + qoid[1] = 4; + memcpy(qoid + 2, oid, len * sizeof(int)); + + j = sizeof(buf); + i = sysctl(qoid, len + 2, buf, &j, 0, 0); + if (i) + return i; + + if (kind) + *kind = *(uint32_t *)buf; + + if (fmt) + strcpy(fmt, (char *)(buf + sizeof(uint32_t))); + return (0); +} + +/* + * try and convert sysctl return data for the target. + * XXX doesn't handle CTLTYPE_OPAQUE and CTLTYPE_STRUCT. + */ +static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) +{ + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + *(uint32_t *)holdp = tswap32(*(uint32_t *)holdp); + break; +#ifdef TARGET_ABI32 + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + *(uint32_t *)holdp = tswap32(*(long *)holdp); + break; +#else + case CTLTYPE_LONG: + *(uint64_t *)holdp = tswap64(*(long *)holdp); + case CTLTYPE_ULONG: + *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp); + break; +#endif + case CTLTYPE_QUAD: + *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp); + break; + case CTLTYPE_STRING: + break; + default: + /* XXX unhandled */ + return -1; + } + return 0; +} + +/* XXX this needs to be emulated on non-FreeBSD hosts... */ +static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong oldp, + abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen) +{ + abi_long ret; + void *hnamep, *holdp, *hnewp = NULL; + size_t holdlen; + abi_ulong oldlen = 0; + int32_t *snamep = qemu_malloc(sizeof(int32_t) * namelen), *p, *q, i; + uint32_t kind = 0; + + if (oldlenp) + get_user_ual(oldlen, oldlenp); + if (!(hnamep = lock_user(VERIFY_READ, namep, namelen, 1))) + return -TARGET_EFAULT; + if (newp && !(hnewp = lock_user(VERIFY_READ, newp, newlen, 1))) + return -TARGET_EFAULT; + if (!(holdp = lock_user(VERIFY_WRITE, oldp, oldlen, 0))) + return -TARGET_EFAULT; + holdlen = oldlen; + for (p = hnamep, q = snamep, i = 0; i < namelen; p++, i++) + *q++ = tswap32(*p); + oidfmt(snamep, namelen, NULL, &kind); + /* XXX swap hnewp */ + ret = get_errno(sysctl(snamep, namelen, holdp, &holdlen, hnewp, newlen)); + if (!ret) + sysctl_oldcvt(holdp, holdlen, kind); + put_user_ual(holdlen, oldlenp); + unlock_user(hnamep, namep, 0); + unlock_user(holdp, oldp, holdlen); + if (hnewp) + unlock_user(hnewp, newp, 0); + qemu_free(snamep); + return ret; +} +#endif + +/* FIXME + * lock_iovec()/unlock_iovec() have a return code of 0 for success where + * other lock functions have a return code of 0 for failure. + */ +static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr, + int count, int copy) +{ + struct target_iovec *target_vec; + abi_ulong base; + int i; + + target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); + if (!target_vec) + return -TARGET_EFAULT; + for(i = 0;i < count; i++) { + base = tswapl(target_vec[i].iov_base); + vec[i].iov_len = tswapl(target_vec[i].iov_len); + if (vec[i].iov_len != 0) { + vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy); + /* Don't check lock_user return value. We must call writev even + if a element has invalid base address. */ + } else { + /* zero length pointer is ignored */ + vec[i].iov_base = NULL; + } + } + unlock_user (target_vec, target_addr, 0); + return 0; +} + +static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr, + int count, int copy) +{ + struct target_iovec *target_vec; + abi_ulong base; + int i; + + target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); + if (!target_vec) + return -TARGET_EFAULT; + for(i = 0;i < count; i++) { + if (target_vec[i].iov_base) { + base = tswapl(target_vec[i].iov_base); + unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0); + } + } + unlock_user (target_vec, target_addr, 0); + + return 0; +} + /* do_syscall() should always have a single exit point at the end so that actions, such as logging of syscall results, can be performed. All errnos that do_syscall() returns must be -TARGET_. */ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, - abi_long arg5, abi_long arg6) + abi_long arg5, abi_long arg6, abi_long arg7, + abi_long arg8) { abi_long ret; void *p; @@ -86,6 +289,18 @@ abi_long do_freebsd_syscall(void *cpu_en ret = get_errno(write(arg1, p, arg3)); unlock_user(p, arg2, 0); break; + case TARGET_FREEBSD_NR_writev: + { + int count = arg3; + struct iovec *vec; + + vec = alloca(count * sizeof(struct iovec)); + if (lock_iovec(VERIFY_READ, vec, arg2, count, 1) < 0) + goto efault; + ret = get_errno(writev(arg1, vec, count)); + unlock_iovec(vec, arg2, count, 0); + } + break; case TARGET_FREEBSD_NR_open: if (!(p = lock_user_string(arg1))) goto efault; @@ -103,12 +318,20 @@ abi_long do_freebsd_syscall(void *cpu_en case TARGET_FREEBSD_NR_mprotect: ret = get_errno(target_mprotect(arg1, arg2, arg3)); break; + case TARGET_FREEBSD_NR_break: + ret = do_obreak(arg1); + break; +#ifdef __FreeBSD__ + case TARGET_FREEBSD_NR___sysctl: + ret = do_freebsd_sysctl(arg1, arg2, arg3, arg4, arg5, arg6); + break; +#endif case TARGET_FREEBSD_NR_syscall: case TARGET_FREEBSD_NR___syscall: - ret = do_freebsd_syscall(cpu_env,arg1 & 0xffff,arg2,arg3,arg4,arg5,arg6,0); + ret = do_freebsd_syscall(cpu_env,arg1 & 0xffff,arg2,arg3,arg4,arg5,arg6,arg7,arg8,0); break; default: - ret = syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); + ret = get_errno(syscall(num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)); break; } fail: Index: qemu/bsd-user/syscall_defs.h @@ -106,3 +106,9 @@ #include "freebsd/syscall_nr.h" #include "netbsd/syscall_nr.h" #include "openbsd/syscall_nr.h" + +struct target_iovec { + abi_long iov_base; /* Starting address */ + abi_long iov_len; /* Number of bytes */ +}; + Index: qemu/cpu-exec.c @@ -805,6 +805,20 @@ static inline int handle_cpu_signal(unsi # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno) # define ERROR_sig(context) ((context)->uc_mcontext->es.err) # define MASK_sig(context) ((context)->uc_sigmask) +#elif defined (__NetBSD__) +# include + +# define EIP_sig(context) ((context)->uc_mcontext.__gregs[_REG_EIP]) +# define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) +# define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) +# define MASK_sig(context) ((context)->uc_sigmask) +#elif defined (__FreeBSD__) || defined(__DragonFly__) +# include + +# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_eip)) +# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) +# define ERROR_sig(context) ((context)->uc_mcontext.mc_err) +# define MASK_sig(context) ((context)->uc_sigmask) #elif defined(__OpenBSD__) # define EIP_sig(context) ((context)->sc_eip) # define TRAP_sig(context) ((context)->sc_trapno) @@ -821,7 +835,9 @@ int cpu_signal_handler(int host_signum, void *puc) { siginfo_t *info = pinfo; -#if defined(__OpenBSD__) +#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) + ucontext_t *uc = puc; +#elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else struct ucontext *uc = puc; @@ -855,6 +871,13 @@ int cpu_signal_handler(int host_signum, #define TRAP_sig(context) ((context)->sc_trapno) #define ERROR_sig(context) ((context)->sc_err) #define MASK_sig(context) ((context)->sc_mask) +#elif defined (__FreeBSD__) || defined(__DragonFly__) +#include + +#define PC_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_rip)) +#define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) +#define ERROR_sig(context) ((context)->uc_mcontext.mc_err) +#define MASK_sig(context) ((context)->uc_sigmask) #else #define PC_sig(context) ((context)->uc_mcontext.gregs[REG_RIP]) #define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) @@ -867,7 +890,7 @@ int cpu_signal_handler(int host_signum, { siginfo_t *info = pinfo; unsigned long pc; -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) ucontext_t *uc = puc; #elif defined(__OpenBSD__) struct sigcontext *uc = puc; From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 09:38:56 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 702CB106568B for ; Mon, 12 Oct 2009 09:38:56 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id E6F918FC19 for ; Mon, 12 Oct 2009 09:38:55 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.3/8.14.3) with ESMTP id n9C9ckwc085854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 12 Oct 2009 11:38:47 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.3/8.14.3/Submit) with ESMTP id n9C9ckcA085851 for ; Mon, 12 Oct 2009 11:38:46 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Mon, 12 Oct 2009 11:38:42 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: freebsd-emulation@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: =?ISO-8859-1?Q?Fagskolen_i_Gj=F8vik?= OpenPGP: url=http://fagskolen.gjovik.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-1133436710-1255340326=:84355" X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.fig.ol.no Subject: Any chance of an upgraded x11-toolkits/linux-pango? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 09:38:56 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-1133436710-1255340326=:84355 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Until we're all ready to move to 8.0, those of us who wants to run Adobe Reader 9.1.3 on 7.2 have no other option but to use x11-toolkits/linux-pango along with emulators/linux_base-fc4. I know the native x11-toolkits/pango was updated to correct for the integer overflow bug, but what about x11-toolkits/linux-pango? Please fix x11-toolkits/linux-pango. Best regards, Trond Endrestøl. - -- - ---------------------------------------------------------------------- Trond Endrestøl | Trond.Endrestol@fagskolen.gjovik.no ACM, NAS, NUUG, SAGE, USENIX | FreeBSD 7.2-STABLE & Alpine 2.00 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrS+SYACgkQbYWZalUoElsIcgCcDz0u+7aX0pUYPcmFxBtnIPKk sgcAnRj4JsUzui70FqlqWytdago0vY+y =H/vn -----END PGP SIGNATURE----- --2055831798-1133436710-1255340326=:84355-- From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 11:06:51 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00AF21065733 for ; Mon, 12 Oct 2009 11:06:51 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C88D78FC22 for ; Mon, 12 Oct 2009 11:06:50 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9CB6ohj036354 for ; Mon, 12 Oct 2009 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9CB6oSr036350 for freebsd-emulation@FreeBSD.org; Mon, 12 Oct 2009 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 12 Oct 2009 11:06:50 GMT Message-Id: <200910121106.n9CB6oSr036350@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-emulation@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-emulation@FreeBSD.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 11:06:51 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/138944 emulation [parallels] [regression] Parallels no longer works in o kern/138880 emulation [linux] munmap segfaults after linux_mmap2 stresstest o ports/137332 emulation add caution messages to some adobe products f ports/136321 emulation x11-toolkits/linux-pango: please update linux based po o ports/136229 emulation [linux] certain linux apps look for libraries using a o ports/135337 emulation [PATCH] emulators/linux_base-f10: incorrect bash usage o ports/135322 emulation Port graphics/linux_dri has incorrect packaging list c o kern/130724 emulation [linprocfs] [patch] cpuinfo in linprocfs is dated, cau o kern/129169 emulation [linux] [patch] Linux Emulation ENOTCONN error using n f ports/127018 emulation Linuxulator incapable of using FreeBSD's LDAP environm o kern/126232 emulation [linux] Linux ioctl TCGETS (0x5401) always fails o kern/97326 emulation [linux] file descriptor leakage in linux emulation o kern/73777 emulation [linux] [patch] linux emulation: root dir special hand a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s o kern/56451 emulation [linprocfs] /compat/linux/proc/cpuinfo gives wrong CPU o kern/41543 emulation [patch] [request] easier wine/w23 support o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/29698 emulation [linux] [patch] linux ipcs doesn'work o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 20 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 14:00:04 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03992106568B for ; Mon, 12 Oct 2009 14:00:03 +0000 (UTC) (envelope-from mlobo@digiart.art.br) Received: from sv4.hmnoc.net (sv4.hmnoc.net [63.247.76.174]) by mx1.freebsd.org (Postfix) with ESMTP id BDC4A8FC0A for ; Mon, 12 Oct 2009 14:00:03 +0000 (UTC) Received: from [187.78.101.207] (port=58898 helo=papi.localnet) by sv4.hmnoc.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MxLRL-0006c2-ER for freebsd-emulation@freebsd.org; Mon, 12 Oct 2009 11:00:01 -0300 To: freebsd-emulation@freebsd.org From: Mario Lobo Date: Mon, 12 Oct 2009 10:59:26 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200910121059.26357.mlobo@digiart.art.br> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sv4.hmnoc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - digiart.art.br Subject: Problem with FreeBSD port X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 14:00:04 -0000 Hi; I've been following the FreeBSD port through svn.bluelife.at. Up to revision 508, everything was fine. On Rev 519 (or before, i'm not sure), the port was split into 3. virtualbox, virtualbox-additions and virtualbox- kmod. There is no problem building virtualbox-kmod. and virtualbox. The modules load without errors and virtualbox starts fine. But when I try to start a VM I get this: 00:00:00.644 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to open the host network interface re0} aWarning=false, preserve=false 00:00:00.654 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to initialize Host Interface Networking (VERR_HOSTIF_INIT_FAILED). 00:00:00.654 Unknown error creating VM (VERR_HOSTIF_INIT_FAILED)} aWarning=false, preserve=false 00:00:00.658 Power up failed (vrc=VERR_HOSTIF_INIT_FAILED, rc=NS_ERROR_FAILURE (0X80004005)) kldstat Id Refs Address Size Name 1 60 0xffffffff80100000 caeef0 kernel 2 2 0xffffffff80daf000 41110 linux.ko 3 1 0xffffffff80df1000 5b58 snd_cmi.ko 4 3 0xffffffff80df7000 755a8 sound.ko 5 1 0xffffffff80e6d000 27d8 amdtemp.ko 6 1 0xffffffff80e70000 3e20 amdsmb.ko 7 2 0xffffffff80e74000 24d8 smbus.ko 8 2 0xffffffff80e77000 227d8 drm.ko 9 2 0xffffffff80e9a000 12c88 agp.ko 10 1 0xffffffff80ead000 712e0 radeon.ko 11 1 0xffffffff80f1f000 5278 atapicam.ko 12 1 0xffffffff80f25000 fff0 cpufreq.ko 13 1 0xffffffff81022000 3983 linprocfs.ko 14 3 0xffffffff81026000 22db6 vboxdrv.ko 15 2 0xffffffff81049000 26ce vboxnetflt.ko 16 2 0xffffffff8104c000 8d2c netgraph.ko 17 1 0xffffffff81055000 13a6 ng_ether.ko 18 1 0xffffffff81057000 d2c vboxnetadp.ko 19 1 0xffffffff81058000 a8ca fuse.ko 20 1 0xffffffff81063000 b5b2 ext2fs.ko It is as if virtualbox can't "see" that the modules ARE loaded, and connect to them. If I revert to the previous version (with the modules compiled together with virtualbox), everything works again. OS: FreeBSD 8.0-RC1 #0: Sat Oct 10 16:16:42 BRT 2009 amd64 Thanks, -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE) From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 15:02:15 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 822F31065670 for ; Mon, 12 Oct 2009 15:02:15 +0000 (UTC) (envelope-from decke@bluelife.at) Received: from mail.itac.at (mail.itac.at [213.47.211.116]) by mx1.freebsd.org (Postfix) with ESMTP id 0A64C8FC08 for ; Mon, 12 Oct 2009 15:02:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=webmail.itac.at) by mail.itac.at with esmtpa (Exim 4.63) (envelope-from ) id 1MxMPb-0006tA-Oh; Mon, 12 Oct 2009 17:02:11 +0200 Received: from 83.64.253.201 (proxying for unknown) (SquirrelMail authenticated user decke@bluelife.at) by webmail.itac.at with HTTP; Mon, 12 Oct 2009 17:02:11 +0200 (CEST) Message-ID: <0e2aa8e0f2a8a179f3c90b7dc7ad7bfb.squirrel@webmail.itac.at> In-Reply-To: <200910121059.26357.mlobo@digiart.art.br> References: <200910121059.26357.mlobo@digiart.art.br> Date: Mon, 12 Oct 2009 17:02:11 +0200 (CEST) From: "Bernhard Froehlich" To: "Mario Lobo" User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: freebsd-emulation@freebsd.org Subject: Re: Problem with FreeBSD port X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 15:02:15 -0000 On Mon, October 12, 2009 3:59 pm, Mario Lobo wrote: > Hi; > > I've been following the FreeBSD port through svn.bluelife.at. > > Up to revision 508, everything was fine. On Rev 519 (or before, i'm not > sure), > the port was split into 3. virtualbox, virtualbox-additions and > virtualbox- > kmod. > > > There is no problem building virtualbox-kmod. and virtualbox. The modules > load > without errors and virtualbox starts fine. But when I try to start a VM I > get > this: > > 00:00:00.644 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) > aIID={0a51994b- > cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to open > the > host network interface re0} aWarning=false, preserve=false > > 00:00:00.654 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) > aIID={0a51994b- > cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to > initialize > Host Interface Networking (VERR_HOSTIF_INIT_FAILED). > > 00:00:00.654 Unknown error creating VM (VERR_HOSTIF_INIT_FAILED)} > aWarning=false, preserve=false > > 00:00:00.658 Power up failed (vrc=VERR_HOSTIF_INIT_FAILED, > rc=NS_ERROR_FAILURE > (0X80004005)) > > kldstat > Id Refs Address Size Name > 1 60 0xffffffff80100000 caeef0 kernel > 2 2 0xffffffff80daf000 41110 linux.ko > 3 1 0xffffffff80df1000 5b58 snd_cmi.ko > 4 3 0xffffffff80df7000 755a8 sound.ko > 5 1 0xffffffff80e6d000 27d8 amdtemp.ko > 6 1 0xffffffff80e70000 3e20 amdsmb.ko > 7 2 0xffffffff80e74000 24d8 smbus.ko > 8 2 0xffffffff80e77000 227d8 drm.ko > 9 2 0xffffffff80e9a000 12c88 agp.ko > 10 1 0xffffffff80ead000 712e0 radeon.ko > 11 1 0xffffffff80f1f000 5278 atapicam.ko > 12 1 0xffffffff80f25000 fff0 cpufreq.ko > 13 1 0xffffffff81022000 3983 linprocfs.ko > 14 3 0xffffffff81026000 22db6 vboxdrv.ko > 15 2 0xffffffff81049000 26ce vboxnetflt.ko > 16 2 0xffffffff8104c000 8d2c netgraph.ko > 17 1 0xffffffff81055000 13a6 ng_ether.ko > 18 1 0xffffffff81057000 d2c vboxnetadp.ko > 19 1 0xffffffff81058000 a8ca fuse.ko > 20 1 0xffffffff81063000 b5b2 ext2fs.ko > > It is as if virtualbox can't "see" that the modules ARE loaded, and > connect to > them. > > If I revert to the previous version (with the modules compiled together > with > virtualbox), everything works again. > > OS: > FreeBSD 8.0-RC1 #0: Sat Oct 10 16:16:42 BRT 2009 amd64 > Good that you have found the correct mailinglist. FreeBSD related vbox problems are best discussed on freebsd-emulation@ and if we need help from upstream we contact vbox-dev@ or a few people on the virtualbox side in private to not annoy them with common or FreeBSD specific problems. The current svn version is very experimental as they have recently changed a lot of build and kernel module related things so i am not very surprised that this code doesn't work at the moment. I have an FreeBSD 8.0-RC1/amd64 box standing around so i will test it myself and see what we get. -- Bernhard Fröhlich http://www.bluelife.at/ From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 15:07:41 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91CB7106568F for ; Mon, 12 Oct 2009 15:07:41 +0000 (UTC) (envelope-from oberman@es.net) Received: from mailgw.es.net (mail3.es.net [IPv6:2001:400:4c01::2]) by mx1.freebsd.org (Postfix) with ESMTP id 641768FC0A for ; Mon, 12 Oct 2009 15:07:41 +0000 (UTC) Received: from ptavv.es.net (ptavv.es.net [IPv6:2001:400:910::29]) by mailgw.es.net (8.14.3/8.14.3) with ESMTP id n9CF7Sph026260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 12 Oct 2009 08:07:29 -0700 Received: from ptavv.es.net (ptavv.es.net [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id 6AD6E1CC45; Mon, 12 Oct 2009 08:07:28 -0700 (PDT) To: =?ISO-8859-1?Q?Trond_Endrest=F8l?= In-reply-to: Your message of "Mon, 12 Oct 2009 11:38:42 +0200." Date: Mon, 12 Oct 2009 08:07:28 -0700 From: "Kevin Oberman" Message-Id: <20091012150728.6AD6E1CC45@ptavv.es.net> X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-10-12_07:2009-09-29, 2009-10-12, 2009-10-12 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-0910120112 Cc: freebsd-emulation@freebsd.org Subject: Re: Any chance of an upgraded x11-toolkits/linux-pango? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 15:07:41 -0000 > Date: Mon, 12 Oct 2009 11:38:42 +0200 (CEST) > From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= > Sender: owner-freebsd-emulation@freebsd.org > > Hi, > > Until we're all ready to move to 8.0, those of us who wants to run > Adobe Reader 9.1.3 on 7.2 have no other option but to use > x11-toolkits/linux-pango along with emulators/linux_base-fc4. > > I know the native x11-toolkits/pango was updated to correct for the > integer overflow bug, but what about x11-toolkits/linux-pango? > > Please fix x11-toolkits/linux-pango. The number of systems that are running Fedora Core 4 are very few and far between. I doubt that it will ever be fixed. A better answer is to upgrade your system to use Fedora 10. It works fine on 7.2 systems. If you upgrade, look at the messages on upgrading the Linux emulation in /usr/port/UPDATING 20090401. Note the sysctls and make requirements. After upgrading linux_base to F10, you will need to re-install almost all linux-* ports to the linux-f10-* version. linux-nvu and linux-realplayer are exceptions. That said, linux-f10-pango is also now listed as vulnerable, and I am unsure when it will be updated, though discussion has been on-going for the past three or four days. Hopefully someone with an Fedora 10 system can build a new RPM to fix it. Rumor has it that pango built on a Fedora 11 system will also work, but I have no confirmation of that. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 Key fingerprint:059B 2DDF 031C 9BA3 14A4 EADA 927D EBB3 987B 3751 From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 16:12:29 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFC610656A5 for ; Mon, 12 Oct 2009 16:12:29 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 10EE38FC20 for ; Mon, 12 Oct 2009 16:12:28 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.3/8.14.3) with ESMTP id n9CGCDH9095993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Oct 2009 18:12:13 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.3/8.14.3/Submit) with ESMTP id n9CGCCWa095990; Mon, 12 Oct 2009 18:12:12 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Mon, 12 Oct 2009 18:12:03 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Kevin Oberman In-Reply-To: <20091012150728.6AD6E1CC45@ptavv.es.net> Message-ID: References: <20091012150728.6AD6E1CC45@ptavv.es.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: =?ISO-8859-1?Q?Fagskolen_i_Gj=F8vik?= OpenPGP: url=http://fagskolen.gjovik.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-305714335-1255363933=:84355" X-Spam-Status: No, score=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.fig.ol.no Cc: freebsd-emulation@freebsd.org Subject: Re: Any chance of an upgraded x11-toolkits/linux-pango? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 16:12:29 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-305714335-1255363933=:84355 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 12 Oct 2009 08:07-0700, Kevin Oberman wrote: > The number of systems that are running Fedora Core 4 are very few and > far between. I doubt that it will ever be fixed. A better answer is to > upgrade your system to use Fedora 10. It works fine on 7.2 systems. Oh, I thought that would require me to upgrade to 8.0. I learned something today. > If you upgrade, look at the messages on upgrading the Linux emulation in > /usr/port/UPDATING 20090401. Note the sysctls and make requirements. April Fool's Day? No seriously, thank you for pointing me in the right direction. Trond. - -- - ---------------------------------------------------------------------- Trond Endrestøl | Trond.Endrestol@fagskolen.gjovik.no ACM, NAS, NUUG, SAGE, USENIX | FreeBSD 7.2-STABLE & Alpine 2.00 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrTVVwACgkQbYWZalUoEluitgCeNLmjCDZJ2cnFh7h/VKSgikzO XqQAnjPu3vvo9gCv+4E0Zar+FbFBWgGL =2JWs -----END PGP SIGNATURE----- --2055831798-305714335-1255363933=:84355-- From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 20:15:58 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AACA1065672 for ; Mon, 12 Oct 2009 20:15:58 +0000 (UTC) (envelope-from blauwirbel@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 894968FC12 for ; Mon, 12 Oct 2009 20:15:57 +0000 (UTC) Received: by bwz23 with SMTP id 23so2206592bwz.43 for ; Mon, 12 Oct 2009 13:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=g0yKBLwsTGAdIljkBTTVIWOd+Z2Ep4XAAg1aWeFRxt8=; b=bshGPBRpmmUD7xHAjrDGFMRlGt5ApxGvBXuGoD6EqNqvIwnFfoIE2hA3T6dVC25CdJ 0FOifQ26uVKYzPXPID9MkHhpd2aSj1pgXg5GM8tJ/hxb1ssXe/74Ap0RL8y38QlwWn/+ y42OqsntB9u0lLkqHg3zFmsRRthTHy/r5GsrU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=xMl0/VnRL+XCR08utdEftcMKpT51ZCpTMNS0i9xpv6d6TXlgpbPiSVPc7S5dIFWORo wykneHUTvw/HB0ZG0XXWorXnJJiykP55s00Ax/26cqrw7lN4mCyURiloRyo63q0gs0xs LQfZCRvqvL283MJzS+FaMovB+13OnsPg4t0+k= MIME-Version: 1.0 Received: by 10.223.5.77 with SMTP id 13mr1724543fau.86.1255377344626; Mon, 12 Oct 2009 12:55:44 -0700 (PDT) In-Reply-To: <20091011221840.GA55502@triton8.kn-bremen.de> References: <20091007220549.GA65997@triton8.kn-bremen.de> <20091011221840.GA55502@triton8.kn-bremen.de> From: Blue Swirl Date: Mon, 12 Oct 2009 22:55:24 +0300 Message-ID: To: Juergen Lock Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-emulation@freebsd.org, qemu-devel@nongnu.org, Aleksej Saushev , Toni Subject: Re: [Qemu-devel] Re: playing with qemu usermode emulation on FreeBSD... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 20:15:58 -0000 On Mon, Oct 12, 2009 at 1:18 AM, Juergen Lock wrot= e: > On Thu, Oct 08, 2009 at 12:05:49AM +0200, Juergen Lock wrote: >> I recently noticed there are x86 bsd-user targets now (yeah I totally >> missed those commits...) and now got it working a tiny little bit: >> I can run >> =C2=A0 =C2=A0 =C2=A0 qemu-x86_64 -bsd freebsd /rescue/echo foo bar >> here on FreeBSD 8/amd64 and it echoes foo bar as expected, but >> segfaults afterwards. :) =C2=A0(in pthread_setcancelstate() invoked from >> a guest write() syscall, in case anyone is wondering.) =C2=A0Other thing= s >> I tried either exit with errors or segfault as well, and i386 hosts >> probably still don't work at all yet. =C2=A0(qemu-i386 here on amd64 doe= s >> at least something, but probably needs lock_user() treatment for all >> kinds of syscalls, I only tried adding that for sysctl so far.) >> >> =C2=A0Anyway, here is an emulators/qemu-devel git head snapshot port >> update with my current patches (files/patch-bsd-user), feel free to >> test/debug/improve: >> =C2=A0 =C2=A0 =C2=A0 http://people.freebsd.org/~nox/qemu/qemu-devel-2009= 1007.patch >> (For the folks reading this on the qemu list: =C2=A0I shall start doing >> `proper' patch submissions later, this is more for the FreeBSD folks >> and because I was asked to send what I have...) > > New version at the same place, which now runs FreeBSD/{i386,sparc64} > /rescue/echo on FreeBSD/amd64, the FreeBSD/amd64 target now segfaults > in pthread_setcancelstate() invoked from the final writev() tho. > Oh and I also uploaded the snapshot tarball so others can now actually > build the port too... :) =C2=A0And I have switched to the cpu-exec.c patc= h > posted by Aleksej Saushev on the qemu list and added back amd64 > code there. > > =C2=A0Here is the bsd-user patch again: Please add Signed-off-by: line and use 'diff -u' (or preferably git diff). > + =C2=A0 =C2=A0if (1 /* bsd_type =3D=3D target_freebsd */) > + =C2=A0 =C2=A0 =C2=A0 =C2=A0regs->rdi =3D infop->start_stack; Why the if and comment? > + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (1 /* bsd_type =3D=3D target_freebsd */) = { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0regs->u_regs[8] =3D infop->sta= rt_stack; > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0regs->u_regs[11] =3D infop->st= art_stack; Same here. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 case 0x100: > + =C2=A0 =C2=A0 =C2=A0 =C2=A0/* FreeBSD uses 0x141 for syscalls too */ > + =C2=A0 =C2=A0 =C2=A0 =C2=A0case 0x141: > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (bsd_type !=3D target_freeb= sd) > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto badtrap; You are now also trapping on case 0x100 if bsd_type !=3D target_freebsd, which probably breaks other BSDs. > +/* XXX this needs to be emulated on non-FreeBSD hosts... */ > +static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_= ulong oldp, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen) What kind of call is this, is it possible to emulate on other BSDs? Is it important? I'm just wondering if the cross-BSD emulation makes sense after all. It would make the emulator much simpler if we could assume that host_bsdness =3D=3D target_bsdness. From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 12 22:22:53 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27773106566B for ; Mon, 12 Oct 2009 22:22:53 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id AA4CC8FC19 for ; Mon, 12 Oct 2009 22:22:52 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id B13E01E006EB; Tue, 13 Oct 2009 00:22:51 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9CMKxlU043888; Tue, 13 Oct 2009 00:20:59 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9CMKxcK043887; Tue, 13 Oct 2009 00:20:59 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 13 Oct 2009 00:20:58 +0200 To: Blue Swirl Message-ID: <20091012222058.GA43121@triton8.kn-bremen.de> References: <20091007220549.GA65997@triton8.kn-bremen.de> <20091011221840.GA55502@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-emulation@freebsd.org, Toni , Juergen Lock , Aleksej Saushev , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] Re: playing with qemu usermode emulation on FreeBSD... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 22:22:53 -0000 On Mon, Oct 12, 2009 at 10:55:24PM +0300, Blue Swirl wrote: > On Mon, Oct 12, 2009 at 1:18 AM, Juergen Lock wrote: > > On Thu, Oct 08, 2009 at 12:05:49AM +0200, Juergen Lock wrote: > >> I recently noticed there are x86 bsd-user targets now (yeah I totally > >> missed those commits...) and now got it working a tiny little bit: > >> I can run > >>       qemu-x86_64 -bsd freebsd /rescue/echo foo bar > >> here on FreeBSD 8/amd64 and it echoes foo bar as expected, but > >> segfaults afterwards. :)  (in pthread_setcancelstate() invoked from > >> a guest write() syscall, in case anyone is wondering.)  Other things > >> I tried either exit with errors or segfault as well, and i386 hosts > >> probably still don't work at all yet.  (qemu-i386 here on amd64 does > >> at least something, but probably needs lock_user() treatment for all > >> kinds of syscalls, I only tried adding that for sysctl so far.) > >> > >>  Anyway, here is an emulators/qemu-devel git head snapshot port > >> update with my current patches (files/patch-bsd-user), feel free to > >> test/debug/improve: > >>       http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch > >> (For the folks reading this on the qemu list:  I shall start doing > >> `proper' patch submissions later, this is more for the FreeBSD folks > >> and because I was asked to send what I have...) > > > > New version at the same place, which now runs FreeBSD/{i386,sparc64} > > /rescue/echo on FreeBSD/amd64, the FreeBSD/amd64 target now segfaults > > in pthread_setcancelstate() invoked from the final writev() tho. > > Oh and I also uploaded the snapshot tarball so others can now actually > > build the port too... :)  And I have switched to the cpu-exec.c patch > > posted by Aleksej Saushev on the qemu list and added back amd64 > > code there. > > > >  Here is the bsd-user patch again: > > Please add Signed-off-by: line and use 'diff -u' (or preferably git diff). > Well I wasn't expecting this diff to be committed just yet anyway, it's still more a wip version... > > +    if (1 /* bsd_type == target_freebsd */) > > +        regs->rdi = infop->start_stack; > > Why the if and comment? > > > +        if (1 /* bsd_type == target_freebsd */) { > > +            regs->u_regs[8] = infop->start_stack; > > +            regs->u_regs[11] = infop->start_stack; > > Same here. > Because bsd_type isn't available at these places in the code but probably should be checked, I still wanted to fix that. (Maybe make it global?) > >         case 0x100: > > +        /* FreeBSD uses 0x141 for syscalls too */ > > +        case 0x141: > > +            if (bsd_type != target_freebsd) > > +                goto badtrap; > > You are now also trapping on case 0x100 if bsd_type != target_freebsd, > which probably breaks other BSDs. > Right, thats broken, the 0x141 case should come before the 0x100 here of course. > > +/* XXX this needs to be emulated on non-FreeBSD hosts... */ > > +static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong oldp, > > +                          abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen) > > What kind of call is this, is it possible to emulate on other BSDs? Is > it important? Its used mostly for things that on linux is done by manipulating /proc or /sys, like getting the kernel version, number of cpus, pagesize, etc. - and there are also sysctls that can be written to, like to enable ip forwarding or change sysV ipc settings. Although changes are usually restriced to root so `regular' executables rarely do them and I'm not really handling those yet. See here: http://www.freebsd.org/cgi/man.cgi?query=sysctl&apropos=0&sektion=3&manpath=FreeBSD+7.2-RELEASE&format=html > I'm just wondering if the cross-BSD emulation makes > sense after all. It would make the emulator much simpler if we could > assume that host_bsdness == target_bsdness. Yeah I was wondering about that too... Cheers, Juergen From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 13 08:05:36 2009 Return-Path: Delivered-To: freebsd-emulation@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A19241065672; Tue, 13 Oct 2009 08:05:36 +0000 (UTC) (envelope-from bsam@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 76DB68FC0A; Tue, 13 Oct 2009 08:05:36 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9D85ahB069114; Tue, 13 Oct 2009 08:05:36 GMT (envelope-from bsam@freefall.freebsd.org) Received: (from bsam@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9D85aHG069110; Tue, 13 Oct 2009 08:05:36 GMT (envelope-from bsam) Date: Tue, 13 Oct 2009 08:05:36 GMT Message-Id: <200910130805.n9D85aHG069110@freefall.freebsd.org> To: yuri@tsoft.com, bsam@FreeBSD.org, freebsd-emulation@FreeBSD.org From: bsam@FreeBSD.org Cc: Subject: Re: ports/135322: Port graphics/linux_dri has incorrect packaging list causing automatic port update to fail X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 08:05:36 -0000 Synopsis: Port graphics/linux_dri has incorrect packaging list causing automatic port update to fail State-Changed-From-To: open->feedback State-Changed-By: bsam State-Changed-When: Tue Oct 13 08:03:45 UTC 2009 State-Changed-Why: All ports has been fixed. Can you confirm that? http://www.freebsd.org/cgi/query-pr.cgi?pr=135322 From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 13 12:28:30 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AE081065670 for ; Tue, 13 Oct 2009 12:28:30 +0000 (UTC) (envelope-from mlobo@digiart.art.br) Received: from sv4.hmnoc.net (sv4.hmnoc.net [63.247.76.174]) by mx1.freebsd.org (Postfix) with ESMTP id 657768FC26 for ; Tue, 13 Oct 2009 12:28:30 +0000 (UTC) Received: from [187.78.101.207] (port=54034 helo=papi.localnet) by sv4.hmnoc.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MxgUM-0007TE-BY; Tue, 13 Oct 2009 09:28:28 -0300 To: freebsd-emulation@freebsd.org From: Mario Lobo Date: Tue, 13 Oct 2009 09:27:58 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200910130927.58883.mlobo@digiart.art.br> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sv4.hmnoc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - digiart.art.br Cc: vbox@freebsd.org Subject: Problem with FreeBSD port (re-post) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 12:28:30 -0000 Hi; I've been following the FreeBSD port through svn.bluelife.at. Up to revision 508, everything was fine. On Rev 519 (or before, i'm not sure), the port was split into 3. virtualbox, virtualbox-additions and virtualbox- kmod. There is no problem building virtualbox-kmod. and virtualbox. The modules load without errors and virtualbox starts fine. But when I try to start a VM I get this: 00:00:00.644 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to open the host network interface re0} aWarning=false, preserve=false 00:00:00.654 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to initialize Host Interface Networking (VERR_HOSTIF_INIT_FAILED). 00:00:00.654 Unknown error creating VM (VERR_HOSTIF_INIT_FAILED)} aWarning=false, preserve=false 00:00:00.658 Power up failed (vrc=VERR_HOSTIF_INIT_FAILED, rc=NS_ERROR_FAILURE (0X80004005)) Neither "Bridge adapter" or "host only" are avaliable anymore. kldstat Id Refs Address Size Name 1 60 0xffffffff80100000 caeef0 kernel 2 2 0xffffffff80daf000 41110 linux.ko 3 1 0xffffffff80df1000 3ec0 ng_ether.ko 4 3 0xffffffff80df5000 14d78 netgraph.ko 5 1 0xffffffff80e0a000 5b58 snd_cmi.ko 6 3 0xffffffff80e10000 755a8 sound.ko 7 1 0xffffffff80e86000 27d8 amdtemp.ko 8 1 0xffffffff80e89000 3e20 amdsmb.ko 9 2 0xffffffff80e8d000 24d8 smbus.ko 10 2 0xffffffff80e90000 227d8 drm.ko 11 2 0xffffffff80eb3000 12c88 agp.ko 12 1 0xffffffff80ec6000 712e0 radeon.ko 13 3 0xffffffff80f38000 41070 vboxdrv.ko 14 2 0xffffffff80f7a000 6c40 vboxnetflt.ko 15 1 0xffffffff80f81000 25e8 vboxnetadp.ko 16 1 0xffffffff80f84000 5278 atapicam.ko 17 1 0xffffffff80f8a000 fff0 cpufreq.ko 18 1 0xffffffff81022000 3983 linprocfs.ko 19 1 0xffffffff81026000 a8ca fuse.ko 20 1 0xffffffff81031000 b5b2 ext2fs.ko [~]>ifconfig re0: flags=8843 metric 0 mtu 1500 options=389b ether 00:19:66:d7:a3:45 inet 10.10.10.2 netmask 0xffffff00 broadcast 10.10.10.255 media: Ethernet autoselect (100baseTX ) status: active vboxnet0: flags=8802 metric 0 mtu 1500 ether 0a:00:27:00:00:00 lo0: flags=8049 metric 0 mtu 16384 options=3 inet 127.0.0.1 netmask 0xff000000 It is as if virtualbox can't "see" that the modules ARE loaded, and "connect" to them. If I revert to the previous version (with the modules compiled together with virtualbox - ports/emulators/virtualbox/Makefile,v 1.3 2009/06/15 22:24:42 nox Exp $), everything works again. OS: FreeBSD 8.0-RC1 #0: Sat Oct 10 16:16:42 BRT 2009 amd64 Any suggestions? Thanks, -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE) From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 13 13:43:18 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6857D10656C6; Tue, 13 Oct 2009 13:43:18 +0000 (UTC) (envelope-from miwi@bsdcrew.de) Received: from bsdcrew.de (duro.unixfreunde.de [85.214.90.4]) by mx1.freebsd.org (Postfix) with ESMTP id E0F9E8FC23; Tue, 13 Oct 2009 13:43:17 +0000 (UTC) Received: by bsdcrew.de (Postfix, from userid 1001) id 9ECC34AF56; Tue, 13 Oct 2009 15:43:15 +0200 (CEST) Date: Tue, 13 Oct 2009 15:43:15 +0200 From: Martin Wilke To: Mario Lobo Message-ID: <20091013134315.GL80150@bsdcrew.de> References: <200910130927.58883.mlobo@digiart.art.br> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed Content-Disposition: inline In-Reply-To: <200910130927.58883.mlobo@digiart.art.br> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: ports@FreeBSD.org, freebsd-emulation@freebsd.org, vbox@freebsd.org Subject: Re: Problem with FreeBSD port (re-post) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 13:43:18 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Oct 13, 2009 at 09:27:58AM -0300, Mario Lobo wrote: > Hi; > > I've been following the FreeBSD port through svn.bluelife.at. > > Up to revision 508, everything was fine. On Rev 519 (or before, i'm not sure), > the port was split into 3. virtualbox, virtualbox-additions and virtualbox- > kmod. > Mario, PLEASE PLEASE Stop now your cross posting, we are know about that error and we're working on that error. BUT we've ever said svn.bluelife.at. is our developers repo SO PLEASE DON'T BUG us for any errors in bluelife, if we're not call for test. At the moment we're working on a split of virtualbox and kernel module that's why you have the error. We call for testing if we are think it's ready for a public test. - - Martin on behalf of FreeBSD vbox team > > There is no problem building virtualbox-kmod. and virtualbox. The modules load > without errors and virtualbox starts fine. But when I try to start a VM I get > this: > > 00:00:00.644 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- > cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to open the > host network interface re0} aWarning=false, preserve=false > > 00:00:00.654 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b- > cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={Failed to initialize > Host Interface Networking (VERR_HOSTIF_INIT_FAILED). > > 00:00:00.654 Unknown error creating VM (VERR_HOSTIF_INIT_FAILED)} > aWarning=false, preserve=false > > 00:00:00.658 Power up failed (vrc=VERR_HOSTIF_INIT_FAILED, rc=NS_ERROR_FAILURE > (0X80004005)) > > Neither "Bridge adapter" or "host only" are avaliable anymore. > > > kldstat > Id Refs Address Size Name > 1 60 0xffffffff80100000 caeef0 kernel > 2 2 0xffffffff80daf000 41110 linux.ko > 3 1 0xffffffff80df1000 3ec0 ng_ether.ko > 4 3 0xffffffff80df5000 14d78 netgraph.ko > 5 1 0xffffffff80e0a000 5b58 snd_cmi.ko > 6 3 0xffffffff80e10000 755a8 sound.ko > 7 1 0xffffffff80e86000 27d8 amdtemp.ko > 8 1 0xffffffff80e89000 3e20 amdsmb.ko > 9 2 0xffffffff80e8d000 24d8 smbus.ko > 10 2 0xffffffff80e90000 227d8 drm.ko > 11 2 0xffffffff80eb3000 12c88 agp.ko > 12 1 0xffffffff80ec6000 712e0 radeon.ko > 13 3 0xffffffff80f38000 41070 vboxdrv.ko > 14 2 0xffffffff80f7a000 6c40 vboxnetflt.ko > 15 1 0xffffffff80f81000 25e8 vboxnetadp.ko > 16 1 0xffffffff80f84000 5278 atapicam.ko > 17 1 0xffffffff80f8a000 fff0 cpufreq.ko > 18 1 0xffffffff81022000 3983 linprocfs.ko > 19 1 0xffffffff81026000 a8ca fuse.ko > 20 1 0xffffffff81031000 b5b2 ext2fs.ko > > [~]>ifconfig > re0: flags=8843 metric 0 mtu 1500 > options=389b > ether 00:19:66:d7:a3:45 > inet 10.10.10.2 netmask 0xffffff00 broadcast 10.10.10.255 > media: Ethernet autoselect (100baseTX ) > status: active > vboxnet0: flags=8802 metric 0 mtu 1500 > ether 0a:00:27:00:00:00 > lo0: flags=8049 metric 0 mtu 16384 > options=3 > inet 127.0.0.1 netmask 0xff000000 > > > It is as if virtualbox can't "see" that the modules ARE loaded, and "connect" > to them. > > If I revert to the previous version (with the modules compiled together with > virtualbox - ports/emulators/virtualbox/Makefile,v 1.3 2009/06/15 22:24:42 nox > Exp $), everything works again. > > OS: > FreeBSD 8.0-RC1 #0: Sat Oct 10 16:16:42 BRT 2009 amd64 > > Any suggestions? > > Thanks, > -- > Mario Lobo > http://www.mallavoodoo.com.br > FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE) > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" > - -- +-----------------------+-------------------------------+ | PGP : 0xB1E6FCE9 | Jabber : miwi(at)BSDCrew.de | | Skype : splash_111 | Mail : miwi(at)FreeBSD.org | +-----------------------+-------------------------------+ | Mess with the Best, Die like the Rest! | +-----------------------+-------------------------------+ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrUg/MACgkQdLJIhLHm/OnTQACfReH8isBs2VPWroEyAyJw3hUK m1QAn04EiNZVRCFMu8c5B4WRiqX1RdIM =4/Au -----END PGP SIGNATURE----- From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 13 14:04:10 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC431065672; Tue, 13 Oct 2009 14:04:10 +0000 (UTC) (envelope-from mlobo@digiart.art.br) Received: from sv4.hmnoc.net (sv4.hmnoc.net [63.247.76.174]) by mx1.freebsd.org (Postfix) with ESMTP id 36E6E8FC19; Tue, 13 Oct 2009 14:04:10 +0000 (UTC) Received: from [187.78.101.207] (port=63892 helo=papi.localnet) by sv4.hmnoc.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Mxhyz-000777-7G; Tue, 13 Oct 2009 11:04:09 -0300 From: Mario Lobo To: Martin Wilke Date: Tue, 13 Oct 2009 11:03:42 -0300 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; amd64; ; ) References: <200910130927.58883.mlobo@digiart.art.br> <20091013134315.GL80150@bsdcrew.de> In-Reply-To: <20091013134315.GL80150@bsdcrew.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200910131103.42148.mlobo@digiart.art.br> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sv4.hmnoc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - digiart.art.br Cc: ports@freebsd.org, freebsd-emulation@freebsd.org, vbox@freebsd.org Subject: Re: Problem with FreeBSD port (re-post) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 14:04:10 -0000 On Tuesday 13 October 2009 10:43:15 Martin Wilke wrote: > > Mario, > > PLEASE PLEASE Stop now your cross posting, we are know about that error > and we're working on that error. BUT we've ever said svn.bluelife.at. > is our developers repo SO PLEASE DON'T BUG us for any errors in bluelife, > if we're not call for test. I am aware of that. My only wish was to contribute but please forgive my wrong approach. > At the moment we're working on a split of virtualbox and kernel module > that's why you have the error. We call for testing if we are think > it's ready for a public test. > > - Martin on behalf of FreeBSD vbox team I'll just seat quietly and keep on trying what comes out of svn (just like I've been doing all along). Sorry about the noise. It won't happen again. -- Mario Lobo http://www.mallavoodoo.com.br FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE) From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 13 22:21:06 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FB9106568D for ; Tue, 13 Oct 2009 22:21:06 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 181428FC0A for ; Tue, 13 Oct 2009 22:21:05 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 631231E006EC; Wed, 14 Oct 2009 00:21:04 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9DMJXWq033144; Wed, 14 Oct 2009 00:19:33 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9DMJWqr033143; Wed, 14 Oct 2009 00:19:32 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Wed, 14 Oct 2009 00:19:32 +0200 To: Juergen Lock Message-ID: <20091013221932.GA32808@triton8.kn-bremen.de> References: <20091007220549.GA65997@triton8.kn-bremen.de> <20091011221840.GA55502@triton8.kn-bremen.de> <20091012222058.GA43121@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20091012222058.GA43121@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Blue Swirl , freebsd-emulation@freebsd.org, qemu-devel@nongnu.org, Aleksej Saushev , Toni Subject: Re: [Qemu-devel] Re: playing with qemu usermode emulation on FreeBSD... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 22:21:06 -0000 On Tue, Oct 13, 2009 at 12:20:58AM +0200, Juergen Lock wrote: > On Mon, Oct 12, 2009 at 10:55:24PM +0300, Blue Swirl wrote: > > On Mon, Oct 12, 2009 at 1:18 AM, Juergen Lock wrote: > > > On Thu, Oct 08, 2009 at 12:05:49AM +0200, Juergen Lock wrote: > > >> I recently noticed there are x86 bsd-user targets now (yeah I totally > > >> missed those commits...) and now got it working a tiny little bit: > > >> I can run > > >>       qemu-x86_64 -bsd freebsd /rescue/echo foo bar > > >> here on FreeBSD 8/amd64 and it echoes foo bar as expected, but > > >> segfaults afterwards. :)  (in pthread_setcancelstate() invoked from > > >> a guest write() syscall, in case anyone is wondering.)  Other things > > >> I tried either exit with errors or segfault as well, and i386 hosts > > >> probably still don't work at all yet.  (qemu-i386 here on amd64 does > > >> at least something, but probably needs lock_user() treatment for all > > >> kinds of syscalls, I only tried adding that for sysctl so far.) > > >> > > >>  Anyway, here is an emulators/qemu-devel git head snapshot port > > >> update with my current patches (files/patch-bsd-user), feel free to > > >> test/debug/improve: > > >>       http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch > > >> (For the folks reading this on the qemu list:  I shall start doing > > >> `proper' patch submissions later, this is more for the FreeBSD folks > > >> and because I was asked to send what I have...) > > > > > > New version at the same place, which now runs FreeBSD/{i386,sparc64} > > > /rescue/echo on FreeBSD/amd64, the FreeBSD/amd64 target now segfaults > > > in pthread_setcancelstate() invoked from the final writev() tho. > > > Oh and I also uploaded the snapshot tarball so others can now actually > > > build the port too... :)  And I have switched to the cpu-exec.c patch > > > posted by Aleksej Saushev on the qemu list and added back amd64 > > > code there. > > > > > >  Here is the bsd-user patch again: > > > > Please add Signed-off-by: line and use 'diff -u' (or preferably git diff). > > > Well I wasn't expecting this diff to be committed just yet anyway, > it's still more a wip version... > > > > +    if (1 /* bsd_type == target_freebsd */) > > > +        regs->rdi = infop->start_stack; > > > > Why the if and comment? > > > > > +        if (1 /* bsd_type == target_freebsd */) { > > > +            regs->u_regs[8] = infop->start_stack; > > > +            regs->u_regs[11] = infop->start_stack; > > > > Same here. > > > Because bsd_type isn't available at these places in the code but > probably should be checked, I still wanted to fix that. (Maybe > make it global?) > I still haven't fixed this... > > >         case 0x100: > > > +        /* FreeBSD uses 0x141 for syscalls too */ > > > +        case 0x141: > > > +            if (bsd_type != target_freebsd) > > > +                goto badtrap; > > > > You are now also trapping on case 0x100 if bsd_type != target_freebsd, > > which probably breaks other BSDs. > > > Right, thats broken, the 0x141 case should come before the 0x100 > here of course. > ...but this I just fixed, and I added the multiboot.S patch, and fixed the port's cdrom dma disable knob (files/cdrom-dma-patch). (And I added the cpu-exec.c whitspace fix that was already in the patch I posted in the BSD support thread.) New version at the same place, http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch and I now also made a shar of the patched port: http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.shar Cheers, Juergen From owner-freebsd-emulation@FreeBSD.ORG Thu Oct 15 16:13:47 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638CC106566B; Thu, 15 Oct 2009 16:13:47 +0000 (UTC) (envelope-from jstub@jstub.com) Received: from jstub.com (64-142-26-240.dsl.static.sonic.net [64.142.26.240]) by mx1.freebsd.org (Postfix) with ESMTP id 164668FC18; Thu, 15 Oct 2009 16:13:46 +0000 (UTC) Received: from [192.168.247.14] (simplicity.jstub.com [192.168.247.14]) by jstub.com (8.11.6/8.11.6) with ESMTP id n9FFlov78621; Thu, 15 Oct 2009 08:47:50 -0700 (PDT) (envelope-from jstub@jstub.com) Message-ID: <4AD74421.8020807@jstub.com> Date: Thu, 15 Oct 2009 08:47:45 -0700 From: "John B. Stubblebine" Organization: Stubblebine Family User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: hrs@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: ports@FreeBSD.org, freebsd-emulation@FreeBSD.org, John Stubblebine Subject: FreeBSD Port: acroread9-9.2 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jstub@jstub.com List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 16:13:47 -0000 To: hrs (acroread), ports (cc: recipient for these ports), freebsd-emulation (linux-pango), I tried to "make install" for acroread9 and it failed with the messages that follow in the "ps" below. Acroread9 depends on "linux-pango-1.10.2_3" and others. Linux-pango did not "make" because of a defect. The messages include the URL: http://portaudit.freebsd.org/4b172278-3f46-11de-becb-001cc0377035.html This link says that a defect is in all: pango < 1.24 linux-pango < 1.24 linux-f8-pango < 1.24 linux-f10-pango < 1.24 I updated the ports tree, but the Make file still refers to: linux-pango-1.10.2_3 In addition, looking for "linux-pango" in the ports collection on FreeBSD.org shows only linux-pango version 1.10.2_3. So how do I get linux-pango 1.24, or later?? And if so, will acroread9 "make install" successfully? I looked at the "pango" web site: http://ftp.gnome.org/pub/GNOME/sources/pango/ and found that there are source versions of "pango" up to 1.26. It seems there is a need to upgrade all of the "pango" ports to 1.24 or later, and the make files for all the ports that use it, and perhaps some other aspects of those ports as well. I do not have the skills to do this. I am hoping that you can help. -- Best regards, John B. Stubblebine jstub@jstub.com ps: Pertinant output for failed "make install" for acroread9: ===> Running linux ldconfig /compat/linux/sbin/ldconfig -r /compat/linux ===> Registering installation for linux-jpeg-6b.34_2 ===> Returning to build of linux-gtk2-2.6.10_3 ===> linux-gtk2-2.6.10_3 depends on file: /compat/linux/usr/lib/libpango-1.0.so.0.1001.1 - not found ===> Verifying install for /compat/linux/usr/lib/libpango-1.0.so.0.1001.1 in/usr/ports/x11-toolkits/linux-pango ===> linux-pango-1.10.2_3 has known vulnerabilities: => pango -- integer overflow. Reference: => Please update your ports tree and try again. *** Error code 1 Stop in /usr/ports/x11-toolkits/linux-pango. *** Error code 1 Stop in /usr/ports/x11-toolkits/linux-gtk2. *** Error code 1 Stop in /usr/ports/print/acroread9. gw2# gw2# uname -a FreeBSD gw2.jstub.com 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #0: Thu Jul 30 06:20:21 PDT 2009 root@gw2.jstub.com:/usr/obj/usr/src/sys/GENERIC i386 gw2# pwd /usr/ports/print/acroread9 gw2# From owner-freebsd-emulation@FreeBSD.ORG Thu Oct 15 18:11:11 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA78106568F for ; Thu, 15 Oct 2009 18:11:11 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id C3A768FC14 for ; Thu, 15 Oct 2009 18:11:10 +0000 (UTC) Received: by ewy18 with SMTP id 18so1081092ewy.43 for ; Thu, 15 Oct 2009 11:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :message-id; bh=E4wmXk9HecJ99izTHN+u6uGtn98c8zg1hepJE9OeYVk=; b=NQKIU9rcip/CAKutoVMyZ557dp7L6xaj1eoSIsxonzAgrYZPCvXn+fL1vwKf+RICrH HrpQX57gd9y49VFS5xYWsx/BuGSArVG0q1NhNXoxGsy4weSIjYAMVJpj/Fzhpm2L4Lzf IXgRP+CjtLStE4kQ1uNSo7yuq6PxB1j4qmFls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=AZh42SrF9AdA2q6j7spg3D981daBfQ7w7W4mkwXXag/mvn58OUkTsrskFyHGu6zSWU h5kum3N6DLUn7vt32f09C9kwznWeJS32x5KCkpok2+49mNXp2XnYq8iXY6ZBCmJC82cs CLZNRRYAsRTSrOQvFsvW3HMwHqkApxltmdeyo= Received: by 10.211.128.6 with SMTP id f6mr484283ebn.15.1255629026442; Thu, 15 Oct 2009 10:50:26 -0700 (PDT) Received: from dragon.dg ([41.0.54.23]) by mx.google.com with ESMTPS id 7sm2976473eyb.32.2009.10.15.10.50.24 (version=SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 10:50:26 -0700 (PDT) From: David Naylor To: freebsd-emulation@freebsd.org Date: Thu, 15 Oct 2009 19:50:22 +0200 User-Agent: KMail/1.12.2 (FreeBSD/8.0-RC1; KDE/4.3.2; i386; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10464912.gFoTrag8R5"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200910151950.26620.naylor.b.david@gmail.com> Subject: VirtualBox: vboxnetflt related problems X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 18:11:11 -0000 --nextPart10464912.gFoTrag8R5 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Thanks for porting VirtualBox, it has proven most useful (no more slow RDC)= =2E =20 I've found some problems relating to VirtualBox's bridged networking: 1) loader doesn't pull in all the dependencies for vboxnetflt (kldload=20 does) [missing dependencies: ng_ether] 2) even with the dependencies specified in loader.conf vboxnetflt fails to= =20 initialise on boot [module_register_init: MOD_LOAD (ng_vboxnetflt, 0xc0f44f= d9,=20 0xc19bd6a0) error 22] 3) bridging doesn't work when connecting to bridge0 or tap0: # netstat -w1 -I tap0 input (tap0) output packets errs bytes packets errs bytes colls 0 0 0 0 0 0 0 0 0 0 0 2 151 0 =2E.. This happen with and without giving tap0 an IP address. =20 This is using version virtualbox-3.0.51.r22902_2 from ports (recompiled=20 today). Regards, David P.S. please CC me as I am not subscribed to mailing list --nextPart10464912.gFoTrag8R5 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEABECAAYFAkrXYOIACgkQUaaFgP9pFrLaTQCfcO3ylgAP8T8l1aAAFFY8br1F iXEAn3Vu65LIica12Yu36epmlwi/UuMX =UGuC -----END PGP SIGNATURE----- --nextPart10464912.gFoTrag8R5-- From owner-freebsd-emulation@FreeBSD.ORG Fri Oct 16 22:39:09 2009 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0264D1065670 for ; Fri, 16 Oct 2009 22:39:09 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 496D28FC08 for ; Fri, 16 Oct 2009 22:39:08 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id E1C1B1E006EC; Sat, 17 Oct 2009 00:39:06 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9GMYRUn055059; Sat, 17 Oct 2009 00:34:27 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9GMYQmi055058; Sat, 17 Oct 2009 00:34:26 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sat, 17 Oct 2009 00:34:26 +0200 To: Juergen Lock Message-ID: <20091016223426.GA54110@triton8.kn-bremen.de> References: <20091007220549.GA65997@triton8.kn-bremen.de> <20091011221840.GA55502@triton8.kn-bremen.de> <20091012222058.GA43121@triton8.kn-bremen.de> <20091013221932.GA32808@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20091013221932.GA32808@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Blue Swirl , freebsd-emulation@freebsd.org, qemu-devel@nongnu.org, Aleksej Saushev , Toni Subject: Re: [Qemu-devel] Re: playing with qemu usermode emulation on FreeBSD... X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2009 22:39:09 -0000 On Wed, Oct 14, 2009 at 12:19:32AM +0200, Juergen Lock wrote: > On Tue, Oct 13, 2009 at 12:20:58AM +0200, Juergen Lock wrote: > > On Mon, Oct 12, 2009 at 10:55:24PM +0300, Blue Swirl wrote: > > > On Mon, Oct 12, 2009 at 1:18 AM, Juergen Lock wrote: > > > > On Thu, Oct 08, 2009 at 12:05:49AM +0200, Juergen Lock wrote: > > > >> I recently noticed there are x86 bsd-user targets now (yeah I totally > > > >> missed those commits...) and now got it working a tiny little bit: > > > >> I can run > > > >>       qemu-x86_64 -bsd freebsd /rescue/echo foo bar > > > >> here on FreeBSD 8/amd64 and it echoes foo bar as expected, but > > > >> segfaults afterwards. :)  (in pthread_setcancelstate() invoked from > > > >> a guest write() syscall, in case anyone is wondering.)  Other things > > > >> I tried either exit with errors or segfault as well, and i386 hosts > > > >> probably still don't work at all yet.  (qemu-i386 here on amd64 does > > > >> at least something, but probably needs lock_user() treatment for all > > > >> kinds of syscalls, I only tried adding that for sysctl so far.) > > > >> > > > >>  Anyway, here is an emulators/qemu-devel git head snapshot port > > > >> update with my current patches (files/patch-bsd-user), feel free to > > > >> test/debug/improve: > > > >>       http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch > > > >> (For the folks reading this on the qemu list:  I shall start doing > > > >> `proper' patch submissions later, this is more for the FreeBSD folks > > > >> and because I was asked to send what I have...) > > > > > > > > New version at the same place, which now runs FreeBSD/{i386,sparc64} > > > > /rescue/echo on FreeBSD/amd64, the FreeBSD/amd64 target now segfaults > > > > in pthread_setcancelstate() invoked from the final writev() tho. > > > > Oh and I also uploaded the snapshot tarball so others can now actually > > > > build the port too... :)  And I have switched to the cpu-exec.c patch > > > > posted by Aleksej Saushev on the qemu list and added back amd64 > > > > code there. > > > > > > > >  Here is the bsd-user patch again: > > > > > > Please add Signed-off-by: line and use 'diff -u' (or preferably git diff). > > > > > Well I wasn't expecting this diff to be committed just yet anyway, > > it's still more a wip version... > > > > > > +    if (1 /* bsd_type == target_freebsd */) > > > > +        regs->rdi = infop->start_stack; > > > > > > Why the if and comment? > > > > > > > +        if (1 /* bsd_type == target_freebsd */) { > > > > +            regs->u_regs[8] = infop->start_stack; > > > > +            regs->u_regs[11] = infop->start_stack; > > > > > > Same here. > > > > > Because bsd_type isn't available at these places in the code but > > probably should be checked, I still wanted to fix that. (Maybe > > make it global?) > > > I still haven't fixed this... > > > > >         case 0x100: > > > > +        /* FreeBSD uses 0x141 for syscalls too */ > > > > +        case 0x141: > > > > +            if (bsd_type != target_freebsd) > > > > +                goto badtrap; > > > > > > You are now also trapping on case 0x100 if bsd_type != target_freebsd, > > > which probably breaks other BSDs. > > > > > Right, thats broken, the 0x141 case should come before the 0x100 > > here of course. > > > ...but this I just fixed, and I added the multiboot.S patch, and > fixed the port's cdrom dma disable knob (files/cdrom-dma-patch). > (And I added the cpu-exec.c whitspace fix that was already in the > patch I posted in the BSD support thread.) > > New version at the same place, > http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.patch > and I now also made a shar of the patched port: > http://people.freebsd.org/~nox/qemu/qemu-devel-20091007.shar Updated again, among other things I added basic FreeBSD sysarch(2) handling, fixed syscall errno return (I had added code to set the carry bit for the x86 target before but the sign of the returned errno was still wrong), and I finally fixed the if (1) above (made bsd_type global.) And, I now can run FreeBSD/amd64 /bin/sh and vim on same! :) (zsh not yet tho.) Oh and Toni tested taking FreeBSD/i386's default linker script, changing only the load address to 0x60000000 as in qemu's and, using that as i386.ld, he now can run qemu-i386 on FreeBSD/i386 with simple executables too... See files/patch-bsd-user-ld in the shar, which I also now moved the x86_64.ld patch to that I had talked about earlier. It probably can't be used everywhere as is tho since it has: OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", "elf32-i386-freebsd") (and I also don't know if the one currently in the tree has other features that are needed at least on Linux, any linker gurus care to comment?) Here is the rest of the bsd-user patches again (files/patch-bsd-user in the shar), if you think they are ready to commit I'm not against it anymore :), comments are also welcome of course. Thanx, Juergen --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -126,6 +126,9 @@ static inline void init_thread(struct ta regs->rax = 0; regs->rsp = infop->start_stack; regs->rip = infop->entry; + if (bsd_type == target_freebsd) { + regs->rdi = infop->start_stack; + } } #else @@ -249,8 +252,13 @@ static inline void init_thread(struct ta #else if (personality(infop->personality) == PER_LINUX32) regs->u_regs[14] = infop->start_stack - 16 * 4; - else + else { regs->u_regs[14] = infop->start_stack - 16 * 8 - STACK_BIAS; + if (bsd_type == target_freebsd) { + regs->u_regs[8] = infop->start_stack; + regs->u_regs[11] = infop->start_stack; + } + } #endif } --- a/bsd-user/freebsd/strace.list +++ b/bsd-user/freebsd/strace.list @@ -39,6 +39,7 @@ { TARGET_FREEBSD_NR_ftruncate, "ftruncate", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_futimes, "futimes", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_getdirentries, "getdirentries", NULL, NULL, NULL }, +{ TARGET_FREEBSD_NR_freebsd6_mmap, "freebsd6_mmap", NULL, NULL, NULL }, { TARGET_FREEBSD_NR_getegid, "getegid", "%s()", NULL, NULL }, { TARGET_FREEBSD_NR_geteuid, "geteuid", "%s()", NULL, NULL }, { TARGET_FREEBSD_NR_getfh, "getfh", NULL, NULL, NULL }, --- a/bsd-user/i386/syscall.h +++ b/bsd-user/i386/syscall.h @@ -143,5 +143,19 @@ struct target_vm86plus_struct { struct target_vm86plus_info_struct vm86plus; }; +/* FreeBSD sysarch(2) */ +#define TARGET_FREEBSD_I386_GET_LDT 0 +#define TARGET_FREEBSD_I386_SET_LDT 1 + /* I386_IOPL */ +#define TARGET_FREEBSD_I386_GET_IOPERM 3 +#define TARGET_FREEBSD_I386_SET_IOPERM 4 + /* xxxxx */ +#define TARGET_FREEBSD_I386_VM86 6 +#define TARGET_FREEBSD_I386_GET_FSBASE 7 +#define TARGET_FREEBSD_I386_SET_FSBASE 8 +#define TARGET_FREEBSD_I386_GET_GSBASE 9 +#define TARGET_FREEBSD_I386_SET_GSBASE 10 + + #define UNAME_MACHINE "i386" --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -46,6 +46,7 @@ int have_guest_base; static const char *interp_prefix = CONFIG_QEMU_PREFIX; const char *qemu_uname_release = CONFIG_UNAME_RELEASE; extern char **environ; +enum BSDType bsd_type; /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so we allocate a bigger stack. Need a better solution, for example @@ -168,7 +169,7 @@ static void set_idt(int n, unsigned int } #endif -void cpu_loop(CPUX86State *env, enum BSDType bsd_type) +void cpu_loop(CPUX86State *env) { int trapnr; abi_ulong pc; @@ -179,27 +180,90 @@ void cpu_loop(CPUX86State *env, enum BSD switch(trapnr) { case 0x80: /* syscall from int $0x80 */ - env->regs[R_EAX] = do_openbsd_syscall(env, - env->regs[R_EAX], - env->regs[R_EBX], - env->regs[R_ECX], - env->regs[R_EDX], - env->regs[R_ESI], - env->regs[R_EDI], - env->regs[R_EBP]); + if (bsd_type == target_freebsd) { + abi_ulong params = (abi_ulong) env->regs[R_ESP] + + sizeof(int32_t); + int32_t syscall_nr = env->regs[R_EAX]; + int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8; + + if (syscall_nr == TARGET_FREEBSD_NR_syscall) { + get_user_s32(syscall_nr, params); + params += sizeof(int32_t); + } else if (syscall_nr == TARGET_FREEBSD_NR___syscall) { + get_user_s32(syscall_nr, params); + params += sizeof(int64_t); + } + get_user_s32(arg1, params); + params += sizeof(int32_t); + get_user_s32(arg2, params); + params += sizeof(int32_t); + get_user_s32(arg3, params); + params += sizeof(int32_t); + get_user_s32(arg4, params); + params += sizeof(int32_t); + get_user_s32(arg5, params); + params += sizeof(int32_t); + get_user_s32(arg6, params); + params += sizeof(int32_t); + get_user_s32(arg7, params); + params += sizeof(int32_t); + get_user_s32(arg8, params); + env->regs[R_EAX] = do_freebsd_syscall(env, + syscall_nr, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + arg8); + } else { //if (bsd_type == target_openbsd) + env->regs[R_EAX] = do_openbsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EBX], + env->regs[R_ECX], + env->regs[R_EDX], + env->regs[R_ESI], + env->regs[R_EDI], + env->regs[R_EBP]); + } + if (((abi_ulong)env->regs[R_EAX]) >= (abi_ulong)(-515)) { + env->regs[R_EAX] = -env->regs[R_EAX]; + env->eflags |= CC_C; + } else { + env->eflags &= ~CC_C; + } break; #ifndef TARGET_ABI32 case EXCP_SYSCALL: - /* linux syscall from syscall intruction */ - env->regs[R_EAX] = do_openbsd_syscall(env, - env->regs[R_EAX], - env->regs[R_EDI], - env->regs[R_ESI], - env->regs[R_EDX], - env->regs[10], - env->regs[8], - env->regs[9]); + /* syscall from syscall intruction */ + if (bsd_type == target_freebsd) + env->regs[R_EAX] = do_freebsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EDI], + env->regs[R_ESI], + env->regs[R_EDX], + env->regs[R_ECX], + env->regs[8], + env->regs[9], 0, 0); + else { //if (bsd_type == target_openbsd) + env->regs[R_EAX] = do_openbsd_syscall(env, + env->regs[R_EAX], + env->regs[R_EDI], + env->regs[R_ESI], + env->regs[R_EDX], + env->regs[10], + env->regs[8], + env->regs[9]); + } env->eip = env->exception_next_eip; + if (((abi_ulong)env->regs[R_EAX]) >= (abi_ulong)(-515)) { + env->regs[R_EAX] = -env->regs[R_EAX]; + env->eflags |= CC_C; + } else { + env->eflags &= ~CC_C; + } break; #endif #if 0 @@ -446,7 +510,7 @@ static void flush_windows(CPUSPARCState #endif } -void cpu_loop(CPUSPARCState *env, enum BSDType bsd_type) +void cpu_loop(CPUSPARCState *env) { int trapnr, ret, syscall_nr; //target_siginfo_t info; @@ -458,6 +522,10 @@ void cpu_loop(CPUSPARCState *env, enum B #ifndef TARGET_SPARC64 case 0x80: #else + /* FreeBSD uses 0x141 for syscalls too */ + case 0x141: + if (bsd_type != target_freebsd) + goto badtrap; case 0x100: #endif syscall_nr = env->gregs[1]; @@ -465,7 +533,7 @@ void cpu_loop(CPUSPARCState *env, enum B ret = do_freebsd_syscall(env, syscall_nr, env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwptr[3], - env->regwptr[4], env->regwptr[5]); + env->regwptr[4], env->regwptr[5], 0, 0); else if (bsd_type == target_netbsd) ret = do_netbsd_syscall(env, syscall_nr, env->regwptr[0], env->regwptr[1], @@ -482,6 +550,7 @@ void cpu_loop(CPUSPARCState *env, enum B env->regwptr[4], env->regwptr[5]); } if ((unsigned int)ret >= (unsigned int)(-515)) { + ret = -ret; #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) env->xcc |= PSR_CARRY; #else @@ -587,6 +656,9 @@ void cpu_loop(CPUSPARCState *env, enum B } break; default: +#ifdef TARGET_SPARC64 + badtrap: +#endif printf ("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(env, stderr, fprintf, 0); exit (1); @@ -668,7 +740,7 @@ int main(int argc, char **argv) int gdbstub_port = 0; char **target_environ, **wrk; envlist_t *envlist = NULL; - enum BSDType bsd_type = target_openbsd; + bsd_type = target_openbsd; if (argc <= 1) usage(); @@ -1033,7 +1105,7 @@ int main(int argc, char **argv) gdbserver_start (gdbstub_port); gdb_handlesig(env, 0); } - cpu_loop(env, bsd_type); + cpu_loop(env); /* never exits */ return 0; } --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -18,6 +18,7 @@ enum BSDType { target_netbsd, target_openbsd, }; +extern enum BSDType bsd_type; #include "syscall_defs.h" #include "syscall.h" @@ -130,7 +131,8 @@ abi_long do_brk(abi_ulong new_brk); void syscall_init(void); abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, - abi_long arg5, abi_long arg6); + abi_long arg5, abi_long arg6, abi_long arg7, + abi_long arg8); abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); @@ -139,7 +141,7 @@ abi_long do_openbsd_syscall(void *cpu_en abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) __attribute__((format(printf,1,2))); extern THREAD CPUState *thread_env; -void cpu_loop(CPUState *env, enum BSDType bsd_type); +void cpu_loop(CPUState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -40,20 +41,283 @@ static abi_ulong target_brk; static abi_ulong target_original_brk; -#define get_errno(x) (x) +static inline abi_long get_errno(abi_long ret) +{ + if (ret == -1) + /* XXX need to translate host -> target errnos here */ + return -(errno); + else + return ret; +} + #define target_to_host_bitmask(x, tbl) (x) +static inline int is_error(abi_long ret) +{ + return (abi_ulong)ret >= (abi_ulong)(-4096); +} + void target_set_brk(abi_ulong new_brk) { target_original_brk = target_brk = HOST_PAGE_ALIGN(new_brk); } +/* do_obreak() must return target errnos. */ +static abi_long do_obreak(abi_ulong new_brk) +{ + abi_ulong brk_page; + abi_long mapped_addr; + int new_alloc_size; + + if (!new_brk) + return 0; + if (new_brk < target_original_brk) + return -TARGET_EINVAL; + + brk_page = HOST_PAGE_ALIGN(target_brk); + + /* If the new brk is less than this, set it and we're done... */ + if (new_brk < brk_page) { + target_brk = new_brk; + return 0; + } + + /* We need to allocate more memory after the brk... */ + new_alloc_size = HOST_PAGE_ALIGN(new_brk - brk_page + 1); + mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size, + PROT_READ|PROT_WRITE, + MAP_ANON|MAP_FIXED|MAP_PRIVATE, -1, 0)); + + if (!is_error(mapped_addr)) + target_brk = new_brk; + else + return mapped_addr; + + return 0; +} + +#if defined(TARGET_I386) +static abi_long do_freebsd_sysarch(CPUX86State *env, int op, abi_ulong parms) +{ + abi_long ret = 0; + abi_ulong val; + int idx; + + switch(op) { +#ifdef TARGET_ABI32 + case TARGET_FREEBSD_I386_SET_GSBASE: + case TARGET_FREEBSD_I386_SET_FSBASE: + if (op == TARGET_FREEBSD_I386_SET_GSBASE) +#else + case TARGET_FREEBSD_AMD64_SET_GSBASE: + case TARGET_FREEBSD_AMD64_SET_FSBASE: + if (op == TARGET_FREEBSD_AMD64_SET_GSBASE) +#endif + idx = R_GS; + else + idx = R_FS; + if (get_user(val, parms, abi_ulong)) + return -TARGET_EFAULT; + cpu_x86_load_seg(env, idx, 0); + env->segs[idx].base = val; + break; +#ifdef TARGET_ABI32 + case TARGET_FREEBSD_I386_GET_GSBASE: + case TARGET_FREEBSD_I386_GET_FSBASE: + if (op == TARGET_FREEBSD_I386_GET_GSBASE) +#else + case TARGET_FREEBSD_AMD64_GET_GSBASE: + case TARGET_FREEBSD_AMD64_GET_FSBASE: + if (op == TARGET_FREEBSD_AMD64_GET_GSBASE) +#endif + idx = R_GS; + else + idx = R_FS; + val = env->segs[idx].base; + if (put_user(val, parms, abi_ulong)) + return -TARGET_EFAULT; + break; + /* XXX handle the others... */ + default: + ret = -TARGET_EINVAL; + break; + } + return ret; +} +#endif + +#ifdef TARGET_SPARC +static abi_long do_freebsd_sysarch(void *env, int op, abi_ulong parms) +{ + /* XXX handle + * TARGET_FREEBSD_SPARC_UTRAP_INSTALL, + * TARGET_FREEBSD_SPARC_SIGTRAMP_INSTALL + */ + return -TARGET_EINVAL; +} +#endif + +#ifdef __FreeBSD__ +/* + * XXX this uses the undocumented oidfmt interface to find the kind of + * a requested sysctl, see /sys/kern/kern_sysctl.c:sysctl_sysctl_oidfmt() + * (this is mostly copied from src/sbin/sysctl/sysctl.c) + */ +static int +oidfmt(int *oid, int len, char *fmt, uint32_t *kind) +{ + int qoid[CTL_MAXNAME+2]; + uint8_t buf[BUFSIZ]; + int i; + size_t j; + + qoid[0] = 0; + qoid[1] = 4; + memcpy(qoid + 2, oid, len * sizeof(int)); + + j = sizeof(buf); + i = sysctl(qoid, len + 2, buf, &j, 0, 0); + if (i) + return i; + + if (kind) + *kind = *(uint32_t *)buf; + + if (fmt) + strcpy(fmt, (char *)(buf + sizeof(uint32_t))); + return (0); +} + +/* + * try and convert sysctl return data for the target. + * XXX doesn't handle CTLTYPE_OPAQUE and CTLTYPE_STRUCT. + */ +static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) +{ + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + *(uint32_t *)holdp = tswap32(*(uint32_t *)holdp); + break; +#ifdef TARGET_ABI32 + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + *(uint32_t *)holdp = tswap32(*(long *)holdp); + break; +#else + case CTLTYPE_LONG: + *(uint64_t *)holdp = tswap64(*(long *)holdp); + case CTLTYPE_ULONG: + *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp); + break; +#endif + case CTLTYPE_QUAD: + *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp); + break; + case CTLTYPE_STRING: + break; + default: + /* XXX unhandled */ + return -1; + } + return 0; +} + +/* XXX this needs to be emulated on non-FreeBSD hosts... */ +static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong oldp, + abi_ulong oldlenp, abi_ulong newp, abi_ulong newlen) +{ + abi_long ret; + void *hnamep, *holdp, *hnewp = NULL; + size_t holdlen; + abi_ulong oldlen = 0; + int32_t *snamep = qemu_malloc(sizeof(int32_t) * namelen), *p, *q, i; + uint32_t kind = 0; + + if (oldlenp) + get_user_ual(oldlen, oldlenp); + if (!(hnamep = lock_user(VERIFY_READ, namep, namelen, 1))) + return -TARGET_EFAULT; + if (newp && !(hnewp = lock_user(VERIFY_READ, newp, newlen, 1))) + return -TARGET_EFAULT; + if (!(holdp = lock_user(VERIFY_WRITE, oldp, oldlen, 0))) + return -TARGET_EFAULT; + holdlen = oldlen; + for (p = hnamep, q = snamep, i = 0; i < namelen; p++, i++) + *q++ = tswap32(*p); + oidfmt(snamep, namelen, NULL, &kind); + /* XXX swap hnewp */ + ret = get_errno(sysctl(snamep, namelen, holdp, &holdlen, hnewp, newlen)); + if (!ret) + sysctl_oldcvt(holdp, holdlen, kind); + put_user_ual(holdlen, oldlenp); + unlock_user(hnamep, namep, 0); + unlock_user(holdp, oldp, holdlen); + if (hnewp) + unlock_user(hnewp, newp, 0); + qemu_free(snamep); + return ret; +} +#endif + +/* FIXME + * lock_iovec()/unlock_iovec() have a return code of 0 for success where + * other lock functions have a return code of 0 for failure. + */ +static abi_long lock_iovec(int type, struct iovec *vec, abi_ulong target_addr, + int count, int copy) +{ + struct target_iovec *target_vec; + abi_ulong base; + int i; + + target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); + if (!target_vec) + return -TARGET_EFAULT; + for(i = 0;i < count; i++) { + base = tswapl(target_vec[i].iov_base); + vec[i].iov_len = tswapl(target_vec[i].iov_len); + if (vec[i].iov_len != 0) { + vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy); + /* Don't check lock_user return value. We must call writev even + if a element has invalid base address. */ + } else { + /* zero length pointer is ignored */ + vec[i].iov_base = NULL; + } + } + unlock_user (target_vec, target_addr, 0); + return 0; +} + +static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr, + int count, int copy) +{ + struct target_iovec *target_vec; + abi_ulong base; + int i; + + target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1); + if (!target_vec) + return -TARGET_EFAULT; + for(i = 0;i < count; i++) { + if (target_vec[i].iov_base) { + base = tswapl(target_vec[i].iov_base); + unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0); + } + } + unlock_user (target_vec, target_addr, 0); + + return 0; +} + /* do_syscall() should always have a single exit point at the end so that actions, such as logging of syscall results, can be performed. All errnos that do_syscall() returns must be -TARGET_. */ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, - abi_long arg5, abi_long arg6) + abi_long arg5, abi_long arg6, abi_long arg7, + abi_long arg8) { abi_long ret; void *p; @@ -86,6 +350,18 @@ abi_long do_freebsd_syscall(void *cpu_en ret = get_errno(write(arg1, p, arg3)); unlock_user(p, arg2, 0); break; + case TARGET_FREEBSD_NR_writev: + { + int count = arg3; + struct iovec *vec; + + vec = alloca(count * sizeof(struct iovec)); + if (lock_iovec(VERIFY_READ, vec, arg2, count, 1) < 0) + goto efault; + ret = get_errno(writev(arg1, vec, count)); + unlock_iovec(vec, arg2, count, 0); + } + break; case TARGET_FREEBSD_NR_open: if (!(p = lock_user_string(arg1))) goto efault; @@ -103,12 +379,23 @@ abi_long do_freebsd_syscall(void *cpu_en case TARGET_FREEBSD_NR_mprotect: ret = get_errno(target_mprotect(arg1, arg2, arg3)); break; + case TARGET_FREEBSD_NR_break: + ret = do_obreak(arg1); + break; +#ifdef __FreeBSD__ + case TARGET_FREEBSD_NR___sysctl: + ret = do_freebsd_sysctl(arg1, arg2, arg3, arg4, arg5, arg6); + break; +#endif + case TARGET_FREEBSD_NR_sysarch: + ret = do_freebsd_sysarch(cpu_env, arg1, arg2); + break; case TARGET_FREEBSD_NR_syscall: case TARGET_FREEBSD_NR___syscall: - ret = do_freebsd_syscall(cpu_env,arg1 & 0xffff,arg2,arg3,arg4,arg5,arg6,0); + ret = do_freebsd_syscall(cpu_env,arg1 & 0xffff,arg2,arg3,arg4,arg5,arg6,arg7,arg8,0); break; default: - ret = syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); + ret = get_errno(syscall(num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)); break; } fail: --- a/bsd-user/syscall_defs.h +++ b/bsd-user/syscall_defs.h @@ -106,3 +106,9 @@ #include "freebsd/syscall_nr.h" #include "netbsd/syscall_nr.h" #include "openbsd/syscall_nr.h" + +struct target_iovec { + abi_long iov_base; /* Starting address */ + abi_long iov_len; /* Number of bytes */ +}; + --- a/bsd-user/x86_64/syscall.h +++ b/bsd-user/x86_64/syscall.h @@ -90,6 +90,24 @@ struct target_msqid64_ds { abi_ulong __unused5; }; +/* FreeBSD sysarch(2) */ +#define TARGET_FREEBSD_I386_GET_LDT 0 +#define TARGET_FREEBSD_I386_SET_LDT 1 + /* I386_IOPL */ +#define TARGET_FREEBSD_I386_GET_IOPERM 3 +#define TARGET_FREEBSD_I386_SET_IOPERM 4 + /* xxxxx */ +#define TARGET_FREEBSD_I386_GET_FSBASE 7 +#define TARGET_FREEBSD_I386_SET_FSBASE 8 +#define TARGET_FREEBSD_I386_GET_GSBASE 9 +#define TARGET_FREEBSD_I386_SET_GSBASE 10 + +#define TARGET_FREEBSD_AMD64_GET_FSBASE 128 +#define TARGET_FREEBSD_AMD64_SET_FSBASE 129 +#define TARGET_FREEBSD_AMD64_GET_GSBASE 130 +#define TARGET_FREEBSD_AMD64_SET_GSBASE 131 + + #define UNAME_MACHINE "x86_64" #define TARGET_ARCH_SET_GS 0x1001 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -805,6 +805,20 @@ static inline int handle_cpu_signal(unsi # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno) # define ERROR_sig(context) ((context)->uc_mcontext->es.err) # define MASK_sig(context) ((context)->uc_sigmask) +#elif defined (__NetBSD__) +# include + +# define EIP_sig(context) ((context)->uc_mcontext.__gregs[_REG_EIP]) +# define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) +# define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) +# define MASK_sig(context) ((context)->uc_sigmask) +#elif defined (__FreeBSD__) || defined(__DragonFly__) +# include + +# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_eip)) +# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) +# define ERROR_sig(context) ((context)->uc_mcontext.mc_err) +# define MASK_sig(context) ((context)->uc_sigmask) #elif defined(__OpenBSD__) # define EIP_sig(context) ((context)->sc_eip) # define TRAP_sig(context) ((context)->sc_trapno) @@ -821,7 +835,9 @@ int cpu_signal_handler(int host_signum, void *puc) { siginfo_t *info = pinfo; -#if defined(__OpenBSD__) +#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) + ucontext_t *uc = puc; +#elif defined(__OpenBSD__) struct sigcontext *uc = puc; #else struct ucontext *uc = puc; @@ -855,6 +871,13 @@ int cpu_signal_handler(int host_signum, #define TRAP_sig(context) ((context)->sc_trapno) #define ERROR_sig(context) ((context)->sc_err) #define MASK_sig(context) ((context)->sc_mask) +#elif defined (__FreeBSD__) || defined(__DragonFly__) +#include + +#define PC_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_rip)) +#define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) +#define ERROR_sig(context) ((context)->uc_mcontext.mc_err) +#define MASK_sig(context) ((context)->uc_sigmask) #else #define PC_sig(context) ((context)->uc_mcontext.gregs[REG_RIP]) #define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) @@ -867,7 +890,7 @@ int cpu_signal_handler(int host_signum, { siginfo_t *info = pinfo; unsigned long pc; -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) ucontext_t *uc = puc; #elif defined(__OpenBSD__) struct sigcontext *uc = puc; Signed-off-by: Juergen Lock From owner-freebsd-emulation@FreeBSD.ORG Sat Oct 17 15:45:25 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54071106566B for ; Sat, 17 Oct 2009 15:45:25 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 126ED8FC21 for ; Sat, 17 Oct 2009 15:45:24 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 184081E006EF; Sat, 17 Oct 2009 17:45:24 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9HFi4mH080639 for ; Sat, 17 Oct 2009 17:44:04 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9HFi4gp080638 for freebsd-emulation@FreeBSD.org; Sat, 17 Oct 2009 17:44:04 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sat, 17 Oct 2009 17:44:04 +0200 To: freebsd-emulation@FreeBSD.org Message-ID: <20091017154404.GA80599@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: how to test for linux base version? (googleearth) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2009 15:45:25 -0000 I just got reminded to add a linux base version check to astro/google-earth (It now needs recent linux libstdc++.so.6 with GLIBCXX_3.4.9 that only is in f9 or f10, you can do objdump -T /compat/linux/usr/lib/libstdc++.so.6 |grep 'ABS.*GLIBCXX' to check) - and was wondering how to best check for that in a port. This is what I came up with so far: Index: Makefile =================================================================== RCS file: /home/pcvs/ports/astro/google-earth/Makefile,v retrieving revision 1.35 diff -u -p -r1.35 Makefile --- Makefile 24 Sep 2009 21:01:36 -0000 1.35 +++ Makefile 17 Oct 2009 15:32:22 -0000 @@ -38,6 +38,14 @@ RUN_DEPENDS+= ${LINUXBASE}/usr/lib/libGL USE_LINUX_APPS+= dri .endif +.if (${OSVERSION} < 800076 && \ + !defined(OVERRIDE_LINUX_BASE_PORT)) || \ + (defined(OVERRIDE_LINUX_BASE_PORT) && \ + !(${OVERRIDE_LINUX_BASE_PORT} == f10) || \ + ${OVERRIDE_LINUX_BASE_PORT} == f9) +IGNORE= needs at least f9 Linux base +.endif + do-extract: @${MKDIR} ${WRKSRC} @${CP} ${DISTDIR}/${DIST_SUBDIR}/${DISTFILES} ${WRKSRC} Anyone have a better idea? :) Thanx, Juergen