Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5479152imm; Wed, 12 Sep 2018 06:38:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYwuwpQdiFDPf4sp5KH2dQii0NELSk+8+z7imQxwOli3i0nWyruh4iCOYyVMdFJyoU4SeJO X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr2435014pfa.111.1536759537689; Wed, 12 Sep 2018 06:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536759537; cv=none; d=google.com; s=arc-20160816; b=sYLFCDd+8tkUv96WQbB7smDHVadkwT3g0Pgu0UgzQWXOSMQ1SQdf4WWL6LvHP1MGrP 4PSzMpRkoKInO1md46jC+imxvWyQ6KQ+TyCQE13D9yDGcPYfThqwIllbocL+gCIB9mSa iX5OKAw+uEp1fvw6Jb5waZJHJCclOsD1RToIWSIFy19wQy9hsnA0C24CrX1SImjyzTE1 Dj9elHQ0OdqIf8yLa224ocJPF5/N0nFoKWcwGeSjd06hHOhbfGSLRDasyEAo8L54GKrL 8ZgQsJe3p6fe152zVmF89/1j8K05wKHNClpLZcL8E/Lg38JkLj2laW1oDmP6Vk2D0Pn/ nFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=am5Puucq6GU5CUB6NmKUaAQrEnKJnmEsnE+cUftoay4=; b=ofbBgyyeRM85a7aj/0Icdx4u8+4Cyav33wQVSY/FnWF4t5K/6gYQ/qp3TsT9WHkMv8 tdx1JAsELe4TN8suhADeJlwUNCtSIkoDrLxV1V4gpYZfpcxwzYkNSA1tkSsxdYdJlxqG eQFcNi/AzdS93vOew5567rCd+jZ2qDdoavXRTDs02OLKDGq7xnDRht0FjZ4bQLmy8p4G K/C3x3Ffuon3/mmMx8NZLaI6cKF96A9ewxP/hGT9ZO9592S/bxRJT0REXW2+s641RVam fBEJ5zsZDGAjsZ1TveYlgDYkIasWVJu7iY1N+gbrkSVTVE0WDOCtQc6Pef5a1HT2sCM9 eoFw== 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 t127-v6si1050557pfc.118.2018.09.12.06.38.35; Wed, 12 Sep 2018 06:38:57 -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 S1728190AbeILSlO (ORCPT + 99 others); Wed, 12 Sep 2018 14:41:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43898 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727752AbeILSkc (ORCPT ); Wed, 12 Sep 2018 14:40:32 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1g05JD-0001Ap-EW; Wed, 12 Sep 2018 15:35:55 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Andy Lutomirski , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Sebastian Andrzej Siewior Subject: [RFC PATCH 05/10] x86/pkeys: Drop the preempt-disable section Date: Wed, 12 Sep 2018 15:33:48 +0200 Message-Id: <20180912133353.20595-6-bigeasy@linutronix.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180912133353.20595-1-bigeasy@linutronix.de> References: <20180912133353.20595-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rik van Riel The fpu->initialized flag should not be changed underneath us. This might be a fallout during the removal of the LazyFPU support. The FPU is marked initialized as soon as the state has been set to an initial value. It does not signal if the CPU's FPU registers are loaded. Signed-off-by: Rik van Riel Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/mm/pkeys.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c index c7a7b6bd64009..6e91529fe2a30 100644 --- a/arch/x86/mm/pkeys.c +++ b/arch/x86/mm/pkeys.c @@ -53,17 +53,13 @@ int __execute_only_pkey(struct mm_struct *mm) * dance to set PKRU if we do not need to. Check it * first and assume that if the execute-only pkey is * write-disabled that we do not have to set it - * ourselves. We need preempt off so that nobody - * can make fpregs inactive. + * ourselves. */ - preempt_disable(); if (!need_to_set_mm_pkey && current->thread.fpu.initialized && !__pkru_allows_read(read_pkru(), execute_only_pkey)) { - preempt_enable(); return execute_only_pkey; } - preempt_enable(); /* * Set up PKRU so that it denies access for everything -- 2.19.0