Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbbEFMq1 (ORCPT ); Wed, 6 May 2015 08:46:27 -0400 Received: from mail-wg0-f66.google.com ([74.125.82.66]:35105 "EHLO mail-wg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbbEFMqX (ORCPT ); Wed, 6 May 2015 08:46:23 -0400 From: Ingo Molnar X-Google-Original-From: Ingo Molnar Date: Wed, 6 May 2015 14:46:19 +0200 To: Ingo Molnar Cc: Dave Hansen , linux-kernel@vger.kernel.org, Andy Lutomirski , Borislav Petkov , Fenghua Yu , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner Subject: Re: [PATCH 084/208] x86/fpu: Rename xsave.header::xstate_bv to 'xfeatures' Message-ID: <20150506124618.GA18655@gmail.com> References: <1430848300-27877-1-git-send-email-mingo@kernel.org> <1430848300-27877-6-git-send-email-mingo@kernel.org> <554904A6.8040503@linux.intel.com> <20150505181613.GA28562@gmail.com> <55490B1F.3080409@linux.intel.com> <20150506061603.GA13720@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150506061603.GA13720@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 Content-Length: 1907 Lines: 60 * Ingo Molnar wrote: > > XSTATE_BV is the set of states written to the xsave area. > > > > XCOMP_BV is essentially always XCR0 (aka pcntxt_mask, aka > > xfeatures_mask) or'd with bit 63. > > So how about this naming: > > /* > * Mask of xstate components currently not in init state, > * typically written to by XSAVE*. > */ > u64 xfeat_mask_used; /* SDM: XSTATE_BV */ > > /* > * Mask of all state components saved/restored, plus the > * compaction flag. (Note that the XRSTORS instruction caches > * this value, and the next SAVES done for this same > * area expects it to match, before it can perform the 'were > * these registers modified' hardware optimization.) > */ > u64 xfeat_mask_all; /* SDM: XCOMP_BV */ > > (Note that I kept the SDM name easily greppable.) Hm, so the problem with this naming is that for non-compacted XRSTOR, XCOMP_BV has to be zero. (This seems nonsensical btw., as there's a separate 'compaction' flag at bit 63 already.) So a better name would be: /* * Mask of xstate components currently not in init state, * typically written to by XSAVE*. */ u64 xfeat_used_mask; /* SDM: XSTATE_BV */ /* * This mask is non-zero if the CPU supports state compaction: * it is the mask of all state components to be saved/restored, * plus the compaction flag at bit 63. * (Note that the XRSTORS instruction caches this value, and * the next SAVES done for this same area expects it to match, * before it can perform the 'were these registers modified' * hardware optimization.) */ u64 xfeat_comp_mask; /* SDM: XCOMP_BV */ ? Thanks, Ingo -- 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/