From owner-freebsd-emulation@FreeBSD.ORG Sun Dec 14 07:42:38 2008 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 966CF1065672 for ; Sun, 14 Dec 2008 07:42:38 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from misav09.sasknet.sk.ca (misav09.sasknet.sk.ca [142.165.20.173]) by mx1.freebsd.org (Postfix) with ESMTP id 489B48FC14 for ; Sun, 14 Dec 2008 07:42:38 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from bgmpomr2.sasknet.sk.ca ([142.165.72.23]) by misav09 with InterScan Messaging Security Suite; Sun, 14 Dec 2008 01:12:36 -0600 Received: from server.hurd.local (adsl-76-202-204-46.dsl.lsan03.sbcglobal.net [76.202.204.46]) by bgmpomr2.sasknet.sk.ca (SaskTel eMessaging Service) with ESMTPA id <0KBU0056HUOZPG50@bgmpomr2.sasknet.sk.ca> for freebsd-emulation@freebsd.org; Sun, 14 Dec 2008 01:12:36 -0600 (CST) Date: Sat, 13 Dec 2008 23:12:35 -0800 From: Stephen Hurd To: freebsd-emulation@freebsd.org Message-id: <4944B1E3.1040208@sasktel.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.18) Gecko/20081204 SeaMonkey/1.1.13 Subject: BSDulator? 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, 14 Dec 2008 07:42:38 -0000 Rather than build and maintain a cross toolchain to build Linux binaries, it was much simpler to merely install emulators/linux_dist-gentoo-stage3. Since I also build OpenBSD and NetBSD binaries, the obvious question came to mind "Why does FreeBSD not have BSDulators?" A cursory poke around suggests that it should be relatively simple to do since the ABIs between the BSDs are generally a lot closer to each other than the ABIs between FreeBSD and Linux. Has anyone done any work in this area, and if not, does anyone have any pointers regarding how to get started on this? From owner-freebsd-emulation@FreeBSD.ORG Mon Dec 15 11:06:50 2008 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 C110D106567E for ; Mon, 15 Dec 2008 11:06:50 +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 B368F8FC2C for ; Mon, 15 Dec 2008 11:06:50 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mBFB6oiT004298 for ; Mon, 15 Dec 2008 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 mBFB6omw004294 for freebsd-emulation@FreeBSD.org; Mon, 15 Dec 2008 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 15 Dec 2008 11:06:50 GMT Message-Id: <200812151106.mBFB6omw004294@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, 15 Dec 2008 11:06:50 -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/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 ports/121800 emulation x11-toolkits/linux-openmotif - OpenMotif upgrade to 2. o kern/97326 emulation [linux] file descriptor leakage in linux emulation o ports/91318 emulation [fix] graphics/linux_dri: works on amd64 too o kern/91293 emulation [svr4] [patch] *Experimental* Update to the SVR4 emula 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/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 14 problems total. From owner-freebsd-emulation@FreeBSD.ORG Thu Dec 18 23:21:58 2008 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 573E01065670 for ; Thu, 18 Dec 2008 23:21:58 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id B7C288FC17 for ; Thu, 18 Dec 2008 23:21:57 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id 6EB87191A3D; Fri, 19 Dec 2008 00:21:55 +0100 (CET) Received: from saturn.kn-bremen.de (noident@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id mBINHP6i019954; Fri, 19 Dec 2008 00:17:25 +0100 (CET) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id mBINHOA3019953; Fri, 19 Dec 2008 00:17:24 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Fri, 19 Dec 2008 00:17:24 +0100 To: freebsd-emulation@FreeBSD.org, qemu-devel@nongnu.org Message-ID: <20081218231724.GA17338@saturn.kn-bremen.de> Mail-Followup-To: freebsd-emulation@FreeBSD.org, qemu-devel@nongnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: testing qemu svn r6082 on FreeBSD - virtio-net, hpet, vmmouse/vga, got bsd-user to build, and an updated version of the FreeBSD -clock dynticks patch 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, 18 Dec 2008 23:21:58 -0000 Hi! I have made another experimental FreeBSD qemu-devel port update, http://people.freebsd.org/~nox/qemu/qemu-devel-20081218.patch and can report that the new aio code, hpet and virtio-net all seem to work so far at least for the two guests I tried: sidux-2008-04-pontos-pre1-kde-lite-i386-200812141731.iso and 7.1-RC1-i386-dvd1.iso (tho both only in livecd resp. livefs i.e. fixit->cdrom mode.) Also with _this_ sidux iso even vmmouse works with cirrus emulation (and userland kqemu), the earlier vmmouse breakage I saw was in fact due to a bug in sidux. (it also wasn't enabled by default there for cirrus before.) I also was able to run this sidux iso with vmware vga emulation after disabling HW_MOUSE_ACCEL in my version of qemu/hw/vmware_vga.c, otherwise keeping the same patch as posted before. (With HW_MOUSE_ACCEL enabled my host mouse cursor still disappeared completely as soon as the guest xserver started, and either the guest hung soon after that too or I didn't wait long enough.) vmmouse as well as the vmware vga emulation itself still don't work with -kernel-kqemu tho, but I've since been told this is a known problem (something to do with userspace pio.) Oh and usb still is slow at least with sidux guests, no change there... Now bsd-user - I have no sparc64 guest, but the following patches got it to at least build on FreeBSD 6.3/i386 and 7.1pre/amd64: (the -Wl,-shared hack in qemu/Makefile.target causes the resulting binary not to start and if I try qemu's i386.ld I get a link error with libm iirc, so I guess at least the i386 case needs more work before it can actually work...) Index: qemu/cpu-exec.c @@ -1158,6 +1158,12 @@ # define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip)) # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno) # define ERROR_sig(context) ((context)->uc_mcontext->es.err) +#elif defined(__FreeBSD__) +# 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) #else # define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP]) # define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO]) @@ -1168,7 +1174,11 @@ void *puc) { siginfo_t *info = pinfo; +#ifdef __FreeBSD__ + ucontext_t *uc = puc; +#else struct ucontext *uc = puc; +#endif unsigned long pc; int trapno; @@ -1194,6 +1204,12 @@ #define QEMU_UC_MCONTEXT_GREGS(uc, reg) (uc)->uc_mcontext.__gregs[(reg)] #define QEMU_UC_MACHINE_PC(uc) _UC_MACHINE_PC(uc) +#elif defined(__FreeBSD__) +# include + +# define RIP_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) #else #define QEMU_UC_MCONTEXT_GREGS(uc, reg) (uc)->uc_mcontext.gregs[(reg)] #define QEMU_UC_MACHINE_PC(uc) QEMU_UC_MCONTEXT_GREGS(uc, REG_RIP) @@ -1204,17 +1220,25 @@ { siginfo_t *info = pinfo; unsigned long pc; -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__FreeBSD__) ucontext_t *uc = puc; #else struct ucontext *uc = puc; #endif +#ifdef __FreeBSD__ + pc = RIP_sig(uc); + return handle_cpu_signal(pc, (unsigned long)info->si_addr, + TRAP_sig(uc) == 0xe ? + (ERROR_sig(uc) >> 1) & 1 : 0, + &uc->uc_sigmask, puc); +#else pc = QEMU_UC_MACHINE_PC(uc); return handle_cpu_signal(pc, (unsigned long)info->si_addr, QEMU_UC_MCONTEXT_GREGS(uc, REG_TRAPNO) == 0xe ? (QEMU_UC_MCONTEXT_GREGS(uc, REG_ERR) >> 1) & 1 : 0, &uc->uc_sigmask, puc); +#endif } #elif defined(__powerpc__) Index: qemu/Makefile.target @@ -472,7 +472,7 @@ # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this # is the simplest way to make it self virtualizable! -LDFLAGS+=-Wl,-shared +#LDFLAGS+=-Wl,-shared endif endif Index: qemu/x86_64.ld @@ -2,7 +2,7 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_ARCH(i386:x86-64) ENTRY(_start) -SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); +SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); SECTIONS { /* Read-only sections, merged into text segment: */ @@ -59,8 +59,6 @@ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000); @@ -86,8 +84,8 @@ .data1 : { *(.data1) } .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } .dynamic : { *(.dynamic) } .ctors : { And finally the updated dynticks patch: Index: qemu/configure @@ -1025,11 +1025,26 @@ rt=yes fi +########################################## +# posix timer probe +cat > $TMPC < +int main(void) { timer_create(CLOCK_REALTIME, (struct sigevent *)NULL, (timer_t *)NULL); return 0; } +EOF +posixtimer=no +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + posixtimer=yes +elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt 2> /dev/null ; then + posixtimer=yes + rt=yes +fi + if test "$rt" = "yes" ; then # Hack, we should have a general purpose LIBS for this sort of thing AIOLIBS="$AIOLIBS -lrt" fi + if test "$mingw32" = "yes" ; then if test -z "$prefix" ; then prefix="c:\\\\Program Files\\\\Qemu" @@ -1403,6 +1418,9 @@ echo "#define HAVE_FDT 1" >> $config_h echo "FDT_LIBS=-lfdt" >> $config_mak fi +if test "$posixtimer" = "yes" ; then + echo "#define HAVE_POSIX_TIMER 1" >> $config_h +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then Index: qemu/vl.c @@ -918,12 +918,16 @@ static int unix_start_timer(struct qemu_alarm_timer *t); static void unix_stop_timer(struct qemu_alarm_timer *t); -#ifdef __linux__ +#ifdef HAVE_POSIX_TIMER static int dynticks_start_timer(struct qemu_alarm_timer *t); static void dynticks_stop_timer(struct qemu_alarm_timer *t); static void dynticks_rearm_timer(struct qemu_alarm_timer *t); +#endif + +#ifdef __linux__ + static int hpet_start_timer(struct qemu_alarm_timer *t); static void hpet_stop_timer(struct qemu_alarm_timer *t); @@ -1001,9 +1005,11 @@ static struct qemu_alarm_timer alarm_timers[] = { #ifndef _WIN32 -#ifdef __linux__ +#ifdef HAVE_POSIX_TIMER {"dynticks", ALARM_FLAG_DYNTICKS, dynticks_start_timer, dynticks_stop_timer, dynticks_rearm_timer, NULL}, +#endif +#ifdef __linux__ /* HPET - if available - is preferred */ {"hpet", 0, hpet_start_timer, hpet_stop_timer, NULL, NULL}, /* ...otherwise try RTC */ @@ -1361,7 +1367,7 @@ return delta; } -#if defined(__linux__) || defined(_WIN32) +#if defined(HAVE_POSIX_TIMER) || defined(_WIN32) static uint64_t qemu_next_deadline_dyntick(void) { int64_t delta; @@ -1506,6 +1512,10 @@ close(rtc_fd); } +#endif /* defined(__linux__) */ + +#ifdef HAVE_POSIX_TIMER + static int dynticks_start_timer(struct qemu_alarm_timer *t) { struct sigevent ev; @@ -1577,7 +1587,7 @@ } } -#endif /* defined(__linux__) */ +#endif /* defined(HAVE_POSIX_TIMER) */ static int unix_start_timer(struct qemu_alarm_timer *t) { Thanx, Juergen From owner-freebsd-emulation@FreeBSD.ORG Sat Dec 20 20:45:00 2008 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 E37011065674 for ; Sat, 20 Dec 2008 20:45:00 +0000 (UTC) (envelope-from eagletree@hughes.net) Received: from smtprelay.b.hostedemail.com (smtprelay0100.b.hostedemail.com [64.98.42.100]) by mx1.freebsd.org (Postfix) with ESMTP id 9CFCD8FC0C for ; Sat, 20 Dec 2008 20:45:00 +0000 (UTC) (envelope-from eagletree@hughes.net) Received: from smtprelay.b.hostedemail.com (b-bigip1 [10.5.19.254]) by smtpgrave05.b.hostedemail.com (Postfix) with ESMTP id 4E3BC3C2BFC7 for ; Sat, 20 Dec 2008 20:27:17 +0000 (UTC) Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay03.b.hostedemail.com (Postfix) with SMTP id 38B401E79DBE for ; Sat, 20 Dec 2008 20:27:16 +0000 (UTC) X-SpamScore: 1 X-Spam-Summary: 2, 0, 0, ed895223952b6354, 944facfeb153b4f0, eagletree@hughes.net, freebsd-emulation@freebsd.org, RULES_HIT:355:379:541:564:945:966:973:988:989:1260:1261:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1766:1792:2196:2198:2199:2200:2379:2393:2553:2559:2562:2731:3353:3865:3866:3867:3868:3869:3870:3871:3872:3874:3876:3877:4250:4385:5007:6114:6119:6248:7652:7903:7974:8501:9010, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:, MSBL:none, DNSBL:none Received: from [192.168.0.3] (dpc6744118153.direcpc.com [67.44.118.153]) (Authenticated sender: eagletree@hughes.net) by omf05.b.hostedemail.com (Postfix) with ESMTP for ; Sat, 20 Dec 2008 20:27:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v753) Content-Transfer-Encoding: 7bit Message-Id: <68D93E20-AA47-4A87-B85E-716DC59499CC@hughes.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-emulation@freebsd.org From: Chris Date: Sat, 20 Dec 2008 12:27:01 -0800 X-Mailer: Apple Mail (2.753) X-session-marker: 6561676C6574726565406875676865732E6E6574 Subject: fam/gamin incompatibility 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, 20 Dec 2008 20:45:01 -0000 Hi, I apologize in advance for hitting a development list but someone on questions suggested this is the only list which could perhaps provide the answer. I'm trying to use linux compat to run an intuit (non-open-source) daemon required to make quickbooks work on Linux. I was attempting this on FreeBSD as I've never had a linux server in my net to date and was hoping to integrate the functionality into my existing FreeBSD servers. I have compat_linux set up with linux_base_fc7 port, the kern.fallback_elf_brand set to 3. compat.linux.osrelease is 2.6.16. All seems to be in order with the exception of it's use of the fam library (libfam.so) which was not found. I've attempted to use a linux fedora 9 version of the latest gamin within compatibility mode and the gam_server is unable to run because of inotify not implemented. I installed the port for FreeBSD and attempted to run the gam_server natively hoping that the linux libfam.so.0 would operate with it. The application is unable to open the socket when run. The port doesn't create directly into /tmp but into /tmp/fam it appears. Lastly I'd cluelessly tried to use the native library on the compat side which I'm assuming should never work and of course didn't due to an ABI error. Am I up against a hopeless incompatibility here or is there a way to implement the native library while not having the source for the daemon? I realize the answer may be to bite the bullet and put up a linux server. Please reply all as I'm not subscribed to the emulation list. Thanks and again sorry for bothering if this is really an off-topic. From owner-freebsd-emulation@FreeBSD.ORG Sat Dec 20 21:21:26 2008 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 6D20D1065678 for ; Sat, 20 Dec 2008 21:21:26 +0000 (UTC) (envelope-from blauwirbel@gmail.com) Received: from mail-bw0-f19.google.com (mail-bw0-f19.google.com [209.85.218.19]) by mx1.freebsd.org (Postfix) with ESMTP id BBB7F8FC0C for ; Sat, 20 Dec 2008 21:21:25 +0000 (UTC) (envelope-from blauwirbel@gmail.com) Received: by bwz12 with SMTP id 12so4270019bwz.19 for ; Sat, 20 Dec 2008 13:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=etJJB2pD7czcpbqguBccCgXhwo2RB/ACcFgJL1UXl6A=; b=TPMVK6Ba33z/XRKceCmr9XAVRUl3Rl2R3/bPJy0wi1KjwIyXhBZuxQ5zEWW+c+WFZy PkBKs7UNgNv+SPVcR+JWbSXa928CwJ1NTCEMdEFBQyCORNg5O8MFFn35KjIR0PybLlnq jI7J4Cvt58xAVqE8abZIEUr+Nkda/Y1yM3LeU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eqj3fg5KWyYCxIJLePsnG/83pqaaroI9oDzHQ4u2NsPNvEHfJkLxJ0tTKYDqfsRL+G ya0iLjEzM/eb/HlpSy6elHueRIz/8i65dgRXKY5S0AAR8iQO+T5z9xwzJfbfI8daPvvh /pqZy4Oo7WUJKvQfa02KW4O/BBjud3pRnCxQ0= Received: by 10.223.111.205 with SMTP id t13mr3905679fap.62.1229808084252; Sat, 20 Dec 2008 13:21:24 -0800 (PST) Received: by 10.223.126.84 with HTTP; Sat, 20 Dec 2008 13:21:19 -0800 (PST) Message-ID: Date: Sat, 20 Dec 2008 23:21:19 +0200 From: "Blue Swirl" To: qemu-devel@nongnu.org, freebsd-emulation@freebsd.org In-Reply-To: <20081218231724.GA17338@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081218231724.GA17338@saturn.kn-bremen.de> Cc: Subject: Re: [Qemu-devel] testing qemu svn r6082 on FreeBSD - virtio-net, hpet, vmmouse/vga, got bsd-user to build, and an updated version of the FreeBSD -clock dynticks patch 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, 20 Dec 2008 21:21:26 -0000 On 12/19/08, Juergen Lock wrote: > +#elif defined(__FreeBSD__) > +# include > + > +# define RIP_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) > #else > #define QEMU_UC_MCONTEXT_GREGS(uc, reg) (uc)->uc_mcontext.gregs[(reg)] > #define QEMU_UC_MACHINE_PC(uc) QEMU_UC_MCONTEXT_GREGS(uc, REG_RIP) > +#ifdef __FreeBSD__ > + pc = RIP_sig(uc); > + return handle_cpu_signal(pc, (unsigned long)info->si_addr, > + TRAP_sig(uc) == 0xe ? > + (ERROR_sig(uc) >> 1) & 1 : 0, > + &uc->uc_sigmask, puc); > +#else > pc = QEMU_UC_MACHINE_PC(uc); > return handle_cpu_signal(pc, (unsigned long)info->si_addr, > QEMU_UC_MCONTEXT_GREGS(uc, REG_TRAPNO) == 0xe ? > (QEMU_UC_MCONTEXT_GREGS(uc, REG_ERR) >> 1) & 1 : 0, > &uc->uc_sigmask, puc); > +#endif The idea here was that all OS define macros with same names so that the code below does not get any more complex. Maybe the GREGS macro was too generic, and should be replaced with one that only returns the trap and error values. > And finally the updated dynticks patch: This looks OK, please submit separately. From owner-freebsd-emulation@FreeBSD.ORG Sat Dec 20 23:57:44 2008 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 97BC01065670 for ; Sat, 20 Dec 2008 23:57:44 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.freebsd.org (Postfix) with ESMTP id 247F98FC13 for ; Sat, 20 Dec 2008 23:57:43 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: by gwyn.kn-bremen.de (Postfix, from userid 10) id 7E9BF1920DE; Sun, 21 Dec 2008 00:57:41 +0100 (CET) Received: from saturn.kn-bremen.de (noident@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id mBKNjCDf055347; Sun, 21 Dec 2008 00:45:12 +0100 (CET) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id mBKNjCUm055346; Sun, 21 Dec 2008 00:45:12 +0100 (CET) (envelope-from nox) Date: Sun, 21 Dec 2008 00:45:12 +0100 (CET) From: Juergen Lock Message-Id: <200812202345.mBKNjCUm055346@saturn.kn-bremen.de> To: blauwirbel@gmail.com X-Newsgroups: local.list.freebsd.emulation In-Reply-To: References: <20081218231724.GA17338@saturn.kn-bremen.de> Organization: home Cc: freebsd-emulation@freebsd.org, qemu-devel@nongnu.org Subject: Re: [Qemu-devel] testing qemu svn r6082 on FreeBSD - virtio-net, hpet, vmmouse/vga, got bsd-user to build, and an updated version of the FreeBSD -clock dynticks patch 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, 20 Dec 2008 23:57:44 -0000 In article you write: >On 12/19/08, Juergen Lock wrote: >> +#elif defined(__FreeBSD__) >> +# include >> + >> +# define RIP_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) >> #else >> #define QEMU_UC_MCONTEXT_GREGS(uc, reg) (uc)->uc_mcontext.gregs[(reg)] >> #define QEMU_UC_MACHINE_PC(uc) QEMU_UC_MCONTEXT_GREGS(uc, REG_RIP) > >> +#ifdef __FreeBSD__ >> + pc = RIP_sig(uc); >> + return handle_cpu_signal(pc, (unsigned long)info->si_addr, >> + TRAP_sig(uc) == 0xe ? >> + (ERROR_sig(uc) >> 1) & 1 : 0, >> + &uc->uc_sigmask, puc); >> +#else >> pc = QEMU_UC_MACHINE_PC(uc); >> return handle_cpu_signal(pc, (unsigned long)info->si_addr, >> QEMU_UC_MCONTEXT_GREGS(uc, REG_TRAPNO) == 0xe ? >> (QEMU_UC_MCONTEXT_GREGS(uc, REG_ERR) >> 1) & 1 : 0, >> &uc->uc_sigmask, puc); >> +#endif > >The idea here was that all OS define macros with same names so that >the code below does not get any more complex. Maybe the GREGS macro >was too generic, and should be replaced with one that only returns the >trap and error values. > Yeah I was too lazy to figure out the preprocessor magic needed to get the GREGS way working so I simply reused the macros from the i386 case. :) >> And finally the updated dynticks patch: > >This looks OK, please submit separately. OK will do. Thanx, Juergen