From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754019AbcEJABZ (ORCPT ); Mon, 9 May 2016 20:01:25 -0400 Received: from mga09.intel.com ([134.134.136.24]:34266 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585AbcEJABV (ORCPT ); Mon, 9 May 2016 20:01:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,602,1455004800"; d="scan'208";a="802621479" Subject: Re: [PATCH v5 12/13] x86/xsaves: Fix fpstate_init() for XSAVES To: Yu-cheng Yu References: <9c6c58a0a4a66568b8e887944d2426d59370ae05.1462816638.git.yu-cheng.yu@intel.com> <5731202B.2050805@linux.intel.com> <20160509235042.GB28442@test-lenovo> Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu From: Dave Hansen Message-ID: <573124CC.8010505@linux.intel.com> Date: Mon, 9 May 2016 17:01:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160509235042.GB28442@test-lenovo> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2016 04:50 PM, Yu-cheng Yu wrote: >> > >> > Oh, and if you decided to do this for some reason, please have mercy and >> > go make a macro for 1<<63. >> > >> > Also, I don't think the kernel ever checks for this bit. So are we >> > really calling XRSTORS on otherwise uninitialized xsave buffers? > Right now if we do fpstate_init(), without this patch, it will > trigger a warning from copy_kernel_to_fxregs() when the task is > scheduled. Please include this in the patch description. It's a pretty important piece of justification. Did you mean "copy_kernel_to_xregs()" without the "f"? I think we should probably also have an _explicit_ FPU_WARN_ON() in the XRSTORS path for this. *Both* the booting and regular ones, btw...