From: "Jan Beulich" Subject: Re: [PATCH v5 04/10] x86: Add support for STAC/CLAC instructions Date: Tue, 06 May 2014 11:30:41 +0100 Message-ID: <5368D5F1020000780000F4E9@mail.emea.novell.com> References: <1399370877-5387-1-git-send-email-feng.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1399370877-5387-1-git-send-email-feng.wu@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Feng Wu Cc: kevin.tian@intel.com, ian.campbell@citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 06.05.14 at 12:07, wrote: > +static inline void clac(void) > +{ > + if ( boot_cpu_has(X86_FEATURE_SMAP) ) > + asm volatile (__stringify(__ASM_CLAC)); > +} > + > +static inline void stac(void) > +{ > + if ( boot_cpu_has(X86_FEATURE_SMAP) ) > + asm volatile (__stringify(__ASM_STAC)); > +} > +#endif Hmm, did you really mean to lose the memory clobbers here? In the previous round's review I specifically said that this conversion to C is likely only safe due to their presence. Jan