Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933262AbbEEW4V (ORCPT ); Tue, 5 May 2015 18:56:21 -0400 Received: from mga14.intel.com ([192.55.52.115]:38131 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752533AbbEEW4U convert rfc822-to-8bit (ORCPT ); Tue, 5 May 2015 18:56:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,375,1427785200"; d="scan'208";a="721255500" From: "Yu, Fenghua" To: Dave Hansen , Ingo Molnar , "linux-kernel@vger.kernel.org" CC: Andy Lutomirski , Borislav Petkov , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , "Thomas Gleixner" Subject: RE: [PATCH 198/208] x86/fpu: Document the various fpregs state formats Thread-Topic: [PATCH 198/208] x86/fpu: Document the various fpregs state formats Thread-Index: AQHQh11NKWTnwfKnZ0iKhYQpD/a0Xp1uQKMA//+9NTA= Date: Tue, 5 May 2015 22:55:59 +0000 Message-ID: <3E5A0FA7E9CA944F9D5414FEC6C712205C8D6274@ORSMSX106.amr.corp.intel.com> References: <1430848712-28064-1-git-send-email-mingo@kernel.org> <1430848712-28064-38-git-send-email-mingo@kernel.org> <55491F7A.80603@linux.intel.com> In-Reply-To: <55491F7A.80603@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1698 Lines: 40 > From: Dave Hansen [mailto:dave.hansen@linux.intel.com] > Sent: Tuesday, May 05, 2015 12:52 PM > To: Ingo Molnar; linux-kernel@vger.kernel.org > Cc: Andy Lutomirski; Borislav Petkov; Yu, Fenghua; H. Peter Anvin; Linus > Torvalds; Oleg Nesterov; Thomas Gleixner > Subject: Re: [PATCH 198/208] x86/fpu: Document the various fpregs state > formats > > 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. Here is the "fix" patch Dave referred to: https://lkml.org/lkml/2015/4/22/9 > > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/