From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754325AbbDRUPY (ORCPT ); Sat, 18 Apr 2015 16:15:24 -0400 Received: from mga11.intel.com ([192.55.52.93]:56264 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397AbbDRUPS (ORCPT ); Sat, 18 Apr 2015 16:15:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,600,1422950400"; d="scan'208";a="697376682" From: "Fenghua Yu" To: "H. Peter Anvin" , "Ingo Molnar" , "Thomas Gleixner" , "Asit K Mallick" , "Dave Hansen" , "Glenn Williamson" Cc: "linux-kernel" , "x86" , "Fenghua Yu" Subject: [PATCH Bugfix 4/4] x86/xsave: Don't add new states in xsave_struct Date: Sat, 18 Apr 2015 13:12:08 -0700 Message-Id: <1429387928-28179-4-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 1.8.0.1 In-Reply-To: <1429387928-28179-1-git-send-email-fenghua.yu@intel.com> References: <1429387928-28179-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fenghua Yu The structure of xsave_struct is non-architectural. Some xstates could be disabled and leave some holes in the xsave area. In compact format, offsets of xstates in the xsave area are decided during booting time. So the fields in xsave_struct are not static and fixed during compilation time. The offsets and sizes of the fields in the structure should be detected from cpuid during runtime. Therefore, we don't add new states in xsave_struct except legacy fpu/sse states and header fields whose offsets and sizes are defined architecturally. Signed-off-by: Fenghua Yu Reviewed-by: Dave Hansen --- arch/x86/include/asm/processor.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index f26051b..163defc 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -386,16 +386,6 @@ struct i387_soft_struct { u32 entry_eip; }; -struct ymmh_struct { - /* 16 * 16 bytes for each YMMH-reg = 256 bytes */ - u32 ymmh_space[64]; -}; - -/* We don't support LWP yet: */ -struct lwp_struct { - u8 reserved[128]; -}; - struct bndreg { u64 lower_bound; u64 upper_bound; @@ -415,11 +405,11 @@ struct xsave_hdr_struct { struct xsave_struct { struct i387_fxsave_struct i387; struct xsave_hdr_struct xsave_hdr; - struct ymmh_struct ymmh; - struct lwp_struct lwp; - struct bndreg bndreg[4]; - struct bndcsr bndcsr; - /* new processor state extensions will go here */ + /* + * Please don't add more states here. They are non-architectural. + * Offset and size of each state should be calculated during boot time. + * So adding states here is meanless. + */ } __attribute__ ((packed, aligned (64))); union thread_xstate { -- 1.8.1.2