Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp579649pxj; Fri, 28 May 2021 10:21:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/GNO8/hzIkYVLOMVOu4wdTULC6WyGdj1gZsIEKBr2WN7mkhA35uLz5FiIVvAcrzjG2b3F X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr9530470jav.84.1622222491112; Fri, 28 May 2021 10:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622222491; cv=none; d=google.com; s=arc-20160816; b=WhiYLwgn7cwngtVm91Ea5YMrw/L5GDc9vnxtkK5PGxVGzHIhElQT/w4aCiLM0+q8an Df2BUzFBhvebbI5aCLMdPYdQBPUut0e9ZqcCbOsJv2edaSmFnad2tqW37uk3Ps3IFsur nexZdXwoLOMOkkDUV6bYyiSAriTq+HaxSxn66KKk5lv4bJsjrpBfSsGg3/+Xk7YrZ6dH gk4YaW9npaWDUgw8aMZXMllXZ1rpv8XmanR2/CQzZA/wWVnEgFcUfShrZ4n2e0fVhhZH LHH7Hy4H+gC9a9R0+NjdCZMvgosfFRon9H+IjyuJsoMMY3BgkG5tsj/wJs7PntUHLhkv pChA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=7XXMkpQsbehg+qNK7ZVP15wb2+6lgaNxZ16dFAzSN/o=; b=OUt1wTPJ13FBAc2jP47s/0xPN4007dcJYtxjWKzbWKgxKH0EiofKyDKAQgl2lm1A0l Dd5xL1umYmC41WMyNEzlqvISXubSy11IgZNZ/2cSHToLM7IDY9TJBx+gdSkX5alOsD50 Cc8NeoH4/h2B042odyF8+vtLhtZTajW4U234bzzo6uHeHOpM1GUWvlecb0dcvTR0TjCT ZXKGTizPdJmSNiYM6JJllnBy6Utaka0iRyEX2yB9ChnnzWItvg3JD7Cgv2yQm2CVKj4+ 8FUGJTWwZFj3Tg7tvSPzh1lWofRnDspVUUOI/gb+pmFWsKYQzmWWLuWieMtOhGRd6paG rWXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EuPc6Lj5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=gUaXmYno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si6436672jaj.29.2021.05.28.10.21.18; Fri, 28 May 2021 10:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EuPc6Lj5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=gUaXmYno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235289AbhE1RUh (ORCPT + 99 others); Fri, 28 May 2021 13:20:37 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42392 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbhE1RUh (ORCPT ); Fri, 28 May 2021 13:20:37 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1622222341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7XXMkpQsbehg+qNK7ZVP15wb2+6lgaNxZ16dFAzSN/o=; b=EuPc6Lj5b9dnblHQPS+OwPpQ7zcB8NAYy/kfsmS7bO4+Hx0QEUEPE864ApUB8ZRLpnr+dV hUiPgLtRO3dOJKQuh/64xShuq74ZQCjsfxSyBvZWar2Z2KifbCPmhR3eSTxXCe51oAYL0U 0PvaD/UXFh+vnsiMwS8r/ervoWmCCbS9HjbphDKPzhAQOfrMd2FSCXYqGKqvJgo5IfKd3Y 00zLxNodFIcWXF7yN2rBZg/84RXs061KXOQsc5fiLFs+9YfPlGI14CATq4IlTY7AfUnJIM uBeSV0DB+ydUr8WoXo7eVeC0MgREjx3vWAHq1X0W5lHkf2GUt2dVYrSCB2kx1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1622222341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7XXMkpQsbehg+qNK7ZVP15wb2+6lgaNxZ16dFAzSN/o=; b=gUaXmYnowiug3bVJ1B45870TyHL7gfy7S310FEOStjQTVAwFwRfASjTeLpewx7IkJ6VHkq 6C60yQ4MUIupmQCw== To: Dave Hansen , Dave Hansen , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, bp@alien8.de, x86@kernel.org, luto@kernel.org, shuah@kernel.org, babu.moger@amd.com, dave.kleikamp@oracle.com, linuxram@us.ibm.com, bauerman@linux.ibm.com Subject: Re: [PATCH 0/5] x86/pkeys: PKRU manipulation bug fixes and cleanups In-Reply-To: <4c3bfc27-a542-8e91-7ccf-4be8b1e6c844@intel.com> References: <20210527235109.B2A9F45F@viggo.jf.intel.com> <87eedq7u2b.ffs@nanos.tec.linutronix.de> <4c3bfc27-a542-8e91-7ccf-4be8b1e6c844@intel.com> Date: Fri, 28 May 2021 19:19:00 +0200 Message-ID: <878s3y7p4r.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28 2021 at 09:11, Dave Hansen wrote: > On 5/28/21 8:32 AM, Thomas Gleixner wrote: > There are also the usual concerns that folks doing user-level context > switching or other insanity get PKRU context switching for "free" when > it's XSAVE-managed. Moving away from that could break them. Both issues are trivial to solve. We can have pkru enabled in xcr0 and just do not restore it when returning to user space (clear the mask bit). When we restore it in sigrestore via xrstor then we read it via rdpkru afterwards and update task->thread.pkru. Thanks, tglx