Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp511089ybl; Wed, 14 Aug 2019 01:25:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzUyFAw7pJtjSzvkUVHx5/RBPU/4IrNY0AWFtiybquX88SfuRrJkhrWKW3N+6QykYMw9WG X-Received: by 2002:a63:eb56:: with SMTP id b22mr38674867pgk.355.1565771144876; Wed, 14 Aug 2019 01:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565771144; cv=none; d=google.com; s=arc-20160816; b=Xng4WUTXdFM40zD1+nFXf1hKFwcp4+pqZJvqC2Xy7JfWrkAkHE7aNZ3P/1gyZMkxsg 8gzvcqyXJeX90ZyW+cbtC6Fe4vMJKyE8BKrJpeUGCB10QnGLUtjEyMH5NjLQS/Blb+cH DEpWr5kJrueVR0fySJtYx1bL2VzVFbgvLB6M0sAWFJ+Qaeglj+dGfPI6RnR0FHm5lUdV dJMeZwr2/eXdISLtmyoY7XhbzZ8HUiEHoZXDZB2Pw/ejw9hSMTaiWFG5CoNfD4m+NbQ8 X0fCidu/bdQOAMmfuSWzDvMBzZsH0N0g12NbQquEW6tl6flx2FV88FFjWebG6Ayd1jDC W6Eg== 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=LKUTmfxWju3JH0UYdXaX0ZmxM1v34X/CQR0cjWXAdV0=; b=a66IRHG17njnD8xJpJdp/YVWZIYcNbOOiOpxXfShriJtEXgmd2Zp71rvF6M/02DxMv zlZV+CmxzSt8eulu8cMR0MYP+8Gx1FhFTky8S1wXRvPgk6xFNdLflhxTpKsct/q0m+1E D9Sqip7K36K3qFPxCmCyyo9o8IFIHaJqJSCIAODpn7N/n9da/0WsQVdQbSrlQ/Mz8Kf2 j650FoZ51ADPrhjwH14XEaoN0ZWkbVUCyLZxk7bAvquf6vrOgkFwXokM5C0dG+ZJjdmR 7rB5w9Zf7qAjQR5dah9hQh5/ZtT4xL2WmAOfBLSJ1s7Lu2xp9MGTHEZZ0q66DbXvSikR mAKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=aprA4MX8; 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 r8si2484571pjq.62.2019.08.14.01.25.28; Wed, 14 Aug 2019 01:25:44 -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=aprA4MX8; 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 S1727799AbfHNIYF (ORCPT + 99 others); Wed, 14 Aug 2019 04:24:05 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36774 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727585AbfHNIYB (ORCPT ); Wed, 14 Aug 2019 04:24:01 -0400 Received: by mail-pf1-f193.google.com with SMTP id w2so2325928pfi.3 for ; Wed, 14 Aug 2019 01:24:01 -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=LKUTmfxWju3JH0UYdXaX0ZmxM1v34X/CQR0cjWXAdV0=; b=aprA4MX8fFP42+7Kfj2VmM2auYXDJcnW8YzO6vnSgXZD4MuPEx8PnT719qHFqIr/8n QmbZ0QuY/hdaPVLq5Qw9zGc+lgBmz54nZxOVLVk/a6ciHKcZKGRIPSumxAOoQa+lFXMg Z4uMvEByYuk/s/C8PNQittEjIb+K5+DyAfQ6cEBZ/zDoQd5MGztJ4aOzq10agMJA7UiN FDqQTgG0lMxnF4XDCJNHNKvx7sAok8gbO5bys2VzvMgT+AmDci9oOg+AHhe05JKeg2zn 0209fn6vu9pR/FoCbx1lMxKN4l+zwrkJSq8FNq7tY10dmn+tm2v/q4XkIMFQCz5Jcn91 Xm5w== 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=LKUTmfxWju3JH0UYdXaX0ZmxM1v34X/CQR0cjWXAdV0=; b=fuCwZ3Hd58aI9G1k0Ie0zRfNMMVhPMUE83u6GBbZJKJM7x+cG8xDs5sB1WnmdScsQl OLwLZNkOn7DyrtFcWSwMBI+foD+3ek935cdmtl5yzf/R9B/9eDnYT6Eg5ywKEC23WNz3 GUEV6pBBVAlyqXh4r6ayHBNphNkpLZJQJH8vHMVfXY9lBFhqpoBJz2/2UTF3x+O3J4nW eipdX0agvrpGnXU1ywUQDKQWNXN6XMTuMl6VYbA5uFmgQlCqk3JFIdM4r8lzsfsnA2ol wncekpVe03at5VjQZo7hP59wxvQ2jizz074N/Fea8ZsGTB+ZaPia5Z2AyhOOCf4M238v /vXQ== X-Gm-Message-State: APjAAAWhyN/p78NvMZp+qOPIkNip9nI48xQtEjNfEMkh6/JedpkRu5V0 XwqvV1z0F+7qTnk9QJ8eDPU4zg== X-Received: by 2002:a17:90a:ad86:: with SMTP id s6mr4822761pjq.42.1565771040942; Wed, 14 Aug 2019 01:24:00 -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 f205sm12359152pfa.161.2019.08.14.01.23.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Aug 2019 01:24:00 -0700 (PDT) From: Vincent Chen To: Paul Walmsley , Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Vincent Chen , linux-stable Subject: [PATCH v2 2/2] riscv: Make __fstate_clean() work correctly. Date: Wed, 14 Aug 2019 16:23:53 +0800 Message-Id: <1565771033-1831-3-git-send-email-vincent.chen@sifive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565771033-1831-1-git-send-email-vincent.chen@sifive.com> References: <1565771033-1831-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 correctly set the state of sstatus.FS in pt_regs to SR_FS_CLEAN. Fixes: 7db91e5 ("RISC-V: Task implementation") Cc: linux-stable Signed-off-by: Vincent Chen Reviewed-by: Anup Patel Reviewed-by: Christoph Hellwig --- 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 0575b8a..0aa5b94 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