Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4561600pxb; Mon, 27 Sep 2021 21:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO1TtDusE4Ls6nlqI4X9OoG/l22S8w3f6R/udjvfhB0idKj9z2kuOnpB4tRobMCgQ+R7z9 X-Received: by 2002:a05:6402:143b:: with SMTP id c27mr5205453edx.224.1632803463978; Mon, 27 Sep 2021 21:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632803463; cv=none; d=google.com; s=arc-20160816; b=tUhru9hWDCfKnhUy6q+m5XTVnsbhat44QtYK1GftW0znpznlf1Q2YEabtxmDHf0RPb rqjBNJU+DR51OtaK8zE/M9wu/D8boSyK761zTVnnU2/d+N7NNe8gB/ecOe47BypmY/1q c5kW+eT3FBavJaZ/9yJCjMGwCnU5VOUsn07QzABh67hnvZSD4QuWF80godp+8HQJu347 mOMWntVFuGJ8zN/4yPGYXPWKy2DHXIlNyD8da34sM6eXQx+gvIBvfpigdlcsrVucYiGR fCCnF00q1LgBb4lNq0lV0HzFf5c9y8adgl/sZovRSIcOWHEmHDVAX2jp/8evTt9QfFfE /7vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=noe4hEAkbPLyBzwsLG+b+9dUQ25Iugn4/xpnSPeZAuc=; b=dBq1udVxuBy4TVZPMqwwPjmQyWJjZIT/QPlK/OqUix1esO6uWkEklvPvmIrQ3XTQep h2BDlMfke+f89qyReCewN102ry7jcolm3gn1D6mehsOX7MctEPBtT6HxCzkmOs4tySdt YpNsgKaERA3iN4SuCf6vVE+HJEqSUoLFWXMzMohFj8V1ecXOLJRUoiGSglHKyIeS0C0t qbMjyNcDZbaNhFOsP70HOqyD2DYlDlrH8AI7xAZiwb2f/Rkz4SN0HAgTADLlgzCc1iJ3 KhrXvnzSlghwW93fxx7VlXMPvyxWfeviDjobkLN8nlsdbBR1vxz1xoQv+cseyU+eiEfk tq/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=ctUHytmL; 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 d25si3731013ejo.354.2021.09.27.21.30.39; Mon, 27 Sep 2021 21:31:03 -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=@atishpatra.org header.s=google header.b=ctUHytmL; 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 S234263AbhI1E2U (ORCPT + 99 others); Tue, 28 Sep 2021 00:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231432AbhI1E2U (ORCPT ); Tue, 28 Sep 2021 00:28:20 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED65C061575 for ; Mon, 27 Sep 2021 21:26:41 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id f133so28908009yba.11 for ; Mon, 27 Sep 2021 21:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=noe4hEAkbPLyBzwsLG+b+9dUQ25Iugn4/xpnSPeZAuc=; b=ctUHytmLgvRhUr64u9ZUvPYMirmLeEo1ceE54uHVxga0Zp6hfDZbpNOZ4ZA8yG8XMb YTsiXQjRH0z+TyECxxbOC1j9RFukaCdUqocVlR9iid9GQFLLRnwAJh2fm1l8OmZgXX13 0nqxEZAgpo7qOvaXxuECxOW2w2IGzdLEG/yPc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=noe4hEAkbPLyBzwsLG+b+9dUQ25Iugn4/xpnSPeZAuc=; b=EPPKDbbsNG9Z/qicbLuJANEk/fYSNLECdtXVk0HHA78dKrQYCW63IbRDu0EEm9I6JU EW+pBfM7jlixnWbj7yWOWrEkbHWtRGg3khdZ3qKPV+SvZqb5jhlQe1zHtPHi8Ap9H3TJ goTUEmdIcDpubPkbnWNu6RDq3tEAWYrxNuGIOmVPJoy0VYLH6t1HE77VpN3tEGDQyqk6 AjnWDwCEPt0QX05B0jiRSiokngtlS0nsN8GECURSzjB6HqujY4dPUj61Kl/3clwzSagI Dmwva9DrPn5I9zqs6jgAwT+VshTqrWR1MONHPz17TkjURPC0NPxKTYG76hOHVf9mTnoH 7VdQ== X-Gm-Message-State: AOAM532mH1zWKU2CwcmOQOsOOs4Rh6aEFgv42d/z2M93Sb81zajkvOMT UjHPIMEZV7klHQdhud+UvbwqF83v/lKe7+63tv0c X-Received: by 2002:a5b:2d2:: with SMTP id h18mr4411546ybp.526.1632803200399; Mon, 27 Sep 2021 21:26:40 -0700 (PDT) MIME-Version: 1.0 References: <20210923172107.1117604-1-guoren@kernel.org> <0790abcfa1174e0e9b5e7b185f87ced9@mailhost.ics.forth.gr> In-Reply-To: From: Atish Patra Date: Mon, 27 Sep 2021 21:26:29 -0700 Message-ID: Subject: Re: [PATCH V2 1/2] riscv: Add RISC-V svpbmt extension To: Anup Patel Cc: Nick Kossifidis , Guo Ren , Palmer Dabbelt , Anup Patel , Atish Patra , Palmer Dabbelt , =?UTF-8?Q?Christoph_M=C3=BCllner?= , Philipp Tomsich , Christoph Hellwig , liush , wefu@redhat.com, =?UTF-8?B?V2VpIFd1ICjlkLTkvJ8p?= , Drew Fustini , linux-riscv , "linux-kernel@vger.kernel.org List" , taiten.peng@canonical.com, Aniket Ponkshe , Heinrich Schuchardt , Gordan Markus , Guo Ren , Arnd Bergmann , Chen-Yu Tsai , Maxime Ripard , Daniel Lustig , Greg Favor , Andrea Mondelli , Jonathan Behrens , Xinhaoqu , Bill Huffman , Allen Baum , Josh Scheid , Richard Trauben Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 8:50 PM Anup Patel wrote: > > On Tue, Sep 28, 2021 at 6:32 AM Nick Kossifidis wrote= : > > > > =CE=A3=CF=84=CE=B9=CF=82 2021-09-27 23:13, Atish Patra =CE=AD=CE=B3=CF= =81=CE=B1=CF=88=CE=B5: > > >> We need to decide whether we should support the upstream kernel for > > >> D1. Few things to consider. > > >> =E2=80=93 Can it be considered as an errata ? > > > > It's one thing to follow the spec and have an error in the > > implementation, and another to not follow the spec. > > > > >> =E2=80=93 Does it set a bad precedent and open can of worms in futur= e ? > > > > IMHO yes, I'm thinking of Kendryte 210 devs for example coming up and > > asking for MMU support, they 've also shipped many chips already. I can > > also imagine other vendors in the future coming up with implementations > > that violate the spec in which case handling the standard stuff will > > become messy and complex, and hurt performance/security. We'll end up > > filling the code with exceptions and tweaks all over the place. We need > > to be strict about what is "riscv" and what's "draft riscv" or "riscv > > inspired", and what we are willing to support upstream. I can understan= d > > supporting vendor extensions upstream but they need to fit within the > > standard spec, we can't have for example extensions that use encoding > > space/csrs/fields etc reserved for standard use, they may only use > > what's reserved for custom/vendor use. At least let's agree on that. > > Totally agree with Nick here. It's a slippery slope. > > Including D1 PTE bits (or Kendryte K210 MMU) part of the Linux RISC-V > means future hardware which intentionally violates specs will also have t= o > be merged and the RISC-V patch acceptance policy will have no significanc= e. > > > > > >> =E2=80=93 Can we just ignore D1 given the mass volume ? > > >> > > > > IMHO no, we need to find a way to support it upstream but I believe > > there is another question to answer: > > > > Do we also guarantee "one image to rule them all" approach, required by > > binary distros, for implementations that violate the spec ? Are we ok > > for example to support Allwinner D1 upstream but require a custom > > configuration/build instead of supporting it with the "generic" image ? > > In one case we need to handle the violation at runtime and introduce > > overhead for everyone (like looking up __riscv_svpbmt every time we set > > a PTE in this case), in the other it's an #ifdef. > > At least, we should not have hardware violating specs as part of the > unified kernel image instead have these intentional deviations/violations > under separate kconfig which will not be enabled by default. This means > vendors (of such hardware) and distros will have to explicitly enable > support for such violations/deviations. > If we merge the code and are not enabled by default, it would be a maintenance nightmare in future. These part of the kernel will not be regularly tested but we have to carry the changes for a long time. Similar changes will only grow over time causing a lot of custom configs that are not enabled by default. IMHO, if we want to support this board in upstream, we should just clearly state that it is one time special exception for this board only because of the following reasons 1. The board design predates the patch acceptance policy. 2. We don't have enough affordable Linux compatible platforms today. 3. Allowing running an upstream kernel on D1 helps the RISC-V software ecosystem to grow. No more exceptions will be allowed in future for such hardware that violates the spec. Period. > Regards, > Anup --=20 Regards, Atish