All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Glauber de Oliveira Costa" <glommer@gmail.com>
To: Avi Kivity <avi@qumranet.com>
Cc: ehabkost@redhat.com, linux-kernel@vger.kernel.org,
	Glauber de Oliveira Costa <gcosta@redhat.com>,
	chrisw@sous-sol.org, tglx@linutronix.de, anthony@codemonkey.ws,
	hpa@zytor.com, akpm@linux-foundation.org,
	virtualization@lists.linux-foundation.org, mingo@elte.hu,
	ak@suse.de
Subject: Re: [PATCH 4/8] unify paravirt parts of system.h
Date: Tue, 4 Dec 2007 17:41:41 -0200	[thread overview]
Message-ID: <5d6222a80712041141p5fbc0c0ei68696f054cc8a303__38894.6294239306$1196797611$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <4755A809.4050305@qumranet.com>

On Dec 4, 2007 5:18 PM, Avi Kivity <avi@qumranet.com> wrote:
> Glauber de Oliveira Costa wrote:
> > This patch moves the i386 control registers manipulation functions,
> > wbinvd, and clts functions to system.h. They are essentially the same
> > as in x86_64, except for the cr8 register, which we add.
> >
> > +
> > +static inline unsigned long native_read_cr8(void)
> > +{
> > +     unsigned long cr8;
> > +     asm volatile("mov %%cr8,%0" : "=r" (cr8), "=m" (__force_order));
> > +     return cr8;
> > +}
> > +
> >
>
> There is no cr8 register on i386.  This had better be protected by an
> #ifdef.

Sure. I mentioned it in the changelog. I, however, am not sure If I
agree it should be enclosed
in ifdefs. Me and Jeremy discussed it a while ago, and we seem to
agree that for those functions
that are exclusive of one architecture, there were no need for ifdefs.
Any usage by the other arch
is a bug.

But I admit that I'm not particularly biased here, and I can change
it, if there's agreement that
an ifdef here is the way to go.

> (you're likely not getting an error since it's a static inline, so the
> asm is never emitted)
>
Which also means it does not affect the binary in anyway. No bigger
code, no nothing.
My current approach is to save the ifdefs for pieces that in fact can
save us some resources
in the final image. But again... I can change it.



-- 
Glauber de Oliveira Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."

  parent reply	other threads:[~2007-12-04 19:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 16:06 [PATCH 0/8] Integrate system.h Glauber de Oliveira Costa
2007-12-04 16:06 ` Glauber de Oliveira Costa
2007-12-04 16:06 ` [PATCH 1/8] remove volatile keyword from clflush Glauber de Oliveira Costa
2007-12-04 16:06   ` Glauber de Oliveira Costa
2007-12-04 16:06   ` [PATCH 2/8] put together equal pieces of system.h Glauber de Oliveira Costa
2007-12-04 16:06     ` Glauber de Oliveira Costa
2007-12-04 16:06     ` [PATCH 3/8] unify load_segment macro Glauber de Oliveira Costa
2007-12-04 16:06       ` Glauber de Oliveira Costa
2007-12-04 16:06       ` [PATCH 4/8] unify paravirt parts of system.h Glauber de Oliveira Costa
2007-12-04 16:06         ` Glauber de Oliveira Costa
2007-12-04 16:06         ` [PATCH 5/8] remove unused macro Glauber de Oliveira Costa
2007-12-04 16:06           ` Glauber de Oliveira Costa
2007-12-04 16:06           ` [PATCH 6/8] unify smp parts of system.h Glauber de Oliveira Costa
2007-12-04 16:06             ` Glauber de Oliveira Costa
2007-12-04 16:06             ` [PATCH 7/8] move switch_to macro to system.h Glauber de Oliveira Costa
2007-12-04 16:06               ` Glauber de Oliveira Costa
2007-12-04 16:06               ` [PATCH 8/8] unify system.h Glauber de Oliveira Costa
2007-12-04 16:06                 ` Glauber de Oliveira Costa
2007-12-04 19:18         ` [PATCH 4/8] unify paravirt parts of system.h Avi Kivity
2007-12-04 19:18         ` Avi Kivity
2007-12-04 19:34           ` Andi Kleen
2007-12-04 19:34           ` Andi Kleen
2007-12-05 16:30             ` Pavel Machek
2007-12-05 16:30             ` Pavel Machek
2007-12-15 13:17               ` Ingo Molnar
2007-12-15 13:17               ` Ingo Molnar
2007-12-17  0:27                 ` Rafael J. Wysocki
2007-12-17  0:23                   ` Pavel Machek
2007-12-17  0:23                   ` Pavel Machek
2007-12-17  0:58                     ` Rafael J. Wysocki
2007-12-17  0:58                     ` Rafael J. Wysocki
2007-12-17  0:27                 ` Rafael J. Wysocki
2007-12-15 13:26               ` Andi Kleen
2007-12-15 13:26               ` Andi Kleen
2007-12-15 22:54                 ` Pavel Machek
2007-12-15 22:54                 ` Pavel Machek
2007-12-15 20:28               ` H. Peter Anvin
2007-12-15 20:28               ` H. Peter Anvin
2007-12-04 19:41           ` Glauber de Oliveira Costa [this message]
2007-12-04 19:41           ` Glauber de Oliveira Costa
2007-12-04 22:14             ` Denys Vlasenko
2007-12-04 22:14             ` Denys Vlasenko

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='5d6222a80712041141p5fbc0c0ei68696f054cc8a303__38894.6294239306$1196797611$gmane$org@mail.gmail.com' \
    --to=glommer@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=anthony@codemonkey.ws \
    --cc=avi@qumranet.com \
    --cc=chrisw@sous-sol.org \
    --cc=ehabkost@redhat.com \
    --cc=gcosta@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.