From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756688AbbHZQSf (ORCPT ); Wed, 26 Aug 2015 12:18:35 -0400 Received: from mga14.intel.com ([192.55.52.115]:9141 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752473AbbHZQSd (ORCPT ); Wed, 26 Aug 2015 12:18:33 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,416,1437462000"; d="scan'208";a="632677053" Message-ID: <1440605901.24132.2.camel@schen9-desk2.jf.intel.com> Subject: Re: [PATCH 11/11] x86, fpu: check CPU-provided sizes against struct declarations From: Tim Chen To: Dave Hansen Cc: dave.hansen@linux.intel.com, mingo@redhat.com, x86@kernel.org, bp@alien8.de, fenghua.yu@intel.com, linux-kernel@vger.kernel.org Date: Wed, 26 Aug 2015 09:18:21 -0700 In-Reply-To: <20150825201206.93136028@viggo.jf.intel.com> References: <20150825201201.CF766C1B@viggo.jf.intel.com> <20150825201206.93136028@viggo.jf.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-08-25 at 13:12 -0700, Dave Hansen wrote: > From: Dave Hansen > > We now have C structures defined for each of the XSAVE state > components that we support. This patch adds checks during our > verification pass to ensure that the CPU-provided data > enumerated in CPUID leaves matches our C structures. > > If not, we warn and dump all the XSAVE CPUID leaves. > > Note: this *actually* found an inconsistency with the MPX > 'bndcsr' state. The hardware pads it out differently from > our C structures. This patch caught it and warned. > > Signed-off-by: Dave Hansen > Cc: Ingo Molnar > Cc: x86@kernel.org > Cc: Borislav Petkov > Cc: Fenghua Yu > Cc: Tim Chen > Cc: linux-kernel@vger.kernel.org > --- > > b/appendme | 6 +++ > b/arch/x86/include/asm/fpu/types.h | 1 > b/arch/x86/kernel/fpu/xstate.c | 62 +++++++++++++++++++++++++++++++++++-- > 3 files changed, 67 insertions(+), 2 deletions(-) > > diff -puN /dev/null appendme > --- /dev/null 2015-07-13 14:24:11.435656502 -0700 > +++ b/appendme 2015-08-25 12:50:01.857661314 -0700 > @@ -0,0 +1,6 @@ > +Cc: Ingo Molnar > +Cc: x86@kernel.org > +Cc: Borislav Petkov > +Cc: Fenghua Yu > +Cc: Tim Chen > +Cc: linux-kernel@vger.kernel.org > diff -puN arch/x86/include/asm/fpu/types.h~x86-fpu-check-against-struct-declarations arch/x86/include/asm/fpu/types.h > --- a/arch/x86/include/asm/fpu/types.h~x86-fpu-check-against-struct-declarations 2015-08-25 12:50:01.853661133 -0700 > +++ b/arch/x86/include/asm/fpu/types.h 2015-08-25 12:50:01.858661359 -0700 > @@ -108,6 +108,7 @@ enum xfeature_nr { > XFEATURE_NR_OPMASK, > XFEATURE_NR_ZMM_Hi256, > XFEATURE_NR_Hi16_ZMM, > + XFEATURE_NR_PT_UNIMPLEMENTED_SO_FAR, > Maybe move this to a separate patch with a bit more explanation of this XFEATURE? Tim