Received: by 10.223.185.116 with SMTP id b49csp2393363wrg; Thu, 15 Feb 2018 10:56:27 -0800 (PST) X-Google-Smtp-Source: AH8x225+4IG7BkjnSwwbJ/pjnEb/ZuwyIiRMVVdZOrI7B+LX5LwrHSV3Qpf1sXbr2vVMZVcmBwG3 X-Received: by 10.99.147.72 with SMTP id w8mr2860417pgm.300.1518720987062; Thu, 15 Feb 2018 10:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518720987; cv=none; d=google.com; s=arc-20160816; b=SHnoR41QDD66s0P0tYwbCqd0LmULrHs7Yss6VwjZ+cUkKnMNr1zCOzVnh6EtF8U1vc +RXX3qRmmWi4zXSLE2h21d1f4CRPPn6ZTWCLB42NbOISFeVdnoWVy8BQJuMhAtu1Rj+Q Wb50ppDFELfq2qL3MoGP9BOhiU3Wg8hEA1p4+lypH/OC8fh6jvEqvEPki1ZPRcxZzEhf z4ZD+O/au7NOTEkMwwZ3Jy1HVAyp3OnwnpANz1p98XPP4z7wD6Ee419VO5eU/sWyQCpY ElctIvXM1L9TbIdr8Q2o73QMFUVrhcNbYxBhnarR9iTctV4A2oKZryP0c4qds/hWjtk7 eG/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Kuuxx1fl/gXJyoybh1oNsbcC66D5l2efMy9kFJM3htA=; b=rJ2yOQwOwTAQXXIk97snvyPjuDqyctyITHnWPHNXOIxFBL+gxpFioXPoorfKJJpDrC 5HWrdnBjYcxgeY2mYtOvftYZQlv0nOwkpJbzedJy70Rc6+to/j4Z0SIrK7I5Bsuk2vPa vq/LMS8814hBJe/JJluzka6eEg20hS99YKL2Vx0ahCW8xdYQycGkbzfCer7OSh2Mynrg g+djZxYkJRBaK+8jm44PjZxLfbWsOip1jK8ZPeaiQ/2Q8NYUnPFtH/XhrIGqIdy9igaa Xr7heDMaKDel+DZJu1sPvIeIqFn45ICr3hl5NgoQzCQYzpQ3ZKFR2maQWTfr5vsPmKMV WAbQ== 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 w10-v6si1938746plp.561.2018.02.15.10.56.12; Thu, 15 Feb 2018 10:56:27 -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 S1167007AbeBOSyQ (ORCPT + 99 others); Thu, 15 Feb 2018 13:54:16 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48446 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161872AbeBOPUu (ORCPT ); Thu, 15 Feb 2018 10:20:50 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CA0281102; Thu, 15 Feb 2018 15:20:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Herrenschmidt , Michael Ellerman Subject: [PATCH 4.4 003/108] powerpc: Fix VSX enabling/flushing to also test MSR_FP and MSR_VEC Date: Thu, 15 Feb 2018 16:16:00 +0100 Message-Id: <20180215151222.757273093@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Herrenschmidt commit 5a69aec945d27e78abac9fd032533d3aaebf7c1e upstream. VSX uses a combination of the old vector registers, the old FP registers and new "second halves" of the FP registers. Thus when we need to see the VSX state in the thread struct (flush_vsx_to_thread()) or when we'll use the VSX in the kernel (enable_kernel_vsx()) we need to ensure they are all flushed into the thread struct if either of them is individually enabled. Unfortunately we only tested if the whole VSX was enabled, not if they were individually enabled. Fixes: 72cd7b44bc99 ("powerpc: Uncomment and make enable_kernel_vsx() routine available") Signed-off-by: Benjamin Herrenschmidt [mpe: Backported due to changed context] Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/process.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -209,7 +209,8 @@ void enable_kernel_vsx(void) WARN_ON(preemptible()); #ifdef CONFIG_SMP - if (current->thread.regs && (current->thread.regs->msr & MSR_VSX)) + if (current->thread.regs && + (current->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP))) giveup_vsx(current); else giveup_vsx(NULL); /* just enable vsx for kernel - force */ @@ -231,7 +232,7 @@ void flush_vsx_to_thread(struct task_str { if (tsk->thread.regs) { preempt_disable(); - if (tsk->thread.regs->msr & MSR_VSX) { + if (tsk->thread.regs->msr & (MSR_VSX|MSR_VEC|MSR_FP)) { #ifdef CONFIG_SMP BUG_ON(tsk != current); #endif