From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932924AbbEETw3 (ORCPT ); Tue, 5 May 2015 15:52:29 -0400 Received: from mga03.intel.com ([134.134.136.65]:45484 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932083AbbEETw1 (ORCPT ); Tue, 5 May 2015 15:52:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,374,1427785200"; d="scan'208";a="690388573" Message-ID: <55491F7A.80603@linux.intel.com> Date: Tue, 05 May 2015 12:52:26 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Ingo Molnar , linux-kernel@vger.kernel.org CC: Andy Lutomirski , Borislav Petkov , Fenghua Yu , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner Subject: Re: [PATCH 198/208] x86/fpu: Document the various fpregs state formats References: <1430848712-28064-1-git-send-email-mingo@kernel.org> <1430848712-28064-38-git-send-email-mingo@kernel.org> In-Reply-To: <1430848712-28064-38-git-send-email-mingo@kernel.org> 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/05/2015 10:58 AM, Ingo Molnar wrote: > +/* > + * This is our most modern FPU state format, as saved by the XSAVE > + * and restored by the XRSTOR instructions. > + * > + * It consists of a legacy fxregs portion, an xstate header and > + * subsequent fixed size areas as defined by the xstate header. > + * Not all CPUs support all the extensions. > + */ > struct xregs_state { > struct fxregs_state i387; > struct xstate_header header; > @@ -150,6 +169,13 @@ struct xregs_state { > /* New processor state extensions will go here. */ > } __attribute__ ((packed, aligned (64))); Fenghua has a "fix" for this, but I think this misses a pretty big point. This structure includes only the "legacy" state, followed by the header. The remainder of the layout here is enumerated in CPUID leaves and can not be laid out in a structure because we do not know what it looks like until we run CPUID. There is logically a variable length array at the end of this sucker.