From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751491AbcEJRIr (ORCPT ); Tue, 10 May 2016 13:08:47 -0400 Received: from mga11.intel.com ([192.55.52.93]:13612 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbcEJRIq (ORCPT ); Tue, 10 May 2016 13:08:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,605,1455004800"; d="scan'208";a="950252733" Subject: Re: [PATCH v5 02/13] x86/xsaves: Rename xstate_size to kernel_xstate_size to explicitly distinguish xstate size in kernel from user space To: Borislav Petkov , Yu-cheng Yu References: <20160510170130.GE28520@pd.tnic> Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Andy Lutomirski , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu From: Dave Hansen Message-ID: <5732159C.6030202@linux.intel.com> Date: Tue, 10 May 2016 10:08:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160510170130.GE28520@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/10/2016 10:01 AM, Borislav Petkov wrote: >> > pr_info("x86/fpu: Enabled xstate features 0x%llx, context size is %d bytes, using '%s' format.\n", >> > xfeatures_mask, >> > - xstate_size, >> > + kernel_xstate_size, >> > cpu_has_xsaves ? "compacted" : "standard"); > I think we should dump user_xstate_size in the compacted case since it > is != kernel_xstate_size. Why? "kernel_xstate_size" is important to the kernel because it impacts task_struct size. But the kernel never actually stores "user_xstate_size" anywhere or really ever even cares about it except when copying in/out of userspace. "user_xstate_size" is also entirely enumerable in userspace with a single cpuid instruction. It's nice to dump out interesting data in dmesg, but I'm curious why you think it's interesting.