Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6534338ybh; Thu, 8 Aug 2019 01:38:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS/wwu9ilLOYMPlnrf0/mSWlSAWaHa7u6hKpgnj62rNBW1eWV27IBungbE5ejtQKVWjzVj X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr2951471pjb.42.1565253528009; Thu, 08 Aug 2019 01:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565253528; cv=none; d=google.com; s=arc-20160816; b=Cd7WPmjZKQJZiDQY/6GttQI46YMVQAhUKlxOO5p5aw+j+aMOvCpYWLXKCWEG5fVPkR zo0Hj8t0qkS3OQgvYhSlgS4QpbHnlDQ4J9q9yi30WRa71CCOjTJgpspAp0tEe/GkRsDg 3K7O1U1pGxPNILXNAHDoq0MWqMd8ULi0E5esgSumAPuOb3vwrehP6uABQb/SJhmcbqNl jTvUSq6WpUWG7/ywWS/Zp7/xm7kKDw5Nr09UNfFDdYpn26dj1RuqX0b0kZ5I15exaL3q 5ywkdCrZnA3VTvCA1Eu+aZ0pOOASWfuscb0nl6Y3LKMs3p9kDzRCUIiQbX9FylrDLiDb dlyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=xMV6uY/vHKVkmIKzViydmdx5B5e/xYSR7IpOeW3QoL8=; b=lFEdpl5hEb8XAeZz1M9vm7KmapYpikR/Ooi+lHuK9f86eroCIV/Gl9adpZKU4w0CsR CxFSp62phR9xCVltBbLuzfhuimuxR4Cj9PaPdbatf+vQy4EMfNu1D/a0/1IZl/DtdDmJ LpEfNI2jABGFxjd4ZlZu/Ecy3tsEQGY6LZOvaWwkiJsRFPlvPOINqZs3H+Nx/KVtXI01 57ESUmumr/gmxMQMe8kGi84Iv6yuPnxxyOcD8NROYx69Y7NLB56mH3uHO2L4dlvRn0d9 CuDePxpsF97wudcjqFusSEowML6FnbXhkTwweSSsN3tlgfw3D+7SDCeuTtBtFg74unOS XrNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=h2q0oFr6; 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 185si53749063pgc.522.2019.08.08.01.38.32; Thu, 08 Aug 2019 01:38:47 -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=@sifive.com header.s=google header.b=h2q0oFr6; 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 S1731825AbfHHIAJ (ORCPT + 99 others); Thu, 8 Aug 2019 04:00:09 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45025 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731801AbfHHIAF (ORCPT ); Thu, 8 Aug 2019 04:00:05 -0400 Received: by mail-pg1-f195.google.com with SMTP id i18so43633701pgl.11 for ; Thu, 08 Aug 2019 01:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xMV6uY/vHKVkmIKzViydmdx5B5e/xYSR7IpOeW3QoL8=; b=h2q0oFr6RoQTAhYh9x7GZGp+e7kwYU3qvNAgbY6MX792jT3Zcvv9hdNTD84955pr8g FDV6QHHKfYGqd5So/bC4uFNydlNxO6ZY+ADSeZTY9ESDL71ySAAhewAFPUobvN1i2d7Q pADV1J9r8hvb6WhxAAq2rXg4E0ZfOF9G5jShMjxJ1HI6F0SFUe2xKk7Y2QA0zCIjXkK9 RjszYfVEJOa68PGiNiS4e92mFNICczNniUepfrudUghE+up+YhHmrmRtwyQJ2aAt0VPv yoOUu9EGBVRFn+lWBdL7Ux6dqPc0V5AnEzB7C0s59aSjSq6fiS0lvSssgKIcbKSiLwyA yNsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xMV6uY/vHKVkmIKzViydmdx5B5e/xYSR7IpOeW3QoL8=; b=d/mO1g3Iq3SHCA1hOWcCr67v+GpycX8Vby3G5ytVLd+ZQGcfddbUkKfNJfsTM+QnAj Diya/o9LIGm60R/ulV9cYyjlAKP9SRmJUNU/akJ+Zk0/lnD/TalEOjlBfYM96wt1g+Nq xHy0ke8V+QrNbTPF1qDGz7R6e5T8sfOgpq5Lqo2EInKponst8kZwu1koJouG8hSy6Rg9 zxIH1UQQmeQCDBDcujo/S6C71GSzRrtZ94rac/BP/KgxvUtm2XuuJWWSDk35gyv9QoBs 8k8V/loUEl9FRjO9JhorzBOTKAjBKV68kES9mXsWxtBvED1fsUrk8Nhy4uycEVSLIf9v pjmQ== X-Gm-Message-State: APjAAAVCnNS9ilWA3UGW8D4tXAC4erG+lbphDiaztuMv1fPOxLNFN65j jT5l94/2M8/hRLrUDcQynQK53A== X-Received: by 2002:a62:1444:: with SMTP id 65mr13849575pfu.145.1565251204644; Thu, 08 Aug 2019 01:00:04 -0700 (PDT) Received: from localhost.localdomain (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id t8sm107697374pfq.31.2019.08.08.01.00.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Aug 2019 01:00:04 -0700 (PDT) From: Vincent Chen To: paul.walmsley@sifive.com, palmer@sifive.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Vincent Chen Subject: [PATCH 2/2] riscv: Make __fstate_clean() can work correctly. Date: Thu, 8 Aug 2019 15:58:41 +0800 Message-Id: <1565251121-28490-3-git-send-email-vincent.chen@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565251121-28490-1-git-send-email-vincent.chen@sifive.com> References: <1565251121-28490-1-git-send-email-vincent.chen@sifive.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the __fstate_clean() function can correctly set the state of sstatus.FS in pt_regs to SR_FS_CLEAN. Tested on both QEMU and HiFive Unleashed using BBL + Linux. Signed-off-by: Vincent Chen --- 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 d5fe573..544f99a 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.7.4