From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 3/4] x86/xstate: fix fault behavior on XRSTORS Date: Mon, 1 Feb 2016 11:22:13 +0000 Message-ID: <56AF3FE5.8070000@citrix.com> References: <56AB4B6102000078000CC51B@prv-mh.provo.novell.com> <56AB4D1402000078000CC543@prv-mh.provo.novell.com> <56AF2FCE02000078000CCC5F@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aQCYt-0001Y0-RQ for xen-devel@lists.xenproject.org; Mon, 01 Feb 2016 11:22:27 +0000 In-Reply-To: <56AF2FCE02000078000CCC5F@prv-mh.provo.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 , xen-devel Cc: Keir Fraser , Harmandeep Kaur , Shuai Ruan List-Id: xen-devel@lists.xenproject.org On 01/02/16 09:13, Jan Beulich wrote: > XRSTORS unconditionally faults when xcomp_bv has bit 63 clear. Instead > of just fixing this issue, overhaul the fault recovery code, which - > one of the many mistakes made when xstate support got introduced - was > blindly mirroring that accompanying FXRSTOR, neglecting the fact that > XRSTOR{,S} aren't all-or-nothing instructions. The new code, first of > all, does all the recovery actions in C, simplifying the inline > assembly used. And it does its work in a multi-stage fashion: Upon > first seeing a fault, state fixups get applied strictly based on what > architecturally may cause #GP. When seeing another fault despite the > fixups done, state gets fully reset. A third fault would then lead to > crashing the domain (instead of hanging the hypervisor in an infinite > loop of recurring faults). > > Reported-by: Harmandeep Kaur > Signed-off-by: Jan Beulich > --- > v2: Fix default MXCSR mask value. Avoid infinite fault recovery loop. Reviewed-by: Andrew Cooper