From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755116AbbHFI3Q (ORCPT ); Thu, 6 Aug 2015 04:29:16 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:34968 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754985AbbHFI3N (ORCPT ); Thu, 6 Aug 2015 04:29:13 -0400 Date: Thu, 6 Aug 2015 10:29:09 +0200 From: Ingo Molnar To: Linus Torvalds Cc: Peter Anvin , Denys Vlasenko , Thomas Gleixner , linux-kernel@vger.kernel.org, Andy Lutomirski , bp@alien8.de, Peter Zijlstra , fenghua.yu@intel.com, x86@kernel.org, dave.hansen@linux.intel.com, Dave Hansen Subject: Re: [PATCH] x86, fpu: correct XSAVE xstate size calculation Message-ID: <20150806082909.GA13169@gmail.com> References: <20150728172143.6DDFECA7@viggo.jf.intel.com> <20150805103227.GA3233@gmail.com> <55C21EFC.3060802@sr71.net> <20150806071545.GB2194@gmail.com> <20150806082746.GA10974@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150806082746.GA10974@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ingo Molnar wrote: > > * Linus Torvalds wrote: > > > On Aug 6, 2015 10:15 AM, "Ingo Molnar" wrote: > > > > > > What sense does it make to have a blob we don't know the exact layout of? How > > > will debuggers or user-space in general be able to print (and change) the > > > register values if they don't know the layout? > > > > The usage model is that you only use this for saving and restoring state. > > > > If you look at the state, you restore the state and then you look at the > > registers. You never look at the blob itself. > > So we are relying on the saved structure already in a couple of cases, such as MPX > exception handling: > > /* > * We need to look at BNDSTATUS to resolve this exception. > * A NULL here might mean that it is in its 'init state', > * which is all zeros which indicates MPX was not > * responsible for the exception. > */ > bndcsr = get_xsave_field_ptr(XSTATE_BNDCSR); > if (!bndcsr) > goto exit_trap; > > trace_bounds_exception_mpx(bndcsr); > > get_xsave_field_ptr() very much knows about the structure. Correction: get_xsave_field_ptr() users very much know about the structure. Thanks, Ingo