Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1434645pxk; Fri, 4 Sep 2020 09:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+y51x4erIurF8V9TqXZIoLZkgOqomCtgjOwa5volHhdgdJIj6J5sJltTG/jHl/mptHGcM X-Received: by 2002:aa7:d4d2:: with SMTP id t18mr9280752edr.55.1599236185832; Fri, 04 Sep 2020 09:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599236185; cv=none; d=google.com; s=arc-20160816; b=LNyeehpX8dVEoqaUAdvcNLT9Jb5Fz65xLwQwvxJw/IYjupEkRm4PHS7VpRsXswR737 I0rNIJhx6dbt1JpWBcOdISPXIqMKY9b3Vz7dad0E+ML7swTFHdar3ailLuKxZHSDRORI d4lWAfvU9i/rt2qpmQu8WWguLBBwYP882usaqc/chdMCX9trJUFd/vjoOzaQ5DueU9qS nyozb8tdHS8Amfh04LwhMRO6QHWX3vYlZCUMTUG1PjyRar8wUzszsmAWzFv3/bQaTz0K pXm9NLctZU36B6fAZsN0msYpVWxjnbH8pXdjRQr3+D7d9shtU2PTqlja+UcoglyGtCML zQSQ== 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=V3rhhfTC3l11VUo1+dStci1vsiRgGk779RrN04Aw6ww=; b=RCs2cWsttPEF2gwZS6qtFE+M2TWx7Nj1/dEkz1JlclpWhJ3IRR86q6YnvF/A7v5g4w FfNiH6iJ0pXbBpkNmZkjk4fDmNVHKcYPtgHfjHTIqcJ3T+TTT7YNcArTdH1aqGNw7zFL 975YJDbJc+W92pFeH6gMluNCnhxreq7jr9Pf8sBZvsSVudEf+168xoLEQttbrS/N95kV bczDgAB/U8H3ZREaTExoxpbJg4X3mC+J+sM+zPLCYIl6sZ7jJaawm5wXt4Giu/TaAKDG rNRkrlauUKK0Fjzh5ulwuLazKajF4zWbIHMFxWH8HluYOyGjb9fame6Pl8G1Y+YIf0Fl j8uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=KWuSlcwl; 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 b9si4444728edn.357.2020.09.04.09.16.02; Fri, 04 Sep 2020 09:16:25 -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=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=KWuSlcwl; 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 S1727916AbgIDQPX (ORCPT + 99 others); Fri, 4 Sep 2020 12:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgIDQPJ (ORCPT ); Fri, 4 Sep 2020 12:15:09 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10B1C061244 for ; Fri, 4 Sep 2020 09:15:08 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z4so7301705wrr.4 for ; Fri, 04 Sep 2020 09:15:08 -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=V3rhhfTC3l11VUo1+dStci1vsiRgGk779RrN04Aw6ww=; b=KWuSlcwlEEIgRnaQ1WlxG7B4FBZs+NwIYXlSdFTYNkwYPg1WNTwTF406wwqN20WeaF 7JWuP1bS4LIpQBOBJOiSsNYHql3mV5FqrjzVVgvfvr4MKbFQr38KvuX/00CIZU0/NHCT /5oZFJrOsFfjWNVwGCv5UOzmLED/gKnV8L49ZLJiFGxKL+DFWWs7K20vOWIoDC+GEW3p OBjbR46qzgDYwRIx2orihI2qwHGWIKAmIbVrtNhAIcjNNOHfbUnCZUy9IToOMz5W5gvX gqk4lKKWBn83Lppc0LU63aKg0T/VwYeZoLpMW8UXdpBOvewdiC8iAmTmaZrgB7sLRJmw Xong== 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=V3rhhfTC3l11VUo1+dStci1vsiRgGk779RrN04Aw6ww=; b=WYUP2kyBZPs+HLdzVPungA1uvD/aUws3oyZzlirVWL1mBePwXaNRh+pRVJFfFHni3i KabNBoGyyb0pwtHfc7qONM/+auK8Cie8fW/iYBpdxO9NwvhF1ay/6KgHed9bDwcCHc6O qofMVbo6AAyjIEnqowDoPVwJJ2Cc7fG9jQVRrY/4Kek8koXtFnYY6h+c0y/pRxixEEVw 44Dy6lWXGsquUwHeLGJtlh2hNhnGmJMhg0AR41CJG/OfJm204Yxwory42QAsmnPhtaiG 2zFgkpw9X+d+Vn32ytsQWg8JF/1DGuLJ1s5rVOBXDh80KdZ37+8MPYu2AZTqCIy75YGr apgg== X-Gm-Message-State: AOAM5339hhTA0wHl8dCl8+4vMI236Y92cHw0K/9oNlyI3jSmJvPGpJ9v S9tXBkly/l2KGRirBUtKAwHY03MJH7wQCe8WEWsSOw== X-Received: by 2002:adf:f552:: with SMTP id j18mr9032487wrp.128.1599236107381; Fri, 04 Sep 2020 09:15:07 -0700 (PDT) MIME-Version: 1.0 References: <20200904083109.GA9182@infradead.org> <20200904094617.GA27846@infradead.org> <20200904130044.GA7842@infradead.org> <20200904160335.GA23669@infradead.org> In-Reply-To: <20200904160335.GA23669@infradead.org> From: Anup Patel Date: Fri, 4 Sep 2020 21:44:55 +0530 Message-ID: Subject: Re: [GIT PULL] RISC-V Fixes for 5.9-rc2 To: Christoph Hellwig Cc: Qiu Wenbo , Palmer Dabbelt , linux-riscv , Linus Torvalds , Linux Kernel Mailing 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 Fri, Sep 4, 2020 at 9:33 PM Christoph Hellwig wrote: > > 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. There are quite a few RISCV systems who implement TIME CSR in hardware due to performance gains (10+ %). The QEMU virt machine does not represent real-world HW so we should emulate all possible HW optimizations in QEMU virt machine. On other hand, the QEMU sifive_u machine correctly matches the real-world SiFive Unleashed in-context of TIME CSR and other HW features. IMHO, we need nommu defconfig for SiFive Unleashed so that we can try NoMMU kernel on both QEMU virt and QEMU sifive_u machine. Regards, Anup