From: Paolo Bonzini <pbonzini@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable
Date: Tue, 29 Jun 2010 17:40:43 +0200 [thread overview]
Message-ID: <4C2A13FB.9080907@redhat.com> (raw)
In-Reply-To: <201006291628.09556.paul@codesourcery.com>
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 prevents code clobbering
>>>> this value. Having one without the other makes no sense.
>>>>
>>>> Making "env" available without including exec.h would be a
>>>> different problem, but we never do that and would probably indicate
>>>> we're doing something else wrong.
>>>
>>> Paul, I agree but I was told to do something different.
>>
>> 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 semantics determined by some combination of preprocessor macros.
>
> I realise we already have this with NEED_CPU_H, however I don't think that's a
> precedent we want to encourage.
>
>> I didn't really see a use right now for that, but cpu_get_tb_cpu_state
>> could be something that may belong in target-*/exec.h more than in
>> target-*/cpu.h (no, I'm not going to move it); yet it cannot be moved
>> right now because it is called in exec.c.
>
> How is putting it in exec.h better?
I see cpu.h as holding things related to the CPU as a hardware device,
and exec.h as holding things related to emulation of the CPU.
In theory, a hypothetical KVM-only/no-TCG version of QEMU would not need
to include neither exec-all.h nor target-*/exec.h.
Paolo
next prev parent reply other threads:[~2010-06-29 15:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 17:17 [Qemu-devel] [PATCH 0/4] introduce NEED_GLOBAL_ENV Paolo Bonzini
2010-06-28 17:17 ` [Qemu-devel] [PATCH 1/4] remove unused stuff from */exec.h Paolo Bonzini
2010-06-28 17:43 ` [Qemu-devel] " Blue Swirl
2010-06-29 7:48 ` Paolo Bonzini
2010-06-28 17:17 ` [Qemu-devel] [PATCH 2/4] move cpu_pc_from_tb to target-*/exec.h Paolo Bonzini
2010-06-28 17:17 ` [Qemu-devel] [PATCH 3/4] remove exec-all.h inclusion from cpu.h Paolo Bonzini
2010-06-28 17:17 ` [Qemu-devel] [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable Paolo Bonzini
2010-06-28 20:29 ` Paul Brook
2010-06-29 7:44 ` [Qemu-devel] " Paolo Bonzini
2010-06-29 11:30 ` Paul Brook
2010-06-29 13:51 ` Paolo Bonzini
2010-06-29 14:24 ` Paolo Bonzini
2010-06-29 15:28 ` Paul Brook
2010-06-29 15:40 ` Paolo Bonzini [this message]
2010-06-30 0:34 ` Paul Brook
2010-06-29 18:22 ` Blue Swirl
2010-06-28 17:54 ` [Qemu-devel] Re: [PATCH 0/4] introduce NEED_GLOBAL_ENV Blue Swirl
[not found] <5692464.1280361277887491249.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2010-06-30 8:56 ` [Qemu-devel] Re: [PATCH 4/4] require #define NEED_GLOBAL_ENV for files that need the global register variable Paolo Bonzini
2010-07-01 19:42 ` Blue Swirl
2010-07-02 9:50 ` Paolo Bonzini
2010-07-03 7:23 ` Blue Swirl
2010-07-08 16:39 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C2A13FB.9080907@redhat.com \
--to=pbonzini@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).