From: "Jan Beulich" Subject: Re: [PATCH v3 4/9] Clear AC bit in RFLAGS to protect Xen itself by SMAP Date: Mon, 28 Apr 2014 10:58:02 +0100 Message-ID: <535E424A020000780000CCB3@nat28.tlf.novell.com> References: <1398654944-6020-1-git-send-email-feng.wu@intel.com> <535E3AC6020000780000CBF4@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 , "ian.campbell@citrix.com" , "andrew.cooper3@citrix.com" , Eddie Dong , "xen-devel@lists.xen.org" , Jun Nakajima List-Id: xen-devel@lists.xenproject.org >>> On 28.04.14 at 11:43, wrote: > >> -----Original Message----- >> From: Jan Beulich [mailto:JBeulich@suse.com] >> Sent: Monday, April 28, 2014 5:26 PM >> To: Wu, Feng >> Cc: andrew.cooper3@citrix.com; ian.campbell@citrix.com; Dong, Eddie; >> Nakajima, Jun; Tian, Kevin; xen-devel@lists.xen.org >> Subject: Re: [PATCH v3 4/9] Clear AC bit in RFLAGS to protect Xen itself by > SMAP >> >> >>> On 28.04.14 at 05:15, wrote: >> > @@ -466,6 +468,7 @@ ENTRY(dom_crash_sync_extable) >> > jmp asm_domain_crash_synchronous /* Does not return */ >> > >> > ENTRY(common_interrupt) >> > + ASM_CLAC >> > SAVE_ALL >> > movq %rsp,%rdi >> > callq do_IRQ >> > @@ -485,6 +488,7 @@ ENTRY(page_fault) >> > movl $TRAP_page_fault,4(%rsp) >> > /* No special register assumptions. */ >> > GLOBAL(handle_exception) >> > + ASM_CLAC >> > SAVE_ALL >> >> Did you check whether the addition wouldn't better go right into >> SAVE_ALL? > > Most of them can be moved into SAVE_ALL obviously, however, there are two > exceptions: > > 1. SAVE_ALL is not executed in the beginning of some exception handlers, > such as, double_fault, nmi, etc. But that's orthogonal - I didn't say that would automatically cover _all_ cases. > 2. We don't need CLAC in .fixup section where SAVE_ALL is used. Do we not? Jan