qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC] env stored in segment register for i386


From: Richard Henderson
Subject: [Qemu-devel] [RFC] env stored in segment register for i386
Date: Fri, 02 Jul 2010 09:17:09 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5

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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]