Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbcD2UDq (ORCPT ); Fri, 29 Apr 2016 16:03:46 -0400 Received: from mga14.intel.com ([192.55.52.115]:55502 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbcD2UDp (ORCPT ); Fri, 29 Apr 2016 16:03:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,553,1455004800"; d="scan'208";a="965616312" Subject: Re: [PATCH v4 0/10] x86/xsaves: Fix XSAVES known issues To: Yu-cheng Yu References: <5723A353.7060209@linux.intel.com> <20160429195741.GA15402@test-lenovo> 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 From: Dave Hansen Message-ID: <5723BE1F.7040300@linux.intel.com> Date: Fri, 29 Apr 2016 13:03:43 -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: <20160429195741.GA15402@test-lenovo> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 809 Lines: 15 On 04/29/2016 12:57 PM, Yu-cheng Yu wrote: > 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. That's not feasible. Think of dynamic libraries or just-in-time compilers. What instruction set does /usr/bin/java use, for instance? :)