Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp990283imm; Wed, 19 Sep 2018 10:06:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaMYyEyqDOpyrY3o87j6oms1GHv9OWLcYoyMLaHbB+vWenWKxtULhdrI+V8brnyKam4RkOb X-Received: by 2002:a63:ee15:: with SMTP id e21-v6mr33293503pgi.421.1537376781789; Wed, 19 Sep 2018 10:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537376781; cv=none; d=google.com; s=arc-20160816; b=uOMlZahgvnSUefPgRh8l2YxQfcv2FW9qyHqXq6FIcvLyO5sw+9Hcw33/cnj5Br5281 Z3Kpx8swIy/FPexLLTASpvviFd/XixIAP/oTcceiDg8kBkimsLM9u18ydD2F7513BtCd 87eDFLA4EqwNjcEhAwzbPaDoH/Djw20CTxcog2NL70/5rh6tkxByDjaJ0hWJnxlmjijL zi5Nt2qIQaQnNA/cdHp0AOwv1puSXKVWiq+GmZ/oLgCRSbXBlFMgz3iSftYKMRnbpgva aVRDytAv6i2s1IakqDsrNo9WyQPYMIY6akHXzxXNSc+CcT6+o0g0K8H3KMpzAVkm4vZZ szIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fKi+zDimVnyMz94VlZszZ4qtGGXSnHnkk+lDZv7KocQ=; b=qrBoCKmsXk8zsuiWZkGQtQZySZDDN8J3EtNyqnr8AecrLo2oY9FRxnDTASBaHKRf9v 1ZqFNS0ywnS3zLdya3Sv0OxE8BD+EUTL7WfjQSasDa/hY1v+8o8FxI8hA6wea7ndRhlV mhHnfgN8T8Ov/XRbBYcrDi2kkoq8tu648Vor9tY9tUAFUP4zoLaKn1/6wbBiLnYx0WhI YKCb1tGc4/pHTliMfSTCfcahBoY5mAZ8UA/H64btXIsUdvj1jWg5drUcQktrMx5Cmh9d EfvYKu3eoBCtcA9xGvBpiCvC7hNoBXqxGKos35jNHfR10L/YnKWtpNZWWcYS8B5P2ugr 81fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21-v6si21706500pfo.68.2018.09.19.10.06.05; Wed, 19 Sep 2018 10:06:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732797AbeISWgM (ORCPT + 99 others); Wed, 19 Sep 2018 18:36:12 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:33006 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732663AbeISWgM (ORCPT ); Wed, 19 Sep 2018 18:36:12 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1g2fmy-0006Od-6S; Wed, 19 Sep 2018 18:57:20 +0200 Date: Wed, 19 Sep 2018 18:57:20 +0200 From: Sebastian Andrzej Siewior To: Paolo Bonzini Cc: Rik van Riel , linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, "Jason A. Donenfeld" Subject: Re: [RFC PATCH 04/10 v2 ] x86/fpu: eager switch PKRU state Message-ID: <20180919165719.iepvc7tg6aabp5mm@linutronix.de> References: <8e5b64e4-b3e6-f884-beb6-b7b69ab2d8c1@redhat.com> <20180914203501.qibhpmueosvkr74w@linutronix.de> <20180918142701.atfb4ul45k7tl6ew@linutronix.de> <7e9a13f3-93f5-fe4a-20d2-f4f9407bd43b@redhat.com> <83e271e1298d603c1105dd0dbea32d67da9cf1fa.camel@surriel.com> <36e8493f-f994-e885-8fe6-2f0d4a9904a1@redhat.com> <20180918160419.2zeru6xnufxixcax@linutronix.de> <11aa7d0f4ba36eff8b61a5dc1bd35ee5195fd576.camel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-09-19 07:55:51 [+0200], Paolo Bonzini wrote: > A kthread can do use_mm/unuse_mm. indeed. The FPU struct for the kernel thread isn't valid / does not contain the expected PKRU value. So loading the pkru value from the struct FPU does not work as expected. We could set it to 0 for a kernel thread so we don't end up with a random value. If we want to get this usecase working then we would have to move pkru value from FPU to mm_struct and consider it in use_mm(). Do we want this? > Paolo Sebastian