From: Tim Deegan Subject: Re: [PATCH v5 3/4] VMX: use proper instruction mnemonics if assembler supports them Date: Thu, 29 Aug 2013 14:19:24 +0100 Message-ID: <20130829131924.GG75385@ocelot.phlegethon.org> References: <52193148.2090601@citrix.com> <521B36AA02000078000EE496@nat28.tlf.novell.com> <521B1F15.1030104@citrix.com> <521B479902000078000EE505@nat28.tlf.novell.com> <521B528C.8080107@citrix.com> <521B7C6402000078000EE6D4@nat28.tlf.novell.com> <521B63AF.7000008@citrix.com> <521B90F802000078000EE7A3@nat28.tlf.novell.com> <20130829114742.GC75385@ocelot.phlegethon.org> <521F5E7202000078000EF6BF@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VF28G-0007K4-QP for xen-devel@lists.xenproject.org; Thu, 29 Aug 2013 13:19:29 +0000 Content-Disposition: inline In-Reply-To: <521F5E7202000078000EF6BF@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Andrew Cooper , Keir Fraser , Eddie Dong , Jun Nakajima , xen-devel List-Id: xen-devel@lists.xenproject.org At 13:45 +0100 on 29 Aug (1377783906), Jan Beulich wrote: > >>> On 29.08.13 at 13:47, Tim Deegan wrote: > > At 16:31 +0100 on 26 Aug (1377534696), Jan Beulich wrote: > >> Additionally I was quite puzzled to find that all the asm()-s involved > >> here have memory clobbers - what are they needed for? Or can they be > >> dropped at least in some cases? > > > > The vmread/write ones are, I think, red herrings. We're not allowed to > > make assumptions about the memory state of a loaded VMCS anyway. > > > > invept I think does, to make sure all EPT changes have been written. > > invvpid too, for similar reasons. > > Considering that these instructions aren't documented to be > ordered in any way with earlier ones (at least the instruction > pages don't say anything to that effect), wouldn't we rather > need an MFENCE to enforce this? invept and invvpid are both serializing (in the list in vol 3A, 8-16). > > vmptrld/clear I'm not sure about: if we were to (say) copy a VMCS or > > move it we'd need that barrier. (AFAIK we don't do that but we might be > > very surprised if we started). > > Similarly here. I think the x86 memory model is strong enough here: as long as the compiler issues the instructions in the right order they'll be seen in the right order by all CPUs. Tim.