All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
	kvm-devel@lists.sourceforge.net, akpm@osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [kvm-devel] [PATCH] KVM: Avoid using vmx instruction directly
Date: Wed, 22 Nov 2006 08:42:32 +0200	[thread overview]
Message-ID: <4563F158.3060209@qumranet.com> (raw)
In-Reply-To: <4563667B.2060209@goop.org>

Jeremy Fitzhardinge wrote:
>
>
> Like "volatile" variables, I think "asm volatile" is probably overused.
> If you want to guarantee specific ordering of asms, it's probably better
> to add an explicit dependency between them rather than rely on asm
> volatile; this could either be a "memory" clobber, or something more
> fine-grained.  For example:
>
>     /* need never be instansiated; never actually referenced */
>     extern int spin_sequencer;
>
>     /* %0 never referenced */
>     asm("take spinlock" : "+m" (spin_sequencer)...);
>
>     ...
>
>     /* again, %0 never referenced */
>     asm("release spinlock" : "+m" (spin_sequencer)...);
>

Very interesting.

Will it work on load/store architectures?  Since all memory access is 
through a register, won't the constraint generate a useless register 
load (and a use of the variable)?


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Jeremy Fitzhardinge <jeremy-TSDbQ3PG+2Y@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	akpm-3NddpPZAyC0@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] KVM: Avoid using vmx instruction directly
Date: Wed, 22 Nov 2006 08:42:32 +0200	[thread overview]
Message-ID: <4563F158.3060209@qumranet.com> (raw)
In-Reply-To: <4563667B.2060209-TSDbQ3PG+2Y@public.gmane.org>

Jeremy Fitzhardinge wrote:
>
>
> Like "volatile" variables, I think "asm volatile" is probably overused.
> If you want to guarantee specific ordering of asms, it's probably better
> to add an explicit dependency between them rather than rely on asm
> volatile; this could either be a "memory" clobber, or something more
> fine-grained.  For example:
>
>     /* need never be instansiated; never actually referenced */
>     extern int spin_sequencer;
>
>     /* %0 never referenced */
>     asm("take spinlock" : "+m" (spin_sequencer)...);
>
>     ...
>
>     /* again, %0 never referenced */
>     asm("release spinlock" : "+m" (spin_sequencer)...);
>

Very interesting.

Will it work on load/store architectures?  Since all memory access is 
through a register, won't the constraint generate a useless register 
load (and a use of the variable)?


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2006-11-22  6:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 11:08 [PATCH] KVM: Avoid using vmx instruction directly Avi Kivity
2006-11-09 11:08 ` Avi Kivity
2006-11-09 13:29 ` [kvm-devel] " Arnd Bergmann
2006-11-09 13:29   ` Arnd Bergmann
2006-11-09 13:36   ` [kvm-devel] " Avi Kivity
2006-11-09 13:36     ` Avi Kivity
2006-11-09 14:42     ` [kvm-devel] " Arnd Bergmann
2006-11-09 14:42       ` Arnd Bergmann
2006-11-09 14:52       ` [kvm-devel] " Avi Kivity
2006-11-09 16:37         ` Arnd Bergmann
2006-11-09 16:51           ` Avi Kivity
2006-11-09 23:39         ` Jeremy Fitzhardinge
2006-11-10 12:46           ` Martin Schwidefsky
2006-11-10 19:38             ` Jeremy Fitzhardinge
2006-11-10 19:38               ` Jeremy Fitzhardinge
2006-11-21 18:35           ` [kvm-devel] " H. Peter Anvin
2006-11-21 18:35             ` H. Peter Anvin
2006-11-21 19:41             ` [kvm-devel] " Avi Kivity
2006-11-21 19:41               ` Avi Kivity
2006-11-21 20:50             ` [kvm-devel] " Jeremy Fitzhardinge
2006-11-21 20:50               ` Jeremy Fitzhardinge
2006-11-22  6:42               ` Avi Kivity [this message]
2006-11-22  6:42                 ` Avi Kivity
2006-11-22  9:10                 ` [kvm-devel] " Jeremy Fitzhardinge
2006-11-22  9:10                   ` Jeremy Fitzhardinge

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=4563F158.3060209@qumranet.com \
    --to=avi@qumranet.com \
    --cc=akpm@osdl.org \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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.