Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6631895ybh; Thu, 8 Aug 2019 03:19:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwb1UC0RThE3KZkghnec2pjuSJ1OQW9fWTICCXoGDfp3E4I9UtaXo4Q+lLerqkLg54zfKPO X-Received: by 2002:aa7:818b:: with SMTP id g11mr14856375pfi.122.1565259564227; Thu, 08 Aug 2019 03:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565259564; cv=none; d=google.com; s=arc-20160816; b=mAylNmtFWrxk5H5coNsPvK44PNr/X3opheKl8vOiJukIMSlOXTa8qvLc/WgS7A+3mf FFd3ScIN+LofAR9fWfwGitsApNdLzBe9zbjR1LkMYRjkJuIja2oL0SfuIukERkQBiQ+8 ZSkf4qPTqqBIMJsj0ZFEOzp4NZ6C4K6cwVMyda4IK2ltR6IR6Ma8JD3qXeWzbekaaPs7 P42hiTTVyJ9j1e7qQXx4IVemeA1dKBICkyipWD7TJX8COZpjqjuDGWXTqEtOIhpVr3dr yoAVevWCAWXqRyqT/sPvIJjLYMUYKLHcOrhtnwrtwtAaZ4zn07sor9Zh/Ks22Mhy+Bqx GEJg== 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=A67o93psY5B4eG+Z4gU8la/fXN6tQo4s6p40YcJCO2U=; b=Sk+8w/ZgYbUeX4tMQH8hvQJi5+ulMLI5wdo46t7NwZNbET7q9pqghOLXO69nY90ocL C4dUUPqmJXgVS4wXdgo0k4VeqXzk7U1BYfsElr7mnYLAjKIl5ylVcP1hWtL2kRM402Uo 9dC52VihrJeQL+1PzwTUZykVCWva6iFL0EljV+zM07BOfMzsKWvF+TiXgQtVtXKSBSpw CZI+zPlMrqjF70Zc2+5bGnUGNPmGR4S0PZ3TeCG77Hpct8ZavNer813Sf+u9v4DcdZq5 jZR1ns/1s/qdaFa2S78oF0C+HoUlosZsKG34NnTCSDRW5HjHb/LhCkB3eOvXi5C4O4HR BFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=c5eSw44b; 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 i1si56553949pfr.203.2019.08.08.03.19.08; Thu, 08 Aug 2019 03:19:24 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=c5eSw44b; 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 S2389945AbfHHKRl (ORCPT + 99 others); Thu, 8 Aug 2019 06:17:41 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53302 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389907AbfHHKRl (ORCPT ); Thu, 8 Aug 2019 06:17:41 -0400 Received: by mail-wm1-f68.google.com with SMTP id 10so1824594wmp.3 for ; Thu, 08 Aug 2019 03:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A67o93psY5B4eG+Z4gU8la/fXN6tQo4s6p40YcJCO2U=; b=c5eSw44burssOoFTN87qDDMEdKZYrxwitEzxmyGA+TClM4eL4j+U2vXkjSTWDg78k1 4kO3ET7xFc8yUFVM7rZOGGN+EW6e4ck/BVDqAy2QpDcxx6oeLpxjy6cbgbj0MGp2SY64 +2NaQQlnir4wPwxR7Za2cb2f1wUXEU1lWS1F4Eb7TAMevbAPuLLbjR43OaeMq/nu2xqY aQmFBVEEUtW8leJ3J5gDUHXxCUQMiJu1q9KzyZZHxE+xD4UmHGjLlsRn+J5IPaIsa+qZ OjcyMc8M6S76QLrpSsUg7Qa/rZCiVdgE8kuYxBeboEovW8RDtrByc9ttnnVluXFwltuq B8zQ== 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=A67o93psY5B4eG+Z4gU8la/fXN6tQo4s6p40YcJCO2U=; b=KLABPsnyT63fOL3m4PIcRGOIbtkTWquNGzesDQlhgEMzFAf51uISYou4rm800H+w1o /jqQvL1lA2aMT/x3kwNdihbM4G+WGyymsOBgHcyIUWvsqMuSZ/Ks5CUZHV9srvV/sjrN eKJB43x9Czw8PmyHklSxTIQFQjxQo+aYZFG//fUDgjWPCPKVqlqX73+GbT04kUUwtvKy RDKZcHiNmz9qzWEf60c91bj9hR119N4BI/OO4SP+YwZPf2Q8RnuzYF1tJvESZJxHBTFy clOjbvX9gTPafYAuF0glx1iRlXg/38xfH/FxF1UcZhx4oo9NVEqCl1WfZz3ihHKirovk Qpsg== X-Gm-Message-State: APjAAAXWt85rJ1PPJgi/eoCtEl6Ha6d+k3SIwWQJJZd/StqMcjTKe6jp aSq3GK0BrYTbW8ktgJEDg99eYNrNj4EWQVqAtQL5tw== X-Received: by 2002:a1c:3d89:: with SMTP id k131mr3238609wma.24.1565259458889; Thu, 08 Aug 2019 03:17:38 -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: <1565251121-28490-3-git-send-email-vincent.chen@sifive.com> From: Anup Patel Date: Thu, 8 Aug 2019 15:47:26 +0530 Message-ID: Subject: Re: [PATCH 2/2] riscv: Make __fstate_clean() can work correctly. To: Vincent Chen 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 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. Regards, Anup