From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbcBYUbc (ORCPT ); Thu, 25 Feb 2016 15:31:32 -0500 Received: from mga03.intel.com ([134.134.136.65]:25707 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbcBYUbK (ORCPT ); Thu, 25 Feb 2016 15:31:10 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="911350556" From: Yu-cheng Yu To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org Cc: Dave Hansen , Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu , Yu-cheng Yu Subject: [PATCH v2 9/9] x86/xsaves: Re-enable XSAVES Date: Thu, 25 Feb 2016 12:26:20 -0800 Message-Id: <8687eb3f43f4a2a4cc2c21f38c5f420631662fd3.1456420312.git.yu-cheng.yu@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We did not handle XSAVES* instructions correctly. There were issues in converting between standard and compacted format when interfacing with user-space. These issues have been corrected. Signed-off-by: Yu-cheng Yu --- arch/x86/kernel/fpu/init.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index b5952d5..21e0d52 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -228,19 +228,11 @@ static void __init fpu__init_system_xstate_size_legacy(void) user_xstate_size = kernel_xstate_size; /* - * Quirk: we don't yet handle the XSAVES* instructions - * correctly, as we don't correctly convert between - * standard and compacted format when interfacing - * with user-space - so disable it for now. - * - * The difference is small: with recent CPUs the - * compacted format is only marginally smaller than - * the standard FPU state format. - * - * ( This is easy to backport while we are fixing - * XSAVES* support. ) + * Most recent CPUs supporting XSAVES can run 64-bit mode. + * Enable XSAVES for 64-bit. */ - setup_clear_cpu_cap(X86_FEATURE_XSAVES); + if (!config_enabled(CONFIG_X86_64)) + setup_clear_cpu_cap(X86_FEATURE_XSAVES); } /* -- 1.9.1