Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbcD2SJ0 (ORCPT ); Fri, 29 Apr 2016 14:09:26 -0400 Received: from mga04.intel.com ([192.55.52.120]:46396 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbcD2SJZ (ORCPT ); Fri, 29 Apr 2016 14:09:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,552,1455004800"; d="scan'208";a="795202949" Subject: Re: [PATCH v4 0/10] x86/xsaves: Fix XSAVES known issues To: Yu-cheng Yu , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org References: Cc: Andy Lutomirski , Borislav Petkov , Sai Praneeth Prakhya , "Ravi V. Shankar" , Fenghua Yu From: Dave Hansen Message-ID: <5723A353.7060209@linux.intel.com> Date: Fri, 29 Apr 2016 11:09:23 -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: 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: 1459 Lines: 35 Hi Folks, I've heard through the grapevine that there's some concern that we should not be bothering to enable XSAVES because there's not a sufficient use case for it. Maybe it's meager today, but I still think we should do it. I'll try to lay out why. Today, on every Skylake system, this patch saves 128 bytes in each task_struct. If there were an Atom system with XSAVES it would save 384 bytes since there is no AVX support on Atom. If there were a future processor which has an xstate _past_ AVX-512, but that does not have AVX-512 itself, that savings goes up to 2048+384 bytes. I believe it is *inevitable* that the savings will become substantial. Plus, if the processors ever start supporting a supervisor state that we _need_ in Linux, we have to XSAVES support anyway. It's inevitable that we _will_ need it. Why do it today? Now that Skylake is out, we _can_ get reasonable testing of this feature from early adopters in the wild. If we turn this on today, and it breaks, we break a relatively modest number of Skylake systems (1%? 2%? 0.1%?). Let's say we wait $X years when the benefits are greater. We turn it on, and something breaks. We'll break 50% (or 40% or whatever) of the systems in production. 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. So why wait?