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

Re: [Xen-devel] [PATCH v3 4/9] Clear AC bit in RFLAGS to protect Xen itself by SMAP




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Tuesday, April 29, 2014 4:59 PM
> To: Wu, Feng
> Cc: andrew.cooper3@xxxxxxxxxx; ian.campbell@xxxxxxxxxx; Dong, Eddie;
> Nakajima, Jun; Tian, Kevin; xen-devel@xxxxxxxxxxxxx
> Subject: RE: [PATCH v3 4/9] Clear AC bit in RFLAGS to protect Xen itself by 
> SMAP
> 
> >>> On 29.04.14 at 10:19, <feng.wu@xxxxxxxxx> wrote:
> > BTW, can we move SAVE_ALL into #ifdef
> > __ASSEMBLY__ ...... #endif,
> > since it is only used in assembly code?
> 
> Sure - that could be part of your first patch eliminating the last C user.

Thanks!

May I move the definition of SAVE_ALL (or more related code, such as, 
SAVE_VOLATILE, etc.) from " xen/include/asm-x86/x86_64/asm_defns.h " to " 
xen/include/asm-x86/asm_defns.h ", since I got an build error after adding a 
parameter to marco SAVE_ALL like this, which makes me think it should be 
defined after ASM_CLAC?

#ifdef __ASSEMBLY__
.macro SAVE_ALL clear_ac=1
.if \clear_ac
        ASM_CLAC
.endif
        addq  $-(UREGS_error_code-UREGS_r15), %rsp
        cld
        movq  %rdi,UREGS_rdi(%rsp)
        movq  %rsi,UREGS_rsi(%rsp)
        movq  %rdx,UREGS_rdx(%rsp)
        movq  %rcx,UREGS_rcx(%rsp)
        movq  %rax,UREGS_rax(%rsp)
        movq  %r8,UREGS_r8(%rsp)
       movq  %r9,UREGS_r9(%rsp)
        movq  %r10,UREGS_r10(%rsp)
        movq  %r11,UREGS_r11(%rsp)
        movq  %rbx,UREGS_rbx(%rsp)
        movq  %rbp,UREGS_rbp(%rsp)
        SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp)
        movq  %r12,UREGS_r12(%rsp)
        movq  %r13,UREGS_r13(%rsp)
        movq  %r14,UREGS_r14(%rsp)
        movq  %r15,UREGS_r15(%rsp)
.endm


> 
> Jan

Thanks,
Feng

_______________________________________________
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®.