From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Avoid using vmx instruction directly Date: Wed, 22 Nov 2006 08:42:32 +0200 Message-ID: <4563F158.3060209@qumranet.com> References: <4563667B.2060209@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, akpm-3NddpPZAyC0@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "H. Peter Anvin" Return-path: To: Jeremy Fitzhardinge In-Reply-To: <4563667B.2060209-TSDbQ3PG+2Y@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.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