[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-07-08 Thread Paolo Bonzini
On 07/03/2010 09:23 AM, Blue Swirl wrote: On Fri, Jul 2, 2010 at 9:50 AM, Paolo Bonzini wrote: The *global* env is still unavailable (i.e. no difference WRT poisoning), by virtue of being defined in exec.h which is not available unless -DNEED_CPU_H is defined. So: | before

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-07-03 Thread Blue Swirl
On Fri, Jul 2, 2010 at 9:50 AM, Paolo Bonzini wrote: > On 07/01/2010 09:42 PM, Blue Swirl wrote: >> >> I still maintain that 'env' may not be unpoisoned until the name is >> less likely to invite accidents. > > The *global* env is still unavailable (i.e. no difference WRT poisoning), by > virtue o

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-07-02 Thread Paolo Bonzini
On 07/01/2010 09:42 PM, Blue Swirl wrote: I still maintain that 'env' may not be unpoisoned until the name is less likely to invite accidents. The *global* env is still unavailable (i.e. no difference WRT poisoning), by virtue of being defined in exec.h which is not available unless -DNEED_CP

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-07-01 Thread Blue Swirl
On Wed, Jun 30, 2010 at 8:56 AM, Paolo Bonzini wrote: Wouldn't it be better to just put this in dyngen-exec.h ? AFAICT there's a direct correlation between NEED_GLOBAL_ENV and #include "exec.h". >>> >>> True, see cover letter in 0/4.  I was told to make each file request >>> explici

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-30 Thread Paolo Bonzini
>>> Wouldn't it be better to just put this in dyngen-exec.h ? >>> AFAICT there's a direct correlation between NEED_GLOBAL_ENV and #include >>> "exec.h". >> >> True, see cover letter in 0/4.  I was told to make each file request >> explicitly the global variable though.  So I'd have to leave the #if

Re: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paul Brook
> >> BTW, this may be useful for one thing: being able to include exec.h > >> without bringing in the global variable. > > > > I'd argue that's not a desirable feature. I'd much rather have exec.h be > > the controlling factor than have all files include the same set of > > headers and have semant

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Blue Swirl
On Tue, Jun 29, 2010 at 7:44 AM, Paolo Bonzini wrote: > On 06/28/2010 10:29 PM, Paul Brook wrote: >>> >>> diff --git a/exec-all.h b/exec-all.h >>> index a775582..ebe88ad 100644 >>> --- a/exec-all.h >>> +++ b/exec-all.h >>> @@ -353,4 +353,8 @@ extern int singlestep; >>>  /* cpu-exec.c */ >>>  exter

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paolo Bonzini
On 06/29/2010 05:28 PM, Paul Brook wrote: On 06/29/2010 03:51 PM, Paolo Bonzini wrote: On 06/29/2010 01:30 PM, Paul Brook wrote: I don't understand what this is supposed to achieve. The inclusion of exec.h is what defines whether this global variable is available. Just as importantly, it also p

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paul Brook
> On 06/29/2010 03:51 PM, Paolo Bonzini wrote: > > On 06/29/2010 01:30 PM, Paul Brook wrote: > >> I don't understand what this is supposed to achieve. The inclusion > >> of exec.h is what defines whether this global variable is > >> available. Just as importantly, it also prevents code clobbering >

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paolo Bonzini
On 06/29/2010 03:51 PM, Paolo Bonzini wrote: On 06/29/2010 01:30 PM, Paul Brook wrote: I don't understand what this is supposed to achieve. The inclusion of exec.h is what defines whether this global variable is available. Just as importantly, it also prevents code clobbering this value. Having

Re: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paolo Bonzini
On 06/29/2010 01:30 PM, Paul Brook wrote: I don't understand what this is supposed to achieve. The inclusion of exec.h is what defines whether this global variable is available. Just as importantly, it also prevents code clobbering this value. Having one without the other makes no sense. Making

Re: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paul Brook
> On 06/28/2010 10:29 PM, Paul Brook wrote: > >> diff --git a/exec-all.h b/exec-all.h > >> index a775582..ebe88ad 100644 > >> --- a/exec-all.h > >> +++ b/exec-all.h > >> @@ -353,4 +353,8 @@ extern int singlestep; > >> > >> /* cpu-exec.c */ > >> extern volatile sig_atomic_t exit_request; > >>

[Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable

2010-06-29 Thread Paolo Bonzini
On 06/28/2010 10:29 PM, Paul Brook wrote: diff --git a/exec-all.h b/exec-all.h index a775582..ebe88ad 100644 --- a/exec-all.h +++ b/exec-all.h @@ -353,4 +353,8 @@ extern int singlestep; /* cpu-exec.c */ extern volatile sig_atomic_t exit_request; +#ifdef NEED_GLOBAL_ENV +register CPUState *en