From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 3/3] x86: Use alternative mechanism to define CLAC/STAC Date: Mon, 26 May 2014 17:22:37 +0100 Message-ID: <53836A4D.1020200@citrix.com> References: <1401089273-16425-1-git-send-email-feng.wu@intel.com> <1401089273-16425-4-git-send-email-feng.wu@intel.com> <5383628D.4000907@citrix.com> <538385820200007800015D71@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <538385820200007800015D71@mail.emea.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: keir.xen@gmail.com, Feng Wu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 26/05/2014 17:18, Jan Beulich wrote: >>>> On 26.05.14 at 17:49, wrote: >> On 26/05/2014 08:27, Feng Wu wrote: >>> @@ -166,26 +168,34 @@ void ret_from_intr(void); >>> #define __ASM_STAC .byte 0x0f,0x01,0xcb >>> >>> #ifdef __ASSEMBLY__ >>> -#define ASM_AC(op) \ >>> - btl $X86_FEATURE_SMAP & 31, \ >>> - CPUINFO_FEATURE_OFFSET(X86_FEATURE_SMAP)+boot_cpu_data(%rip); \ >>> - jnc 881f; \ >>> - __ASM_##op; \ >>> -881: >>> - >>> -#define ASM_STAC ASM_AC(STAC) >>> -#define ASM_CLAC ASM_AC(CLAC) >>> +#define ASM_CLAC \ >>> + 661: ASM_NOP3; \ >>> + .pushsection .altinstr_replacement, "ax"; \ >> The altinstr_replacement section doesn't need to be executable. The >> data inside it is copied out into the .text section. > But having it executable allows easily disassembling their contents - > reasonable disassemblers don't disassemble non-executable sections > by default. > > Jan > True, but without labels, the disassembly would just be a jumble of instructions. ~Andrew