Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1524551ybl; Thu, 22 Aug 2019 16:24:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH4VmK96LHVqgkzARHfHsrxYMLrkX8qOFCkUBbSVtIS7njjtLFSFgx9znouOBIO+Cb6kuo X-Received: by 2002:a62:ed10:: with SMTP id u16mr1811096pfh.179.1566516291383; Thu, 22 Aug 2019 16:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566516291; cv=none; d=google.com; s=arc-20160816; b=jl/gI30eQSMhtqJWBnNmxpGXahSAnHtFivDkjl8CIYQjxaEbYrfXLd5JrULF/M9EQC VWMWiMHyKS/EqAZsA84N8Ag+YmOxBKJCnz2gbk7ex/Q/5KKBFVMJini6g5y1VQibgZx5 Gt6WnhaUZ86fGQWRRaa/iughf2LkMv2NNInQ/+y81lmVvZ9hvCUUCfWmKNeqmysHHBTM oJbRslWaAhIDNyuStMUFspTUUf2SESKkdKjcFsE3VvRvHVziXetkjSoj6w1IKWzYISUV 0nTNbMv8QL8Jag7GXLQ0uU0WcsYmsUDwayOAv3cmvO5nqGHNlEMrx1qB+cG0kF7lSzOt BFUA== 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 :dkim-signature; bh=/VKcYPv3L/YSs5xp58qkWTYSDFJgHv0xgJfLIpjLMko=; b=F8oRKy2X3UvoqBfFLm6Q+CWyhDtRwNGhShTpKNnS0ad7ErFUzsWBLqxx55+vqQ0Mw0 8y7oHIpwwbDvSdIuvSf3iyFsTL4LoQMmLJLJy/0KYBtPg12B1WMJWZZtnUWeKnyvpwEO Vh2VNVyKJjxdxaF6gu9hfY8TYOQcOTKb5RDlah/PI9X1PEuP/ak/vrLX9CPZNmefJHHU 0nMPZ7w4uVYR+1uJ0lRR7TKumvxqHYuIrjSR4Ch1rGMHjBKEZOwc0w5PbeJlWRNJOaRY +q85pOGKyUythWP6y+lrj00kWcHx1dTZjU2FQO4kJJJgF3Eyeoxa9eEUst9tvuJ4OYuD ISxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ekWEja1U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si731315plt.306.2019.08.22.16.24.35; Thu, 22 Aug 2019 16:24:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ekWEja1U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391240AbfHVRQs (ORCPT + 99 others); Thu, 22 Aug 2019 13:16:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:57996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390375AbfHVRId (ORCPT ); Thu, 22 Aug 2019 13:08:33 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D12FE233FC; Thu, 22 Aug 2019 17:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493712; bh=BWSg0UCL/CYbHa+qf299qaAaQB4/DqDBrwqYITlh1bQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekWEja1U0BFCmG5/CuFAbROlXJXd2Uga26Gf9b+MBQ6+VsfxfrudQMyJkbvh6nbsO ClnUuOto6zM2CCNifA2XNx7ZiXArC+6zRFpsThAx/+CLTTE1hEwtFSbkzUYr9xPmbs rtyREBFMN4ZHp8SlDiBIfYCMqtOLac+d48gNr9dA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vincent Chen , Anup Patel , Christoph Hellwig , Paul Walmsley , Greg Kroah-Hartman Subject: [PATCH 5.2 033/135] riscv: Make __fstate_clean() work correctly. Date: Thu, 22 Aug 2019 13:06:29 -0400 Message-Id: <20190822170811.13303-34-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Chen commit 69703eb9a8ae28a46cd5bce7d69ceeef6273a104 upstream. Make the __fstate_clean() function correctly set the state of sstatus.FS in pt_regs to SR_FS_CLEAN. Fixes: 7db91e57a0acd ("RISC-V: Task implementation") Cc: linux-stable Signed-off-by: Vincent Chen Reviewed-by: Anup Patel Reviewed-by: Christoph Hellwig [paul.walmsley@sifive.com: expanded "Fixes" commit ID] Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman --- arch/riscv/include/asm/switch_to.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/switch_to.h b/arch/riscv/include/asm/switch_to.h index 949d9cd91dec4..f0227bdce0f06 100644 --- a/arch/riscv/include/asm/switch_to.h +++ b/arch/riscv/include/asm/switch_to.h @@ -16,7 +16,7 @@ extern void __fstate_restore(struct task_struct *restore_from); static inline void __fstate_clean(struct pt_regs *regs) { - regs->sstatus |= (regs->sstatus & ~(SR_FS)) | SR_FS_CLEAN; + regs->sstatus = (regs->sstatus & ~SR_FS) | SR_FS_CLEAN; } static inline void fstate_off(struct task_struct *task, -- 2.20.1