Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1425219pxk; Fri, 4 Sep 2020 09:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAiHKfZcZStpsuuO8BVA5HznXd781c4AIs1NErkP5dve+FzNDGsRHy+jWMy6oNFEPHmn3C X-Received: by 2002:adf:9bc9:: with SMTP id e9mr8246914wrc.123.1599235493177; Fri, 04 Sep 2020 09:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599235493; cv=none; d=google.com; s=arc-20160816; b=tNKwR5+OXdCAG3mDloK8jF9cf/A+AGtqlThnXh/+u1+qnAG/zyH0eFB7x4OeWYe7Uc 0liBh+NJ3YSgDTdrZ8/dlTDs2s/qljuVF6TkNO4xRzd/+YxbTqxAXDN3yPwxdXBcW0lN Q8YpNbwGoptE6nXIivE4P+jm4LcUd1/6dcN1ytrQqqBCEr3ASe3KbY5VVdlj9EZCucNw iO3u/6yKfaultnttE9o3Nv+1JwkdoXahRYYKNgEHCdU/B3lsmKPOqEZw3Rh1S8GCf0Ue Bddy0d4GAJHvHjoGsK6ArtVxe9UpIn1Xavk0ARS6RXA0Apx3AE1Qlp+aaQEdMacSJXbA ArfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dOIY+PK7v5oRo5v+cKMlhJajAlAgTvbKby18sXReyKo=; b=NCaqnApl7hZSUkQIa4mjlUCGzsA/6tIhVzNIAMI8+wvCNuGyqS9nLT+pKgNwovh41I IOBQ0KAGU0YUJD0c0GRerojiuexQCtwgc9pyEHTRkKm9+Y+m/dsoAVj5X9ZRaWSZPEAm V+VoxeHapsQmAPU39iOXaL0zs7wxD2iv+7YtLTRI+v+MV0PD14BokwbKlpy+julY7Ho4 zqVB+WlNg0TpBtRlkYV268yQxpL4iaWUnhrRqFDc97epePZQr3gy3H/03lPYxZ0R5g/D IDo4r5TQjAdajHh259nKPuTE627tjafZC62WSKitIZB4NcG0hfokj4ZDslzUx1GuqCvw 2WCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=njw9vtf+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si4056076eds.209.2020.09.04.09.04.29; Fri, 04 Sep 2020 09:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=njw9vtf+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbgIDQDx (ORCPT + 99 others); Fri, 4 Sep 2020 12:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbgIDQDx (ORCPT ); Fri, 4 Sep 2020 12:03:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8A69C061244 for ; Fri, 4 Sep 2020 09:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dOIY+PK7v5oRo5v+cKMlhJajAlAgTvbKby18sXReyKo=; b=njw9vtf+x7s/XbD1M1mN9ssGF1 pcpg1z62txj7dfVjqiI1WH/FUB8/RetpZgNoNrWcm4U4Ss92fYyykPZ0T2cIY1eEaYLO719iYWKbl mxmrUmOfaMF0nm6fjWKVA//w2u6JTBPgUd+bROD8e7I5MM73z3maEJgvj2q/9s6J5aDaPV+tRlPaI Qw/72DSaudNTChK420y/d5r+R77lRJYw3VmpxtkkFTKYMymqlJZcMWPs5VCCV8+Ys28/8k+LYILxf vY0Gc4qHl8gT03OOuFz+ZubsUWqj8A2BY7lJGS/tNO7xmQzhSuaUmBw9l1qJztq1ZWBLATHLa6lxv tg9RxP9A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEEBb-0006F1-G7; Fri, 04 Sep 2020 16:03:35 +0000 Date: Fri, 4 Sep 2020 17:03:35 +0100 From: Christoph Hellwig To: Anup Patel Cc: Christoph Hellwig , Qiu Wenbo , Palmer Dabbelt , linux-riscv , Linus Torvalds , Linux Kernel Mailing List Subject: Re: [GIT PULL] RISC-V Fixes for 5.9-rc2 Message-ID: <20200904160335.GA23669@infradead.org> References: <20200904083109.GA9182@infradead.org> <20200904094617.GA27846@infradead.org> <20200904130044.GA7842@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 07:26:41PM +0530, Anup Patel wrote: > On Fri, Sep 4, 2020 at 6:30 PM Christoph Hellwig wrote: > > > > On Fri, Sep 04, 2020 at 08:58:25PM +0800, Qiu Wenbo wrote: > > > I can confirm this patch also breaks K210 support. It seems that > > > csr_read(CSR_TIME) will trigger an illegal instruction exception on K210. > > > > CSR_TIME is trapped by just about every implementation I know (which is > > explicitly allowed by the spec). That is why we should never use it > > from common M-mode code. > > Finally, I was able to replicate this issue by manually hacking QEMU to > not emulatie TIME CSR for virt machine. > > It seems this issue is only seen on older QEMU and Kendrtye K210. You'd also see it when running nommu on Sifivie or just about any hardware. Whoever implement the TIME CSR for qemu made a mistake IMHO as it doesn't match how most real hardware behaves.