From owner-freebsd-emulation@FreeBSD.ORG Sun Oct 7 19:55:12 2007 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 93CE916A474 for ; Sun, 7 Oct 2007 19:55:12 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.kuban.ru (mail.kuban.ru [62.183.66.246]) by mx1.freebsd.org (Postfix) with ESMTP id 31CB013C459 for ; Sun, 7 Oct 2007 19:55:10 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from bsam.ru ([85.172.12.42]) by mail.kuban.ru (8.9.1/8.9.1) with ESMTP id l97JsiWI002927; Sun, 7 Oct 2007 23:54:58 +0400 (MSD) Received: (from bsam@localhost) by bsam.ru (8.14.1/8.14.1/Submit) id l97JvNXm001886; Sun, 7 Oct 2007 23:57:23 +0400 (MSD) (envelope-from bsam@ipt.ru) X-Authentication-Warning: bsam.ru: bsam set sender to bsam@ipt.ru using -f To: Stefan Lambrev References: <46F37ABB.9030109@moneybookers.com> <21889306@srv.sem.ipt.ru> <20070923112840.S97351@ns1.as.pvp.se> <09374497@bs1.sp34.ru> <46F91656.30003@moneybookers.com> <41384111@bsam.ru> <4705F78C.5000307@moneybookers.com> <10974197@serv3.int.kfs.ru> <47063C03.7010304@moneybookers.com> <47063F04.9000306@moneybookers.com> From: Boris Samorodov Date: Sun, 07 Oct 2007 23:57:23 +0400 In-Reply-To: <47063F04.9000306@moneybookers.com> (Stefan Lambrev's message of "Fri\, 05 Oct 2007 16\:41\:24 +0300") Message-ID: <43108508@bsam.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@freebsd.org Subject: Re: linuxolator problem on i386 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, 07 Oct 2007 19:55:12 -0000 On Fri, 05 Oct 2007 16:41:24 +0300 Stefan Lambrev wrote: > >>> Btw my skype is installed WITH_NVIDIA_GL=true, if this matter :) > >>> > >> > >> Aha, that may be the difference though. Can you test without this > >> option? > > Unfortunately it's not that easy :( The skype port auto detect that > > I have nvidia-drivers installed. Are you sure? Maybe it's an OPTION that you had set up? > > I'll try to make skype work with linux_dri, and let you know. > I just tried the combination of linux_dri, fc7 and skype and no more > core dumps :) OK. I think that the same is for fc6. > The problem seems to be when nvidia-driver is used instead of linux_dri. Which version of nvidia-driver do you use? > What's the next step? Update the skype port to always use linux_dri? Since fc4 is the default and works well there is no need to do it right now. WBR -- bsam From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 00:14:49 2007 Return-Path: Delivered-To: emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01A2116A418 for ; Mon, 8 Oct 2007 00:14:49 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.kuban.ru (mail.kuban.ru [62.183.66.246]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA9213C481 for ; Mon, 8 Oct 2007 00:14:47 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from bsam.ru ([85.172.12.42]) by mail.kuban.ru (8.9.1/8.9.1) with ESMTP id l97Nm3Ta039796 for ; Mon, 8 Oct 2007 03:48:15 +0400 (MSD) Received: (from bsam@localhost) by bsam.ru (8.14.1/8.14.1/Submit) id l97NojRH002828; Mon, 8 Oct 2007 03:50:45 +0400 (MSD) (envelope-from bsam@ipt.ru) X-Authentication-Warning: bsam.ru: bsam set sender to bsam@ipt.ru using -f To: emulation@FreeBSD.org From: Boris Samorodov User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) Date: Mon, 08 Oct 2007 03:50:45 +0400 Message-ID: <41348250@bsam.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: HEADS UP: Fedora 7 is no more Core 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, 08 Oct 2007 00:14:49 -0000 Hi All, since version 7 Fedora is no more Core, it's Fedora 7. The corresponding port was renamed from linux_base-fc7 to linux_base-f7. WBR -- bsam From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 08:58:00 2007 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 EC6A716A418; Mon, 8 Oct 2007 08:57:58 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BAB8F13C461; Mon, 8 Oct 2007 08:57:58 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (remko@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l988vwTh076114; Mon, 8 Oct 2007 08:57:58 GMT (envelope-from remko@freefall.freebsd.org) Received: (from remko@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l988vwDh076110; Mon, 8 Oct 2007 08:57:58 GMT (envelope-from remko) Date: Mon, 8 Oct 2007 08:57:58 GMT Message-Id: <200710080857.l988vwDh076110@freefall.freebsd.org> To: remko@FreeBSD.org, rdivacky@FreeBSD.org, freebsd-emulation@FreeBSD.org From: remko@FreeBSD.org Cc: Subject: Re: kern/117010: [linuxolator] linux_getdents() get something like buffer overflow or else 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, 08 Oct 2007 08:58:01 -0000 Synopsis: [linuxolator] linux_getdents() get something like buffer overflow or else Responsible-Changed-From-To: rdivacky->freebsd-emulation Responsible-Changed-By: remko Responsible-Changed-When: Mon Oct 8 08:57:40 UTC 2007 Responsible-Changed-Why: Pav told me this could better go to emulation, make it happen http://www.freebsd.org/cgi/query-pr.cgi?pr=117010 From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 11:08:18 2007 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 3CC0D16A417 for ; Mon, 8 Oct 2007 11:08:17 +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 59EE713C4B5 for ; Mon, 8 Oct 2007 11:08:17 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l98B8HtA083241 for ; Mon, 8 Oct 2007 11:08:17 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l98B8GCD083237 for freebsd-emulation@FreeBSD.org; Mon, 8 Oct 2007 11:08:16 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Oct 2007 11:08:16 GMT Message-Id: <200710081108.l98B8GCD083237@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 you 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, 08 Oct 2007 11:08:18 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/117010 emulation [linuxolator] linux_getdents() get something like buff 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/21463 emulation [linux] Linux compatability mode should not allow setu o kern/97326 emulation [linux] file descriptor leakage in linux emulation o kern/102956 emulation [linux] [patch] Add partial support for SO_PEERCRED in 3 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/11165 emulation [ibcs2] IBCS2 doesn't work correctly with PID_MAX 9999 o kern/29698 emulation [linux] [patch] linux ipcs doesn'work o kern/39201 emulation [linux] [patch] ptrace(2) and rfork(RFLINUXTHPN) confu o kern/41543 emulation [patch] feature request: easier wine/w23 support o kern/55835 emulation [linux] [patch] Linux IPC emulation missing SETALL sys a kern/72920 emulation [linux]: path "prefixing" is not done on unix domain s o kern/73777 emulation [linux] [patch] linux emulation: root dir special hand o kern/91293 emulation [svr4] [patch] *Experimental* Update to the SVR4 emula 8 problems total. From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 19:02:35 2007 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 C6C0F16A418 for ; Mon, 8 Oct 2007 19:02:35 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.191]) by mx1.freebsd.org (Postfix) with ESMTP id 5BADB13C45B for ; Mon, 8 Oct 2007 19:02:35 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: by mu-out-0910.google.com with SMTP id w9so1698653mue for ; Mon, 08 Oct 2007 12:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:organization:to:subject:user-agent:mime-version:content-disposition:date:cc:content-type:content-transfer-encoding:message-id; bh=W5EGiVnrrBa8X0/UqP9sQ4gOlQC2ZF8saxCySvX5wfw=; b=C1SBeIPS5/7JNQUUa/KRH1wuvN1A+JyDxdFeeV4eCY2sqKySv5Njy0BjQKukcQRe6HW8tI6nDZP/v6kkeisOFmYNaii02hFkfa9XBUyV8Cd9uBq0lM1CvDiCOR7cHlj36+a9/skwa31WEZBXxxH3gI3rgRUB6AZ57ZlPBjbR4nU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:organization:to:subject:user-agent:mime-version:content-disposition:date:cc:content-type:content-transfer-encoding:message-id; b=is3xyRMv1Jhm1qZg8kVvG3W78ZramcJYGwAnu8OibgGdMO77IMAAFsmr0asmhQrn/HmD1uLtqIDUNsuPkCrtfzL+ZLv8onVSUmizVOfbLlZChPLaIDxNSaaoIrX/s9yXEMJWQ+3R1hm2kPnBN6ZKLcNK50ssN262/7CbAiMQdEY= Received: by 10.82.111.8 with SMTP id j8mr23377265buc.1191868567750; Mon, 08 Oct 2007 11:36:07 -0700 (PDT) Received: from mdontu-l.dsd.ro ( [217.156.83.1]) by mx.google.com with ESMTPS id u9sm13618922muf.2007.10.08.11.36.06 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2007 11:36:06 -0700 (PDT) From: Mihai =?utf-8?q?Don=C8=9Bu?= Organization: Home To: freebsd-questions@freebsd.org User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Disposition: inline Date: Mon, 8 Oct 2007 21:35:57 +0300 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <200710082135.58099.mihai.dontu@gmail.com> Cc: freebsd-emulation@freebsd.org Subject: amd64_set_gsbase() 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, 08 Oct 2007 19:02:35 -0000 Hi, I have a "small" amd64 program that makes havy use of LDT (%GS to be more specific). The trouble is, in a multithreaded environment, the selector value gets lost (or reset?). The code *always* segfaults with this stack: 4 LWP 100126 0x0000000800dec07c in select () from /lib/libc.so.6 * 3 Thread 0x517000 (runnable) 0x000000080055cfbc in ?? () 2 Thread 0x517400 (LWP 100125) 0x0000000800c0d85c in pthread_testcancel () from /lib/libpthread.so.2 1 Thread 0x517800 (runnable) 0x0000000800d5d000 in makecontext () from /lib/libc.so.6 at this instruction: 0x000000080055cfbc: mov %gs:0x10,%r11 (gdb) p $gs $1 = 0 I've been reading on the net something about the kernel not preserving the GS across syscalls (or stmh). Is this true? and if so, is there a known workaround? I'm on a FreeBSD 6.2-STABLE-200706 (AMD64) machine. Thanks, -- Mihai DonÈ›u From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 19:37:18 2007 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 1004316A418 for ; Mon, 8 Oct 2007 19:37:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.freebsd.org (Postfix) with ESMTP id A38BE13C4BA for ; Mon, 8 Oct 2007 19:37:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.6/8.13.6) with ESMTP id l98JbBKg001756; Mon, 8 Oct 2007 15:37:11 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-emulation@FreeBSD.org Date: Mon, 8 Oct 2007 15:37:01 -0400 User-Agent: KMail/1.6.2 References: <200710082135.58099.mihai.dontu@gmail.com> In-Reply-To: <200710082135.58099.mihai.dontu@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <200710081537.03836.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.90.2/4507/Mon Oct 8 14:42:59 2007 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: freebsd-questions@FreeBSD.org Subject: Re: amd64_set_gsbase() 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, 08 Oct 2007 19:37:18 -0000 On Monday 08 October 2007 02:35 pm, Mihai DonÈ›u wrote: > Hi, > > I have a "small" amd64 program that makes havy use of LDT (%GS to > be more specific). The trouble is, in a multithreaded environment, > the selector value gets lost (or reset?). > > The code *always* segfaults with this stack: > 4 LWP 100126 0x0000000800dec07c in select () from /lib/libc.so.6 > * 3 Thread 0x517000 (runnable) 0x000000080055cfbc in ?? () > 2 Thread 0x517400 (LWP 100125) 0x0000000800c0d85c in > pthread_testcancel () from /lib/libpthread.so.2 1 Thread 0x517800 > (runnable) 0x0000000800d5d000 in makecontext () from > /lib/libc.so.6 > > at this instruction: > 0x000000080055cfbc: mov %gs:0x10,%r11 > > (gdb) p $gs > $1 = 0 > > I've been reading on the net something about the kernel not > preserving the GS across syscalls (or stmh). Is this true? and if > so, is there a known workaround? > > I'm on a FreeBSD 6.2-STABLE-200706 (AMD64) machine. Yes, you are correct. A short version is "don't do that". A long version goes like this. %fs and %gs are not preserved while context switching on amd64. In fact, you should not use amd64_set_gsbase() directly. If you *really* have to mess up with base addresses, you have to use sysarch(2) syscall, i.e., sysarch(AMD64_SET_GSBASE, args). However, it only changes the base address via MSR, i.e., %gs itself has no meaning. Jung-uk Kim From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 22:01:11 2007 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 9A32F16A469 for ; Mon, 8 Oct 2007 22:01:11 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 2CC4513C44B for ; Mon, 8 Oct 2007 22:01:10 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1084394nfb for ; Mon, 08 Oct 2007 15:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=SVQakLXrswognxq9/qXm/VvVzrdz2Q/BG1yWb2BdyiE=; b=RyxXWNjJyeRIJUwgIeJ4g2qNSCb/cmWKhVQdIrFl6XNWR6DQ9u/nFsGhFpg2WaB6eCa+OslQdI6yAWJ8Wy/KtPvhzEERg6U/MExZNyFAEpfSIlI6gooyn6+nAez015jekUcFPaw2i9+xqn6xKPTSmOh/PzfJgBrPnKowrRJbysw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=uXIHjFfG9bjcFZpGrcFNDB2M07K2+ZiBNly3poFctd9YeOMr5B0VCW7eWftrb7u95fzgvmj94r732gl0zmvtqaZpjxAwAVMz3XMxLzst0EvgAeI5JmicJDmTYVctHEwN8VkkBcI8RXiIVVISQsnUCLySXFVGtIbZNwZj3PPYBh4= Received: by 10.86.76.16 with SMTP id y16mr5439388fga.1191880869281; Mon, 08 Oct 2007 15:01:09 -0700 (PDT) Received: from ?192.168.0.3? ( [77.81.70.38]) by mx.google.com with ESMTPS id b17sm7239712fka.2007.10.08.15.01.06 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2007 15:01:07 -0700 (PDT) From: Mihai =?utf-8?q?Don=C8=9Bu?= Organization: Home To: Jung-uk Kim Date: Tue, 9 Oct 2007 01:00:58 +0300 User-Agent: KMail/1.9.7 References: <200710082135.58099.mihai.dontu@gmail.com> <200710081537.03836.jkim@FreeBSD.org> In-Reply-To: <200710081537.03836.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200710090100.58577.mihai.dontu@gmail.com> Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org Subject: Re: amd64_set_gsbase() 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, 08 Oct 2007 22:01:11 -0000 On Monday 08 October 2007, Jung-uk Kim wrote: > Yes, you are correct. A short version is "don't do that". A long > version goes like this. %fs and %gs are not preserved while context > switching on amd64. But this makes emulation software such as Wine a lost hope, doesn't it? Because Windows apps access the Thread Information Block (TIB) via %gs (%fs on ia32). Anyway, my so called "small" program is actually a Win64 emulator and I need the segment selector to "stay put" across syscalls. It works like a charm on single threaded apps, but as soon as I spawn a thread, all hell breaks loose :) I've managed to come up with something that *kind of* works. It goes like this: void my_handler( int s ) { if ( s == SIGSEGV ) { if ( get_gs() == 0 ) { amd64_set_gsbase(); } else { signal( SIGSEGV, SIG_DFL ); } } } int my_init( void ) { /* alloc TIB memory and initialize */ amd64_set_gsbase( lpTIB ); signal( SIGSEGV, my_handler ); return 0; } but after a series of dlopen()-s, my_handler() is called without %gs being zero and without a valid fault (the handler does not get recalled after signal( SIGSEGV, SIG_DFL ). I'm still working on this aspect ... > In fact, you should not use amd64_set_gsbase() > directly. If you *really* have to mess up with base addresses, you > have to use sysarch(2) syscall, i.e., sysarch(AMD64_SET_GSBASE, > args). I found this: /usr/src/lib/libc/amd64/sys/amd64_set_gsbase.c:32 " int amd64_set_gsbase(void *addr) { return (sysarch(AMD64_SET_GSBASE, &addr)); } " and this (man 2 sysarch()): "The sysarch() system call should never be called directly by user programs. Instead, they should access its functions using the architecture-dependent library." Who am I suppose to believe? :) > However, it only changes the base address via MSR, i.e., %gs > itself has no meaning. Maybe, but the selector loaded in %gs *does* have meaning. Anyway, the thing is I _have_ to make this work. I'll keep you posted ;) -- Mihai DonÈ›u From owner-freebsd-emulation@FreeBSD.ORG Mon Oct 8 22:41:44 2007 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 934A116A418; Mon, 8 Oct 2007 22:41:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4DBEF13C468; Mon, 8 Oct 2007 22:41:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.6/8.13.6) with ESMTP id l98MfhsD013269; Mon, 8 Oct 2007 18:41:43 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-emulation@FreeBSD.org Date: Mon, 8 Oct 2007 18:41:34 -0400 User-Agent: KMail/1.6.2 References: <200710082135.58099.mihai.dontu@gmail.com> <200710081537.03836.jkim@FreeBSD.org> <200710090100.58577.mihai.dontu@gmail.com> In-Reply-To: <200710090100.58577.mihai.dontu@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <200710081841.35968.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.90.2/4508/Mon Oct 8 17:22:13 2007 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: freebsd-questions@FreeBSD.org Subject: Re: amd64_set_gsbase() 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, 08 Oct 2007 22:41:44 -0000 On Monday 08 October 2007 06:00 pm, Mihai DonÈ›u wrote: > On Monday 08 October 2007, Jung-uk Kim wrote: > > Yes, you are correct. A short version is "don't do that". A > > long version goes like this. %fs and %gs are not preserved while > > context switching on amd64. > > But this makes emulation software such as Wine a lost hope, doesn't > it? Because Windows apps access the Thread Information Block (TIB) > via %gs (%fs on ia32). It was discussed many times on freebsd-emulation@. > Anyway, my so called "small" program is actually a Win64 emulator > and I need the segment selector to "stay put" across syscalls. It > works like a charm on single threaded apps, but as soon as I spawn > a thread, all hell breaks loose :) Yup, that's expected. ;-) > I've managed to come up with something that *kind of* works. It > goes like this: > > void my_handler( int s ) > { > if ( s == SIGSEGV ) { > if ( get_gs() == 0 ) { > amd64_set_gsbase(); > } else { > signal( SIGSEGV, SIG_DFL ); > } > } > } > > int my_init( void ) > { > /* alloc TIB memory and initialize */ > > amd64_set_gsbase( lpTIB ); > signal( SIGSEGV, my_handler ); > > return 0; > } > > but after a series of dlopen()-s, my_handler() is called without > %gs being zero and without a valid fault (the handler does not get > recalled after signal( SIGSEGV, SIG_DFL ). I'm still working on > this aspect ... That does not work, i.e., %gs vs. base address mapping is not preserved on FreeBSD/amd64 as I said. You can probably maintain some mapping table, though. > > In fact, you should not use amd64_set_gsbase() > > directly. If you *really* have to mess up with base addresses, > > you have to use sysarch(2) syscall, i.e., > > sysarch(AMD64_SET_GSBASE, args). > > I found this: /usr/src/lib/libc/amd64/sys/amd64_set_gsbase.c:32 > " > int > amd64_set_gsbase(void *addr) > { > return (sysarch(AMD64_SET_GSBASE, &addr)); > } > " > > and this (man 2 sysarch()): "The sysarch() system call should never > be called directly by user programs. Instead, they should access > its functions using the architecture-dependent library." > > Who am I suppose to believe? :) Sorry, my bad. :-( > > However, it only changes the base address via MSR, i.e., %gs > > itself has no meaning. > > Maybe, but the selector loaded in %gs *does* have meaning. In long mode, we don't really care about segment registers. While implementing TLS for Linuxulator, I had to do the following hack, for example: http://docs.freebsd.org/cgi/mid.cgi?200703300006.l2U06LA1075891 Under Linux and Windows, they do preserve segment registers vs. base addresses mapping for backward compatibility, AFAIK with some performance penalty. Jung-uk Kim > Anyway, the thing is I _have_ to make this work. I'll keep you > posted ;) From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 00:49:02 2007 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 5BD8916A419 for ; Tue, 9 Oct 2007 00:49:02 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id D323213C4BA for ; Tue, 9 Oct 2007 00:49:01 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1112650nfb for ; Mon, 08 Oct 2007 17:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=ZvzvvTYVEGroxDmyzr99TZIKglp8BlDhBjq58r4MEr4=; b=lA+aKUlE2kReL7QZhi+uokJm4PfvKn6EcPjaPJk3gZbjTfHZ1xY7wKBEXpIqmToV6t0kJqnpCocHyEEIiCk+JV1OezJaRs+fEoimKSJwZSeF7GMyZHc/QwyPbOns1586BbF3icgRe7NJdC6XO6T4ca3aFAGsb+8LojaifI9VT/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=Hbwdp2huknyqGtloqAt7FGvtiPrr8Mqo+yPeIcdjj6KBGV91hNgQPoBh3Q1qGsrbu9jZk+XF7j7MTKVAH7XKDCcAO/pv/HyB55inwycy5AuUnpkCqaER/JOsFPP2klxiZjm2XLSABQ8nVicgB31SkUSOI0aTwvgWWULyYqJIMH0= Received: by 10.86.51.2 with SMTP id y2mr5539144fgy.1191890939932; Mon, 08 Oct 2007 17:48:59 -0700 (PDT) Received: from ?192.168.0.3? ( [77.81.70.38]) by mx.google.com with ESMTPS id 28sm7246968fkx.2007.10.08.17.48.58 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2007 17:48:58 -0700 (PDT) From: Mihai =?utf-8?q?Don=C8=9Bu?= Organization: Home To: Jung-uk Kim Date: Tue, 9 Oct 2007 03:48:51 +0300 User-Agent: KMail/1.9.7 References: <200710082135.58099.mihai.dontu@gmail.com> <200710090100.58577.mihai.dontu@gmail.com> <200710081841.35968.jkim@FreeBSD.org> In-Reply-To: <200710081841.35968.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200710090348.52036.mihai.dontu@gmail.com> Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org Subject: Re: amd64_set_gsbase() 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, 09 Oct 2007 00:49:02 -0000 On Tuesday 09 October 2007, Jung-uk Kim wrote: > In long mode, we don't really care about segment registers. While > implementing TLS for Linuxulator, I had to do the following hack, for > example: > > http://docs.freebsd.org/cgi/mid.cgi?200703300006.l2U06LA1075891 > > Under Linux and Windows, they do preserve segment registers vs. base > addresses mapping for backward compatibility, AFAIK with some > performance penalty. Ah! But you are doing your magic _in the kernel_. I don't have this luxury :) I have to do everything in user space (as a normal user) on an out-of-the-box FreeBSD (-stable). I have *one* more question: maybe I don't fully understand the hole BASE thing, but since the FreeBSD kernel does not preserve %gs and %fs, what is the purpose of amd64_set_XXbase()? Thanks, -- Mihai DonÈ›u From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 05:45:08 2007 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 562AC16A417 for ; Tue, 9 Oct 2007 05:45:08 +0000 (UTC) (envelope-from samflanker@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id DDF0E13C44B for ; Tue, 9 Oct 2007 05:45:07 +0000 (UTC) (envelope-from samflanker@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1155447nfb for ; Mon, 08 Oct 2007 22:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=oJUD02EvV1cnYiwkPkxJevopSY4PC8Nw5e2KNqgsq+g=; b=XWF+7VQBneCQav5XYgceMr9mbwNacCAxi9etjbhSHPStos5cGsawdmAAmqvS+eqZ6aQtrWG5GckUcJTr+gFX7eOQm0AUR6NRWBJc2Oa6JyP3cRNtSFsKxnmZJhbRJ1OMRwrlqqagR5l6D7ZFJdUGJoLCMLnj9m1LWInRAoopQP4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=s7mdTB78YlvcHDGjeXDyDE8ZL2SkQtMkkfp8ceZOCCKFc0osYGOoeWg8otYcDBrqkTQC6EF9NYjt+3ZbojrM5WsbL3KL0qyNJO/o1XlXLMpacrrRViapXdJQYwiBOCjv8lxziRhWJEReIHihnrZPwX9ajjcUFPgPAL56BXAQUSA= Received: by 10.86.4.2 with SMTP id 2mr5769967fgd.1191908706581; Mon, 08 Oct 2007 22:45:06 -0700 (PDT) Received: from ?192.168.1.185? ( [213.152.137.35]) by mx.google.com with ESMTPS id u9sm14818735muf.2007.10.08.22.45.04 (version=SSLv3 cipher=RC4-MD5); Mon, 08 Oct 2007 22:45:04 -0700 (PDT) Message-ID: <470B155B.7080900@gmail.com> Date: Tue, 09 Oct 2007 09:44:59 +0400 From: sam User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Roman Divacky References: <20070916205434.GA70997@freebsd.org> <20070917152625.GA507@freebsd.org> <64815375@srv.sem.ipt.ru> <46EF62C5.5090704@gmail.com> <00483937@srv.sem.ipt.ru> <46EF7E05.5040405@gmail.com> <20070918074332.GA30053@freebsd.org> <88000019@srv.sem.ipt.ru> <20070918082119.GA30932@freebsd.org> <89768331@srv.sem.ipt.ru> <20070918111743.GA37861@freebsd.org> In-Reply-To: <20070918111743.GA37861@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Leidinger , freebsd-emulation@freebsd.org Subject: Re: linuxolator problem on i386 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, 09 Oct 2007 05:45:08 -0000 Roman Divacky wrote: > On Tue, Sep 18, 2007 at 12:38:28PM +0400, Boris Samorodov wrote: > >> On Tue, 18 Sep 2007 10:21:19 +0200 Roman Divacky wrote: >> >> >>> so.. to restate facts... >>> >> We are talking about 2.6.16. >> >> >>> 1) the program works ok with fc4 but not with fc6 >>> >> Yes. >> >> (I'm curiuos why with fc4 getdents64() is used but with fc6 >> getdents() does?) >> >> >>> 2) when the directory is moved it works ok >>> >> Yes. And I suppose if some files are deletted the program should >> work. >> >> >>> 3) when my bad patch made getdents() return error the program works ok >>> >> Yes, and this is the same as if delete directory. >> >> >>> is all of this true? >>> >> Yep! Thanks for taking care of it. >> > > ok... please download www.vlakno.cz/~rdivacky/getdents.c and run it in the > problematic directory. then run "ls -a" and compare outputs... > > also.. please tell me the value of the "count" argument to the getdents() syscall > that the program emits and possibly alter the getdents.c to use the same value ;) > > thank you > > roman > > kern/117010 please make tool for testing on this trouble (don`t download full hlds server) /Vladimir Ermakov From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 08:53:03 2007 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 816F116A41B for ; Tue, 9 Oct 2007 08:53:03 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 35D9A13C455 for ; Tue, 9 Oct 2007 08:53:02 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4DD2F668E4B; Tue, 9 Oct 2007 10:53:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a7d+FjGZ1kGC; Tue, 9 Oct 2007 10:52:57 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 08CBF668E43; Tue, 9 Oct 2007 10:52:57 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l998ququ014158; Tue, 9 Oct 2007 10:52:56 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 9 Oct 2007 10:52:56 +0200 From: Roman Divacky To: Mihai Don??u Message-ID: <20071009085256.GA14059@freebsd.org> References: <200710082135.58099.mihai.dontu@gmail.com> <200710090100.58577.mihai.dontu@gmail.com> <200710081841.35968.jkim@FreeBSD.org> <200710090348.52036.mihai.dontu@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200710090348.52036.mihai.dontu@gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org, Jung-uk Kim Subject: Re: amd64_set_gsbase() 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, 09 Oct 2007 08:53:03 -0000 On Tue, Oct 09, 2007 at 03:48:51AM +0300, Mihai Don??u wrote: > On Tuesday 09 October 2007, Jung-uk Kim wrote: > > In long mode, we don't really care about segment registers. While > > implementing TLS for Linuxulator, I had to do the following hack, for > > example: > > > > http://docs.freebsd.org/cgi/mid.cgi?200703300006.l2U06LA1075891 > > > > Under Linux and Windows, they do preserve segment registers vs. base > > addresses mapping for backward compatibility, AFAIK with some > > performance penalty. > > Ah! But you are doing your magic _in the kernel_. I don't have this luxury :) > I have to do everything in user space (as a normal user) on an out-of-the-box > FreeBSD (-stable). just to note things... actually you have the luxury. we have made special hacks to let wine works well (thr_kill2) I see no reason why special support for wine64 in kernel would be left out. just my 2 cents roman From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 12:40:41 2007 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5AD416A417; Tue, 9 Oct 2007 12:40:41 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB2D13C43E; Tue, 9 Oct 2007 12:40:41 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id l99CGuGO071013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Oct 2007 08:16:56 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.14.1/8.14.1/Submit) id l99CGtR7071012; Tue, 9 Oct 2007 08:16:55 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: Alexander Leidinger , freebsd-ports@freebsd.org, emulation@freebsd.org Date: Tue, 9 Oct 2007 08:16:54 -0400 User-Agent: KMail/1.9.6 X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: Subject: Re: The scandalous status of linux 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, 09 Oct 2007 12:40:42 -0000 =If you can not find it, tell emulation@ about your problem. Just a reminder, that SDL-using Linux-executables, which broke on -stable in some time in June, are still broken with the kernel from September 16. A game called "civctp" used to start up and play just fine, but now hangs on start-up -- at least, on amd64. Just tried changing the level of Linux emulation -- still hangs. Although the commercial version of the game was only available to paying customers, the freely available demo version shows the same problem. =Be prepared to do some guided debugging. Checking out the games/civ2demo from the Attic is far easier for a developer to do, than rebuilding a kernel (even once) is for a regular user. -mi From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 13:07:19 2007 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E01C16A417 for ; Tue, 9 Oct 2007 13:07:19 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id CF75313C44B for ; Tue, 9 Oct 2007 13:07:18 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A54F27.dip.t-dialin.net [84.165.79.39]) by redbull.bpaserver.net (Postfix) with ESMTP id AEA1E2E2B9; Tue, 9 Oct 2007 14:51:49 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 05A225B4800; Tue, 9 Oct 2007 14:50:53 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.1/8.13.8/Submit) id l99CoqXc086237; Tue, 9 Oct 2007 14:50:52 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Tue, 09 Oct 2007 14:50:52 +0200 Message-ID: <20071009145052.923n0nxuww40c0ww@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Tue, 09 Oct 2007 14:50:52 +0200 From: Alexander Leidinger To: Mikhail Teterin References: <200710090816.55266@aldan> In-Reply-To: <200710090816.55266@aldan> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-7.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-13.504, required 8, BAYES_00 -15.00, MIME_QP_LONG_LINE 1.40, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: emulation@freebsd.org, freebsd-ports@freebsd.org Subject: Re: The scandalous status of linux 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, 09 Oct 2007 13:07:19 -0000 Quoting Mikhail Teterin (from Tue, 9 Oct =20 2007 08:16:54 -0400): > =3DIf you can not find it, tell emulation@ about your problem. > > Just a reminder, that SDL-using Linux-executables, which broke on -stable = in > some time in June, are still broken with the kernel from September 16. A g= ame > called "civctp" used to start up and play just fine, but now hangs on > start-up -- at least, on amd64. > > Just tried changing the level of Linux emulation -- still hangs. > > Although the commercial version of the game was only available to paying > customers, the freely available demo version shows the same problem. > > =3DBe prepared to do some guided debugging. > > Checking out the games/civ2demo from the Attic is far easier for a develop= er > to do, than rebuilding a kernel (even once) is for a regular user. It's not only about easy/hard, it's also about resources (e.g. a =20 -stable machine and/or time). Bye, Alexander. --=20 "The Computer made me do it." http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137 From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 13:26:47 2007 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3BF16A417; Tue, 9 Oct 2007 13:26:47 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 08A0213C44B; Tue, 9 Oct 2007 13:26:46 +0000 (UTC) (envelope-from mi+kde@aldan.algebra.com) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.1/8.14.1) with ESMTP id l99DQkdo071520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Oct 2007 09:26:46 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by aldan.algebra.com (8.14.1/8.14.1/Submit) id l99DQjpL071519; Tue, 9 Oct 2007 09:26:45 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) From: Mikhail Teterin To: Alexander Leidinger Date: Tue, 9 Oct 2007 09:26:45 -0400 User-Agent: KMail/1.9.6 References: <200710090816.55266@aldan> <20071009145052.923n0nxuww40c0ww@webmail.leidinger.net> In-Reply-To: <20071009145052.923n0nxuww40c0ww@webmail.leidinger.net> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: emulation@freebsd.org, freebsd-ports@freebsd.org Subject: Re: The scandalous status of linux 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, 09 Oct 2007 13:26:47 -0000 On =D7=A6=D7=D4=CF=D2=CF=CB 09 =D6=CF=D7=D4=C5=CE=D8 2007, Alexander Leidin= ger wrote: =3D > Checking out the games/civ2demo from the Attic is far easier for a =3D > developer to do, than rebuilding a kernel (even once) is for a regular =3D > user. =3D=20 =3D It's not only about easy/hard, it's also about resources (e.g. a =9A =3D -stable machine and/or time). Well, if you don't have a -stable machine to test on, how do you do /any/=20 development on -stable? If you need more time -- would you like a formal PR filed on this matter? -mi From owner-freebsd-emulation@FreeBSD.ORG Wed Oct 10 09:25:42 2007 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CDD116A418 for ; Wed, 10 Oct 2007 09:25:42 +0000 (UTC) (envelope-from mrosekofi20@yahoo.dk) Received: from n7.bullet.re3.yahoo.com (n7.bullet.re3.yahoo.com [68.142.237.92]) by mx1.freebsd.org (Postfix) with SMTP id B52A713C465 for ; Wed, 10 Oct 2007 09:25:41 +0000 (UTC) (envelope-from mrosekofi20@yahoo.dk) Received: from [68.142.237.90] by n7.bullet.re3.yahoo.com with NNFMP; 10 Oct 2007 09:12:59 -0000 Received: from [69.147.75.179] by t6.bullet.re3.yahoo.com with NNFMP; 10 Oct 2007 09:12:59 -0000 Received: from [127.0.0.1] by omp100.mail.re1.yahoo.com with NNFMP; 10 Oct 2007 09:12:59 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 353740.29084.bm@omp100.mail.re1.yahoo.com Received: (qmail 41412 invoked by uid 60001); 10 Oct 2007 09:12:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=ymail_nen1; d=yahoo.dk; h=Received:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=XnSu16XbHH5TvwgNR6SC+zUFxmMqiZ+zi4c7jD9QTFAxL2RrnN5A4CvIfET+PduaQNNBvNFpyoGT5Z7aVnBAI/ut89mL10+BJr0kZYGxjCCJ+Nq68IwIUG1vgmK6Omyuexbjojc0V8Cw0UjOJniO685x1c1fmq0Nmke/rrBS6hE=; Received: from [41.210.21.74] by web23308.mail.ird.yahoo.com via HTTP; Wed, 10 Oct 2007 09:12:58 GMT Date: Wed, 10 Oct 2007 09:12:58 +0000 (GMT) From: =?iso-8859-1?q?Miss=20Rose=20Koffi?= To: emulation@freebsd.org MIME-Version: 1.0 Message-ID: <389862.40295.qm@web23308.mail.ird.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: PLEASE DEAR I NEED YOUR ASSIST, I'M ROSE KOFFI(19YS FEMALE)ACCRA-GHANA X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rosekofigh@hotmail.com List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2007 09:25:42 -0000 Jeg har en ny e-mail-adresse!Nu kan du e-maile mig på: mrosekofi20@yahoo.dk PLEASE DEAR I NEED YOUR ASSISTANCE... - Miss Rose Koffi From owner-freebsd-emulation@FreeBSD.ORG Wed Oct 10 13:33:18 2007 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 333C216A46C for ; Wed, 10 Oct 2007 13:33:18 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from thumbler.kulnet.kuleuven.ac.be (thumbler.kulnet.kuleuven.ac.be [134.58.240.45]) by mx1.freebsd.org (Postfix) with ESMTP id C00DC13C469 for ; Wed, 10 Oct 2007 13:33:17 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 200E2139867; Wed, 10 Oct 2007 15:33:16 +0200 (CEST) Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 0717113879F; Wed, 10 Oct 2007 15:33:08 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps02.kuleuven.be (Postfix) with ESMTP id B7A99F3863; Wed, 10 Oct 2007 15:33:07 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.1/8.14.1) with ESMTP id l9ADX7oP004744; Wed, 10 Oct 2007 15:33:07 +0200 (CEST) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: Mihai =?utf-8?q?Don=C8=9Bu?= Date: Wed, 10 Oct 2007 15:33:05 +0200 User-Agent: KMail/1.9.7 References: <200710082135.58099.mihai.dontu@gmail.com> <200710081841.35968.jkim@FreeBSD.org> <200710090348.52036.mihai.dontu@gmail.com> In-Reply-To: <200710090348.52036.mihai.dontu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200710101533.06287.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org, Jung-uk Kim Subject: Re: amd64_set_gsbase() 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: Wed, 10 Oct 2007 13:33:18 -0000 On Tuesday 09 October 2007 02:48:51 Mihai Don=C8=9Bu wrote: > I have *one* more question: maybe I don't fully understand the hole > BASE thing, but since the FreeBSD kernel does not preserve %gs and > %fs, what is the purpose of amd64_set_XXbase()? The %fs, %gs registers and fsbase and gsbase MSRs are separate registers. When you write %gs:offset, you actually get (gsbase+offset), so the actual value of %gs doesn't matter. There are two ways to set gsbase. One is by using the privileged instruction wrmsr to set gsbase directly (full 64bit base address), which is what amd64_set_gsbase() exposes to userland. The other is by loading a descriptor selector in %gs in which case gsbase will be set to the base address (only 32bit base address) of a descriptor entry in either the GDT or LDT. To get back to what you are trying to do, because %gs isn't preserved, I think you should avoid writing to it and instead strictly use amd64_set_gsbase(). But from what you've written, I'm guessing you're already doing this, so the next thing to try is to create threads with PTHREAD_SCOPE_SYSTEM or use libthr instead of libpthread, because if I'm not mistaken, PTHREAD_SCOPE_PROCESS in libpthread doesn't preserve gsbase either. From owner-freebsd-emulation@FreeBSD.ORG Wed Oct 10 14:38:03 2007 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 2057916A419 for ; Wed, 10 Oct 2007 14:38:02 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: from mail.bitdefender.com (ns.bitdefender.com [217.156.83.1]) by mx1.freebsd.org (Postfix) with ESMTP id C5AE113C45D for ; Wed, 10 Oct 2007 14:37:59 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: (qmail 29772 invoked by uid 1010); 10 Oct 2007 17:11:18 +0300 Received: from ns.bitdefender.com (HELO mdontu-l.dsd.ro) (217.156.83.1) by mail.bitdefender.com with AES256-SHA encrypted SMTP; 10 Oct 2007 17:11:17 +0300 From: Mihai =?utf-8?q?Don=C8=9Bu?= Organization: Home To: Tijl Coosemans Date: Wed, 10 Oct 2007 17:11:13 +0300 User-Agent: KMail/1.9.7 References: <200710082135.58099.mihai.dontu@gmail.com> <200710090348.52036.mihai.dontu@gmail.com> <200710101533.06287.tijl@ulyssis.org> In-Reply-To: <200710101533.06287.tijl@ulyssis.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200710101711.14386.mihai.dontu@gmail.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 2.0.0 on mail.bitdefender.com X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: v1, bayes score: 500, neunet score: 500, flags: [SUBJ_R_STOCK_0330_1; ], total: 0 Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org, Jung-uk Kim Subject: Re: amd64_set_gsbase() 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: Wed, 10 Oct 2007 14:38:03 -0000 On Wednesday 10 October 2007, Tijl Coosemans wrote: > On Tuesday 09 October 2007 02:48:51 Mihai DonÈ›u wrote: > > I have *one* more question: maybe I don't fully understand the hole > > BASE thing, but since the FreeBSD kernel does not preserve %gs and > > %fs, what is the purpose of amd64_set_XXbase()? > > The %fs, %gs registers and fsbase and gsbase MSRs are separate > registers. When you write %gs:offset, you actually get (gsbase+offset), > so the actual value of %gs doesn't matter. > > There are two ways to set gsbase. One is by using the privileged > instruction wrmsr to set gsbase directly (full 64bit base address), > which is what amd64_set_gsbase() exposes to userland. The other is by > loading a descriptor selector in %gs in which case gsbase will be set > to the base address (only 32bit base address) of a descriptor entry in > either the GDT or LDT. Invaluable info. Thanks! :) > To get back to what you are trying to do, because %gs isn't preserved, > I think you should avoid writing to it and instead strictly use > amd64_set_gsbase(). But from what you've written, I'm guessing you're > already doing this, so the next thing to try is to create threads with > PTHREAD_SCOPE_SYSTEM or use libthr instead of libpthread, because if > I'm not mistaken, PTHREAD_SCOPE_PROCESS in libpthread doesn't preserve > gsbase either. Well, I'm am not setting (loading) %gs, I *only* do amd64_set_gsbase() and expect that *all* instructions such as: mov %gs:0x10,%rax to be valid (not segfault). I don't really care what the value of %gs is as long as *all* the instructions as the above work and access the memory specified in amd64_set_gsbase( addr ). I was under the (wrong) impression that the value of %gs is important, that's why I wanted it preserved, but if you say: > [...] When you write %gs:offset, you actually get (gsbase+offset), > so the actual value of %gs doesn't matter. then I don't care if %gs' value gets lost over context switches as long as mov %gs:0x10,%rax and other such instructions, work. However, it turns out that amd64_set_gsbase() is not enough :( Either: a) someone *does* set %gs (and is not me); b) the 'gsbase' gets lost; The thing is I've ported my emulator to Linux and there I use modify_ldt() and then some __asm__ voodoo to load %gs, because (quote from man): - "ARCH_SET_GS is disabled in some kernels." - "Context switches for 64-bit segment bases are rather expensive. It may be a faster alternative to set a 32-bit base using a segment selector by setting up an LDT with modify_ldt(2) [...]" Anyhoo, I'll try to use 'libthr' and see if this helps. Thanks, again! -- Mihai DonÈ›u From owner-freebsd-emulation@FreeBSD.ORG Wed Oct 10 17:53:55 2007 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 BF6A816A417 for ; Wed, 10 Oct 2007 17:53:55 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: from mail7.sea5.speakeasy.net (mail7.sea5.speakeasy.net [69.17.117.9]) by mx1.freebsd.org (Postfix) with ESMTP id 92E4513C46A for ; Wed, 10 Oct 2007 17:53:55 +0000 (UTC) (envelope-from mi+mill@aldan.algebra.com) Received: (qmail 22149 invoked from network); 10 Oct 2007 17:53:55 -0000 Received: from aldan.algebra.com (HELO aldan-mlp) ([216.254.65.224]) (envelope-sender ) by mail7.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Oct 2007 17:53:54 -0000 From: Mikhail Teterin To: Alexander Leidinger Date: Wed, 10 Oct 2007 13:53:52 -0400 User-Agent: KMail/1.7.1 References: <200707192341.59940@aldan> <20070722133553.619a5eab@deskjail> <200709170828.02099@aldan> In-Reply-To: <200709170828.02099@aldan> Organization: Virtual Estates, Inc. MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200710101353.52688.mi+mill@aldan.algebra.com> Cc: freebsd-emulation@freebsd.org Subject: Re: Still something wrong with Linux on 6.2-stable/amd64 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: Wed, 10 Oct 2007 17:53:55 -0000 =D0=CF=CE=C5=C4=A6=CC=CF=CB 17 =D7=C5=D2=C5=D3=C5=CE=D8 2007 08:28 =C4=CF, = Mikhail Teterin =F7=C9 =CE=C1=D0=C9=D3=C1=CC=C9: > Still broken... Just rebuilt a new kernel with sources up to yesterday. > > civctp refuses to start-up. The game used to have a demo-port (which > limited it to 1000AC, I think): games/civ2demo. I just tried the same game on a Linux (Red Hat Enterprise 3.0): Linux ny-lxdesk38 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:58:20 EDT 2007 x8= 6_64 x86_64 x86_64 GNU/Linux The executable starts and runs perfectly, but the kernel logs the following message: application civctp uses obsolete OSS audio interface Maybe, that's related to the problem on -stable? It says the same thing about realplay (version 8)... BTW, here is how to extract the dead port of civ2demo from the Attic quickly (presuming /usr/ports already exists and is writable by you): cd /usr cvs -d pcvs.FreeBSD.org:/home/pcvs -z9 co -rRELEASE_6_0_0 ports/games/civ2= demo Although the MASTER_SITE is no longer reachable, FreeBSD-mirrors still carry the freely-distributable archive civctp-demo-10251999.tar.gz. Just add ``amd64'' to the list of ONLY_FOR_ARCHS in the Makefile. After the port installs, try running ``civctp_demo''. Thanks. Yours, -mi