[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 05/10] Clear AC bit in RFLAGS to protect Xen itself by SMAP



>>> On 05.05.14 at 10:22, <feng.wu@xxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/asm_defns.h
> +++ b/xen/include/asm-x86/asm_defns.h
> @@ -199,7 +199,10 @@ static inline void stac(void)
>  #endif
>  
>  #ifdef __ASSEMBLY__
> -.macro SAVE_ALL
> +.macro SAVE_ALL clear_ac=0
> +.if \clear_ac
> +        ASM_CLAC
> +.endif
>          addq  $-(UREGS_error_code-UREGS_r15), %rsp
>          cld
>          movq  %rdi,UREGS_rdi(%rsp)

Considering that an unnecessary CLAC is generally no problem, I think
the default value of the macro parameter should be 1, and when the
instructions is specifically not needed the use site would pass 0.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.