From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A43BEC433EF for ; Tue, 2 Nov 2021 06:07:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8390960EB9 for ; Tue, 2 Nov 2021 06:07:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbhKBGKO (ORCPT ); Tue, 2 Nov 2021 02:10:14 -0400 Received: from verein.lst.de ([213.95.11.211]:54538 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhKBGKN (ORCPT ); Tue, 2 Nov 2021 02:10:13 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 811A468AFE; Tue, 2 Nov 2021 07:07:34 +0100 (CET) Date: Tue, 2 Nov 2021 07:07:34 +0100 From: Christoph Hellwig To: Wei Fu Cc: Christoph Hellwig , Anup Patel , Atish Patra , Palmer Dabbelt , guoren@kernel.org, christoph.muellner@vrull.eu, Philipp Tomsich , Christoph Hellwig , Liu Shaohua , Wei Wu =?utf-8?B?KOWQtOS8nyk=?= , Drew Fustini , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, taiten.peng@canonical.com, aniket.ponkshe@canonical.com, heinrich.schuchardt@canonical.com, gordan.markus@canonical.com, guoren@linux.alibaba.com, Arnd Bergmann , Chen-Yu Tsai , Maxime Ripard , Daniel Lustig , Greg Favor , Andrea Mondelli , Jonathan Behrens , Xinhaoqu , Bill Huffman , Nick Kossifidis , Allen Baum , Josh Scheid , Richard Trauben Subject: Re: [RESEND PATCH V3 2/2] riscv: add RISC-V Svpbmt extension supports Message-ID: <20211102060734.GB27015@lst.de> References: <20211025040607.92786-1-wefu@redhat.com> <20211025040607.92786-3-wefu@redhat.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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 06:55:09PM +0800, Wei Fu wrote: > How about this macro: > #define _SVPBMT_PMA 0x0UL > #define _SVPBMT_NC BIT(61) > #define _SVPBMT_IO BIT(62) > #define _SVPBMT_MASK GENMASK(62, 61) Personally I find these macros highly confusing. #define _SVPBMT_PMA 0UL #define _SVPBMT_NC (1UL << 61) #define _SVPBMT_IO (1UL << 62). #define _SVPBMT_MASK (_SVPBMT_NC | _SVPBMT_IO) is much eaier to follow. Note that we can probably just drop _SVPBMT_PMA entirely to make this even more readable. > > Also why not use the standard names for these _PAGE bits used by > > most other architectures? > > Which names are you suggesting? Would you mind providing an example ? > _PAGE_BIT_ for _PAGE_KERNEL_ ?? Use _PAGE_NOCACHE for _SVPBMT_NC, and _PAGE_IO for _SVPBMT_IO.