From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751724AbbCKRgE (ORCPT ); Wed, 11 Mar 2015 13:36:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbbCKRgC (ORCPT ); Wed, 11 Mar 2015 13:36:02 -0400 Date: Wed, 11 Mar 2015 18:33:46 +0100 From: Oleg Nesterov To: Dave Hansen , Borislav Petkov , Ingo Molnar Cc: Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH 0/4] x86/fpu: avoid math_state_restore() on kthread exec Message-ID: <20150311173346.GB5032@redhat.com> References: <54F74F59.5070107@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F74F59.5070107@intel.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. This should "fix" the kernel crash observed by Dave. But let me repeat once again, the problem is that fpu_finit() is buggy on Dave's machine. This series should "hide" this problem, we need to fix it later anyway. I was going to do these changes anyway, math_state_restore() was only used because we did not have the necessary helpers. I was going to start with init_fpu() cleanups, but since math_state_restore() makes this fpu_finit() bug more visible lets remove it first. Note that init_fpu() + user_fpu_begin() is racy, used_math() is already set so __switch_to() in between can do restore_fpu_checking() too and trigger the same GPF. But this is fine (to some degree), the task won't be killed. And this is just another proof that init_fpu() should not set used_math() and it and its users need more cleanups. More to come tomorrow. Oleg.