Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3050481ybl; Fri, 20 Dec 2019 03:08:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzgleQ2LwIjH4mpJgDpwbBmssu4M/jkkewG7IBTq4HB0WF6W2tivAkr8CfqPqGNUHkTziss X-Received: by 2002:aca:5188:: with SMTP id f130mr3684546oib.47.1576840113651; Fri, 20 Dec 2019 03:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576840113; cv=none; d=google.com; s=arc-20160816; b=eSvM/r1H2RV4qpginT23z1loEViAFhK2vYf6X2PyLv24ZvnCDAIaZxwOgiOqqSqyqD kRFoC3CwmXD+Vlv7Q9lmAx5s3caf6Kcy3wlutj/tHBtFobAmKxddaRstmKVLSwaLjYuA MP1Zsh3/4lhwh+eE3UH4AScgeQtqCEbdY4e4m1C/lVmeaOOABqkaf4I8MxX27oI73mwO QWAxB9NL0JG50IMhP3oTj7gVVqjccpX9g/90FKRi2XwZCTDGGBc/XbrlG9fL++K2RSCW PQ+afNMv0evdgnZRvw/WHFbz3YgpshuREWytEsMkUiRkYnrrcR8RimDV4G6T/tBNRJ+f tOvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=CuvYmZxLd8M5BiQxeXMEPvKPsn+T62f9uaUdU+HsmZI=; b=miVRqxqk1tInZsjaeeNPNxbl0EJ49d2zu8rq9xmQlyiLP4YI7V8yA7oiyN6mZUufHy QKpjoBImvME3OtSSCz8LMKdT+NFT6Fzvi1Mj4+k59m1t4Zb/wjtqsgOzHM8BBx/cfLw7 JiGms4p58Ug8RmW6CLwsLWxSXAxpmLw9W0B5vgkpBFqipjIycf0lf/crfnLT13iakfTs MzIYyPTxQdayMmVem8xW2Wmxx8qAUEPjlQAXzAgwYsoS0/6wxGSS0TqoNh1tY1pBSwa3 ARzroq2458kvsdBvjGHiVE8ayF+JaOkE6AYe16bkMqa8LfzjKtYi/JU/X8t8HBPdJXQB eHRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=FwfDOzr2; 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 25si4571229oiz.230.2019.12.20.03.08.20; Fri, 20 Dec 2019 03:08:33 -0800 (PST) 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=FwfDOzr2; 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 S1727269AbfLTLHL (ORCPT + 99 others); Fri, 20 Dec 2019 06:07:11 -0500 Received: from mail-il1-f196.google.com ([209.85.166.196]:46399 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfLTLHK (ORCPT ); Fri, 20 Dec 2019 06:07:10 -0500 Received: by mail-il1-f196.google.com with SMTP id t17so7579744ilm.13 for ; Fri, 20 Dec 2019 03:07:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=CuvYmZxLd8M5BiQxeXMEPvKPsn+T62f9uaUdU+HsmZI=; b=FwfDOzr2MfGAiaCWXP4Vk9K87UmjUQo6aakivfZOVFPohjKd5SrzNfxYDQ8tvd9eBC +YanTBNiGCq353VWzjbaueAE1tkeJjXv0T/suPEhNc8cgeqkauiTLFXGilXy9FMoBoG6 HvGb3ovru3NdYW1DqwJ6bJkUDYkVBDWlYROV2ALtuirb8h9eLcuWGQwrjX7/i6NzHbqR N7JXX4ucOsr7H5352iJQ58Im9WfybP1VlQatLQWNRe//JgEHcx/i/GV1Bwj5Up1INqrH GRGO8EOQ/CdEjaGlrlkdpv6AGkh/Jhp3jwErieygv8Ncr6AhVuEd+YG7NIC+/KBHmxAx qMog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=CuvYmZxLd8M5BiQxeXMEPvKPsn+T62f9uaUdU+HsmZI=; b=BfPmINE5s96f8GSbE1WM6PKgaZh6tpEbSa7WbY5gmGHCYsIFs3nCs/C6kVeoixCi9z kIRBCGUS0+e3gP/osXJ034aqgUhrNQpuAybu8LJyn3jDl9xzX7wrQxb1+YALcuYfiNMe YbyQZOzJdvJMbkR/AZ1c7bhxnvSVUzawXRnDnzStOxzCZWRRM9R0QovyTqq7rgyeUXDF JIZZTJBcDf/pAWoPuvdb9PhgzStZs+7VYh44fcbG9wEp5B5Z3S4wuOuXdIEnEqFeWPm8 3jARrU2XSdpyVRkwRyahrfp/UPuNNhvQ5C8s0IndN9b93xvQJD/t+XUj5ko8pLFYi7yI e8dA== X-Gm-Message-State: APjAAAWkf3Q3+t+M1sX7+LUYdW576jPVz1881PpmbooEc72Oy0fFljYC o/WjpFVRlb7kcknJhF8r8q0yUw== X-Received: by 2002:a92:9e99:: with SMTP id s25mr11698837ilk.80.1576840030346; Fri, 20 Dec 2019 03:07:10 -0800 (PST) Received: from localhost (67-0-26-4.albq.qwest.net. [67.0.26.4]) by smtp.gmail.com with ESMTPSA id g6sm4416389ilj.64.2019.12.20.03.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 03:07:09 -0800 (PST) Date: Fri, 20 Dec 2019 03:07:08 -0800 (PST) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: Greentime Hu cc: green.hu@gmail.com, greentime@kernel.org, hch@lst.de, palmer@dabbelt.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: fix scratch register clearing in M-mode. In-Reply-To: <20191219064459.20790-1-greentime.hu@sifive.com> Message-ID: References: <20191219064459.20790-1-greentime.hu@sifive.com> User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Dec 2019, Greentime Hu wrote: > This patch fixes that the sscratch register clearing in M-mode. It cleared > sscratch register in M-mode, but it should clear mscratch register. That will > cause kernel trap if the CPU core doesn't support S-mode when trying to access > sscratch. > > Fixes: 9e80635619b5 ("riscv: clear the instruction cache and all registers when booting") > Signed-off-by: Greentime Hu Thanks Greentime, queued for v5.5-rc. - Paul