Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752693AbcD2UBt (ORCPT ); Fri, 29 Apr 2016 16:01:49 -0400 Received: from mga02.intel.com ([134.134.136.20]:13745 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbcD2UBs (ORCPT ); Fri, 29 Apr 2016 16:01:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,553,1455004800"; d="scan'208";a="694468392" Date: Fri, 29 Apr 2016 12:57:41 -0700 From: Yu-cheng Yu To: Dave Hansen Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu Subject: Re: [PATCH v4 0/10] x86/xsaves: Fix XSAVES known issues Message-ID: <20160429195741.GA15402@test-lenovo> References: <5723A353.7060209@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5723A353.7060209@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 608 Lines: 7 On Fri, Apr 29, 2016 at 11:09:23AM -0700, Dave Hansen wrote: > Once we *HAVE* XSAVES support, it also opens up the possibilities for > doing things like dynamic XSAVE buffer allocation. For instance, let > threads that are not _using_ AVX-512 not waste the 2k of space for it. If we can somehow modify exec* system call to scan the executable binary (in user space) and pass along a bitmask containing xfeatures used in the binary, and XSAVES is enabled in the kernel, we can easily save a lot of memory. The kernel only needs to allocate space for tasks that actually use xstates; most of them do not.