Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp200459ybl; Tue, 13 Aug 2019 18:56:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWosHjzDWerSEouEkQD2Vn2WBfb30OFuqaFvX1aVBot31aXijrqgWhw/m7DzSZDIzDsJKw X-Received: by 2002:a17:902:82c4:: with SMTP id u4mr40511464plz.196.1565747771388; Tue, 13 Aug 2019 18:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565747771; cv=none; d=google.com; s=arc-20160816; b=b7czxIdoAFwitGWXIUvYF5c8e6wO/q/WTMAsNSKW/0rAKTQ+ujs3kmbU/kx/sfrB63 u+P2+J/ZPnszFYV9Q32aLRCczRjynP9Pt0D3vhn1Aq7pXOPQC0Tihmh1thJeaf9+INrb OhIzwf+ssPrwNSgy1GVbqtGXChLESHS6mZ8yMVFvYWs3Va4/I2uhytWLO5hqUEyXJyVN ocBZFm1679IzlEyKrPAV29g9qw7cL9Z7JWc3IJek5kUFumMv+Bf7zGZRtgUxHlv0/6zR LZuYKNTbM+HwWjIDTX0gksMnljtIaQQtFBTZuH/tePG1mNsNCm8u1umTUZQB0BWASYF2 rt3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FvZgcIP+Jz1WkFSRFJD+95uSrVx6pGRMAeYWt8sXANU=; b=rj90G+HImdJs3PrO4I3vdNsrKLce4b2fmlFc3cLTL5KCw4J41QcPsSYP1NkvwHk1JH 5wesdy8Y4+A1krg1Y001D7ZJyLgcAdDbqLq4u+WDn4dxSb88DZMyYfMhxF2mEYCiRtZ3 omDdgaVeXrCqXEpLs065yb1FxEOTpSiN5Y0jr3gN0we6eakRU9g56+H4OVqNE6jJvlfl ilNwQYITPxL5/oBmVkEZwm3FBdF2ShWeBP5/Iu+x7+a2CFouu9gJnqd4CSAQNezD7dH9 s9+9MNvDIlT0ez96SX75bL0xAs1Zj3SFdvJXiwGxaSZTiFQU63zxtzG8L8QmyBgBrD69 OaFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=nR8gnnyZ; 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 j14si72687484pgk.107.2019.08.13.18.55.55; Tue, 13 Aug 2019 18:56:11 -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=nR8gnnyZ; 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 S1726944AbfHNBzM (ORCPT + 99 others); Tue, 13 Aug 2019 21:55:12 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:41244 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbfHNBzM (ORCPT ); Tue, 13 Aug 2019 21:55:12 -0400 Received: by mail-oi1-f194.google.com with SMTP id g7so70691252oia.8 for ; Tue, 13 Aug 2019 18:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FvZgcIP+Jz1WkFSRFJD+95uSrVx6pGRMAeYWt8sXANU=; b=nR8gnnyZRdfRZx9cim3gfa/2rzzlVipxp14EzBfCKecBs0Grr6AFbJafklNapdif5f hIoqsk+mTRXFf2UXw6qFcPGpXgmVPO4J+U8Jlz/+s0IYqRxh35OzmQTs1c3bH4FlY3mn SAznTDtZCGVgQPKfZJbkr3R4/5cXJl8xvZcp4CLm8hfEBpeyo+EFw02RbVD/8X9yHl6l FHTEt0T2pOHo9b+Tfjn4+a1y152LDTnUVEGuo045KlpJ/J1fRKThlyJfhT/VplY6L4pU vec0pNhtcH6/6ADhfcjcsDcXXUgeT/0pG89j+VaJed4xyrxDSxLp8f4DSDjEHUIsumT7 MnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FvZgcIP+Jz1WkFSRFJD+95uSrVx6pGRMAeYWt8sXANU=; b=ieXJpSyFaxWEBHE4JeKHyxbsYsQWk3GhD6awgQ2SNRC9r8M1xGA6IVRj2dWvA9Lp7M n2Ha/+n5XeczsqA6UpI9LJB63j+oqjaCzA9M+Xnk8rXP3waQGWYAUg8ou9nqxY37IXni DG9tNxV3KCJCmTPFoYrAjFtUc3eTTBaHqHgLQUEaOxMHKbk8Cf/+3ed1dz5tfBx9mNCX GzRKmQzG4ZWC3Sx74CwCGxkndpIghfDmkjkpjMrXXXWtxd7KMBw2RjbLhp4EdWsoKTNZ /m2X4S2DaZsRNRDvOHdDueY+7/Vb3pDXsEKVRzwUkSNVl0NqzJ62SLfts05efbBJ4hvi LbUg== X-Gm-Message-State: APjAAAX8cOXtJwPAlkJrmrayBuFeeMdsj17MemH9nkQEOINnLAlBobyO ujqP9R/AS04ykEVKzkjsHykBmwLkuZm6GYBkgzIu4A== X-Received: by 2002:a02:c65a:: with SMTP id k26mr889740jan.18.1565747711676; Tue, 13 Aug 2019 18:55:11 -0700 (PDT) MIME-Version: 1.0 References: <1565251121-28490-1-git-send-email-vincent.chen@sifive.com> <1565251121-28490-3-git-send-email-vincent.chen@sifive.com> In-Reply-To: From: Vincent Chen Date: Wed, 14 Aug 2019 09:55:00 +0800 Message-ID: Subject: Re: [PATCH 2/2] riscv: Make __fstate_clean() can work correctly. To: Anup Patel Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv , "linux-kernel@vger.kernel.org List" 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 On Thu, Aug 8, 2019 at 6:17 PM Anup Patel wrote: > > On Thu, Aug 8, 2019 at 1:30 PM Vincent Chen wrote: > > > > 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 > > > > Looks good to me. > > Reviewed-by: Anup Patel > > This should be a RC fix. > > Please add "Fixes:" in your commit description and > CC stable kernel. > OK, I will follow your suggestions and resend this patch Thanks for your comments. Regards, Vincent Chen