From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbbBPVby (ORCPT ); Mon, 16 Feb 2015 16:31:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54561 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbbBPVbx (ORCPT ); Mon, 16 Feb 2015 16:31:53 -0500 Message-ID: <54E2618A.9090203@redhat.com> Date: Mon, 16 Feb 2015 16:30:50 -0500 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Borislav Petkov , oleg@redhat.com CC: dave.hansen@linux.intel.com, sbsiddha@gmail.com, luto@amacapital.net, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, fenghua.yu@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] x86, fpu: kill save_init_fpu(), change math_error() to use unlazy_fpu() References: <1423252925-14451-1-git-send-email-riel@redhat.com> <1423252925-14451-4-git-send-email-riel@redhat.com> <20150216210938.GN4458@pd.tnic> In-Reply-To: <20150216210938.GN4458@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/16/2015 04:09 PM, Borislav Petkov wrote: > On Fri, Feb 06, 2015 at 03:02:00PM -0500, riel@redhat.com wrote: >> From: Oleg Nesterov >> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c >> index fb4cb6adf225..51c465846f06 100644 --- >> a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -663,7 >> +663,7 @@ static void math_error(struct pt_regs *regs, int >> error_code, int trapnr) /* * Save the info for the exception >> handler and clear the error. */ - save_init_fpu(task); + >> unlazy_fpu(task); > > Do I see it correctly that even with this there's a not-so-small > hole *after* conditional_sti() and *before* unlazy_fpu() where > caller can still get preempted? That's ok, the context switch will save the register contents to memory in that case. At that point unlazy_fpu will potentially do nothing, and the task will process the FPU context that was saved to memory previously. - -- All rights reversed -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU4mGKAAoJEM553pKExN6DHoAH/1R3Pak5bZrvnCEBd3lp9/uD bqtms5VjiWNNhlG0Hpob0eS71p8fO9La8+hPwFQJdK9yZ2lwvrDEXMCMGOG1P8by HHbtxS74tUIm49qlIIUNxoiI+HMDnOQNhYv9dA4VdTMcY//2Asr6g4LM3wFH+f1q tZJ5CU5/f0g2SCtTEzXxZDQdlqgpGXpvcGVymENe45uzn5ZYgcbCAiix+Dy5SiCw +GjURoRW07iRSvK48w8vTVstTwl2WKgHpWEGVGhL1RyJY6aMIft3b4FH1jUrhVVJ w3ncQAptA2ry/anU/6A2aTrZ646ebJuYejhF99gwTucolJ3netdX7xohOaFEpSc= =/rU9 -----END PGP SIGNATURE-----