Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1197640ybl; Tue, 13 Aug 2019 08:50:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmIenJj3rwJOFXVlX63dpgpf8PZFhCotrPbdtCti/r9I/z+QpxwdpLsznPrTGb5ogmzTgK X-Received: by 2002:a62:2ad3:: with SMTP id q202mr42515312pfq.161.1565711428394; Tue, 13 Aug 2019 08:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565711428; cv=none; d=google.com; s=arc-20160816; b=HsX8+Szpx+JJZQ95rma6p+YJmeCIrDd4RpsIKrP5aE3i5agrpO8VWQyS1Klnm927HS aJcQsV1JnOwmBkDhNX7CdJRRUrtovFJ1L+T914UqqopYClYAH2l/GV2U1NVYrNUdIrS7 02pZJQwT9lfW8WYeBjoLZr/AnDmWDntum167ZO8GlX4BmmvTAo2AY64NkG0chH/A2ggF qb5fSVuF0l5cNN8ZqJU3/1zi9jIB3AdLuQEZVnQMCcx2e5ZYBr68sZa9L4Gr/1c930Nz JTA0dITvkav3/rwQVvFxDgwHDXGBlizpR3VuGhHJtg2yprdsNFzniO1E4DznwwzFBd1A dRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=x7bObx14GUGieZy1JKyOj4ZqxEVmbE3QEUOooarnexc=; b=fI0bcTDYbofIVkGLmm33WAyBu8Z0ioOqgvgoiivoxMCV2i1Y6xRLcnZJ1fZwlJ7u5I DlF2neuT+XNWHfz41dGmwCzr2O+lx64a0oS0+6WXQoItHBGb2QWQF1jdZFKoT9T72jaE ZPASAlC4ZVIA0bh2VWjVysGkNivOwUEhLfcaRRCgU8JJ/ULyjx75f4SWVuUctAA1LSBl RACoa25PACqLa6nT8pL+g/1+0C2cgnp0qi+hAhySU1ngYj/roxM9mmyUTJdnNWShgTzI nIo1NGTy+PlLj9qcFSMOiCOfq4DbRUZZ9uRhA4m2I6FpouCXU2DVeMXkhG6iHxIyOURt Nuug== ARC-Authentication-Results: i=1; mx.google.com; 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 p1si8029394pff.247.2019.08.13.08.50.12; Tue, 13 Aug 2019 08:50:28 -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; 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 S1729629AbfHMPkP (ORCPT + 99 others); Tue, 13 Aug 2019 11:40:15 -0400 Received: from verein.lst.de ([213.95.11.211]:58178 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727621AbfHMPkP (ORCPT ); Tue, 13 Aug 2019 11:40:15 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 4A99E68C4E; Tue, 13 Aug 2019 17:40:09 +0200 (CEST) Date: Tue, 13 Aug 2019 17:40:08 +0200 From: Christoph Hellwig To: Palmer Dabbelt Cc: Atish Patra , Christoph Hellwig , Paul Walmsley , linux-mm@kvack.org, Damien Le Moal , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 16/17] riscv: clear the instruction cache and all registers when booting Message-ID: <20190813154008.GB8686@lst.de> References: <78919862d11f6d56446f8fffd8a1a8c601ea5c32.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 08, 2019 at 01:26:33AM -0700, Palmer Dabbelt wrote: >>> + csrs sstatus, t1 > > You need to check that the write stuck and branch around the FP instructions. > Specifically, CONFIG_FPU means there may be an FPU, not there's definately an > FPU. You should also turn the FPU back off after zeroing the state. Well, that is why we check the hwcaps from misa just above and skip this fp reg clearing if it doesn't contain the 'F' or 'D' extension. The caller disables the FPU a few instructions later: /* * Disable FPU to detect illegal usage of * floating point in kernel space */ li t0, SR_FS csrc CSR_XSTATUS, t0