Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654AbbLUXFr (ORCPT ); Mon, 21 Dec 2015 18:05:47 -0500 Received: from mga09.intel.com ([134.134.136.24]:7930 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752004AbbLUXFp (ORCPT ); Mon, 21 Dec 2015 18:05:45 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,461,1444719600"; d="scan'208";a="846103288" Subject: Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? To: Andy Lutomirski References: <567453AF.5060808@linux.intel.com> <56746774.8000707@linux.intel.com> <567476CC.8080805@linux.intel.com> <5678310D.2010104@linux.intel.com> <56788478.9050805@linux.intel.com> Cc: Thomas Gleixner , Borislav Petkov , Oleg Nesterov , Ingo Molnar , Christoph Hellwig , "linux-kernel@vger.kernel.org" , Brian Gerst , "H. Peter Anvin" , Linus Torvalds , Rik van Riel From: Dave Hansen Message-ID: <567885AE.9000202@linux.intel.com> Date: Mon, 21 Dec 2015 15:05:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: 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 Content-Length: 1398 Lines: 32 On 12/21/2015 03:02 PM, Andy Lutomirski wrote: > On Mon, Dec 21, 2015 at 3:00 PM, Dave Hansen > wrote: >> On 12/21/2015 02:52 PM, Andy Lutomirski wrote: >>> Perhaps this is silly, but what if the default were changed to deny >>> reads and writes for unallocated keys? Is there a use case that >>> breaks? >> >> It's probably a reasonable debugging feature. >> >> But, anything that takes an XSAVE feature out of its "init state" has >> the potential to do a bit of harm because it increases the potential >> size of writes during XSAVE. XSAVEOPT will _help_ here, but we probably >> don't want to go out of our way to take things out of the init state >> when we're unsure of the benefits. > > Aren't you already doing that with your magic execute-only thing? Yep, but that's with a concrete benefit in mind. > Also, if we ever do the deferred-xstate-restore thing that Rik was > playing with awhile back, then we'll want to switch to using rdpkru > and wrpkru in-kernel directly, and we'll explicitly mask PKRU out of > the XRSTOR and XSAVEOPT state, and this particular issue will become > irrelevant. Yep, agreed. -- 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/