From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36176 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUiw1-0004in-0A for qemu-devel@nongnu.org; Fri, 02 Jul 2010 12:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUivz-00077d-L2 for qemu-devel@nongnu.org; Fri, 02 Jul 2010 12:17:48 -0400 Received: from b.mail.sonic.net ([64.142.19.5]:33694) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUivz-00077V-Ch for qemu-devel@nongnu.org; Fri, 02 Jul 2010 12:17:47 -0400 Message-ID: <4C2E1105.2080903@twiddle.net> Date: Fri, 02 Jul 2010 09:17:09 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1269890225-13639-1-git-send-email-weil@mail.berlios.de> <1269890225-13639-2-git-send-email-weil@mail.berlios.de> <20100408192902.GI6056@volta.aurel32.net> <4BBF0D7B.60400@mail.berlios.de> <4C2E07B6.1050605@redhat.com> In-Reply-To: <4C2E07B6.1050605@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] env stored in segment register for i386 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: QEMU Developers , Aurelien Jarno On 07/02/2010 08:37 AM, Paolo Bonzini wrote: > The second (more real) reason is inline assembly failures, for example > (32-bit x86): > > register int e asm("edi"); > > static inline int h() > { > int x; > asm volatile ("mov $0, %0" : "=D" (x)); > } > > int g() > { > int f = e; > h(); > return e - f; > } > > fails to compile because gcc cannot assign edi to %0 in h(). Some host > headers may use assembly in a way that breaks qemu. With only one > global register in use, however, it makes sense IMO to drop the custom > inclusion hacks and see if anyone screams. A few months ago I developed a patch that would allow the global env variable to be accessed via %fs (plus a backing TLS variable), which means that no hardware register needs to be reserved for i386. I never quite got around to finishing it because I don't know how to set up a segment register in Windows, and it seemed like the kind of patch that could easily get quagmired. Is there any interest in a patch like this? Should I try to revive it? r~