Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1740459imu; Wed, 28 Nov 2018 14:25:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/VO0/WRl2h3IaA1KiHo66qu7wQht4CthDEUD5RLJFV2yUUDMnXnCj/Z6kWRZTyMLVLEkACL X-Received: by 2002:a62:f907:: with SMTP id o7mr2886969pfh.244.1543443921504; Wed, 28 Nov 2018 14:25:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443921; cv=none; d=google.com; s=arc-20160816; b=VEmZhlr3aP+imBdlMgiSi+KMhcQ3PD0re86Sb1qW6p+ezf8eyPoPAla55TiWE4ppLV vj+NDZrKQNTXhXqKRIxIR37k1vROvDVR6Rs5DIw4dL7Cx2fhQT6d3E1W3S896CID+oUR DMKPPi37hPgomAPOwg1O1E5wD/qsXTkFUTeqPau7lqDpOgcO4Di3wMA56MQvJvUwt+j/ jwyGfmdK222F23+1RWxjE3ut+Z+vw3lY6ihN4AJXH3vgXqWF71BOED7sxh5aBtGgl+LC jbFUPbaZXEMNhMQy7AErKH2cdAc4Ah9OdU6qF9rMBVTuhjztkVnsQkGhZ6WQ8rFWe0zg Mi3w== 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=qvYsgQ9n6TE3S0GTCo0+Hk2mFgqFy5817OxwQBjnKaM=; b=hfKfr88EnAypWrVUBPPTSwFIHeMGWLQzB/zBnbdDNbx7eqKRj4Kj3XVLr/pzsn2HHl ab+5BldjT5AQvX7Qn14JQey09VhThhRUaAORV1RmuvpHEUN1hQ+njv4Q0uq9PzA2rdg1 L94wnWO3uDptZ6o/0Jb+RrN0mXAF4mdTeCmPf5wox9JbYsToLFtAu63rdFU3pnnGsgvQ rPPXHZx/aViUiWG6jy1zksfPQsc0dgN9ECJsqkOMtVG8hrSlXf0qY84Kb6PF/UGxj7wV IvttNVn2m/42XtgDu23Z+HGB0TpWXRbEU7nr5j8FCK04/mYDRrrWJWzjcFv74b5Fxn1y 84Ug== 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 e39si9261166plg.388.2018.11.28.14.25.07; Wed, 28 Nov 2018 14:25:21 -0800 (PST) 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 S1727303AbeK2J0d (ORCPT + 99 others); Thu, 29 Nov 2018 04:26:33 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33102 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbeK2JYN (ORCPT ); Thu, 29 Nov 2018 04:24:13 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gS8Cb-0001GX-19; Wed, 28 Nov 2018 23:21:01 +0100 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 , Dave Hansen , Sebastian Andrzej Siewior Subject: [PATCH 10/29] x86/fpu: Remove preempt_disable() in fpu__clear() Date: Wed, 28 Nov 2018 23:20:16 +0100 Message-Id: <20181128222035.2996-11-bigeasy@linutronix.de> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181128222035.2996-1-bigeasy@linutronix.de> References: <20181128222035.2996-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 The preempt_disable() section was introduced in commit a10b6a16cdad8 ("x86/fpu: Make the fpu state change in fpu__clear() scheduler-atomic") and it was said to be temporary. fpu__initialize() initializes the FPU struct to its "init" value and then sets ->initialized to 1. The last part is the important one. The content of the `state' does not matter because it gets set via copy_init_fpstate_to_fpregs(). A preemption here has little meaning because the register will always be set to the same content after copy_init_fpstate_to_fpregs(). A softirq with a kernel_fpu_begin() could also force to save FPU's register after fpu__initialize() without changing the outcome here. Remove the preempt_disable() section in fpu__clear(), preemption here does not hurt. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/kernel/fpu/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 1d3ae7988f7f2..1940319268aef 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -366,11 +366,9 @@ void fpu__clear(struct fpu *fpu) * Make sure fpstate is cleared and initialized. */ if (static_cpu_has(X86_FEATURE_FPU)) { - preempt_disable(); fpu__initialize(fpu); user_fpu_begin(); copy_init_fpstate_to_fpregs(); - preempt_enable(); } } -- 2.20.0.rc1