From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] x86/fpu: CR0.TS should be set before trap into PV guest's #NM exception handler Date: Thu, 27 Feb 2014 12:46:05 +0000 Message-ID: <530F338D.6030107@eu.citrix.com> References: <1383720072-6242-1-git-send-email-gaoyang.zyh@taobao.com> <527A113C02000078000FFF99@nat28.tlf.novell.com> <20140227000405.GA11825@u109add4315675089e695.ant.amazon.com> <530EFEC8020000780011FB81@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1WJ0Lu-0005s0-QY for xen-devel@lists.xenproject.org; Thu, 27 Feb 2014 12:46:15 +0000 In-Reply-To: <530EFEC8020000780011FB81@nat28.tlf.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 , Matt Wilson Cc: Charles Wang , Ian Campbell , Andrew Cooper , Zhu Yanhai , Shen Yiben , David Vrabel , xen-devel , Zhu Yanhai , Wan Jia , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On 02/27/2014 08:00 AM, Jan Beulich wrote: >>>> On 27.02.14 at 01:04, Matt Wilson wrote: >> On Wed, Nov 06, 2013 at 08:51:56AM +0000, Jan Beulich wrote: >>> Nevertheless I agree that there is an issue, but this needs to be >>> fixed on the Linux side (hence adding the Linux maintainers to Cc); >>> this issue was introduced way back in 2.6.26 (before that there >>> was no allocation on that path). It's not clear though whether >>> using GFP_ATOMIC for the allocation would be preferable over >>> stts() before calling the allocation function (and clts() if it >>> succeeded), or whether perhaps to defer the stts() until we >>> actually know the task is being switched out. It's going to be an >>> ugly, Xen-specific hack in any event. >> Was there ever a resolution to this problem? I never saw a comment >> from the Linux Xen PV maintainers. > Neither did I, so no, I'm not aware of a solution. Well we basically have two solutions I think: 1. Add a flag to the guest kernel that requests Xen to keep the TS bit set (and eat the extra cost of the trap on clearing it). 2. In the uncommon case of the first use, set the TS bit again (incurring the cost of the extra trap) before calling allocate. -George