[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+YCwKk8Fa4ifaoQR=nHGXM2AHx9S8Ofow8H5dZ0bmjL49t=rw@mail.gmail.com>
Date: Sun, 7 Nov 2021 14:54:47 +0800
From: Wei Fu <wefu@...hat.com>
To: Christoph Hellwig <hch@....de>
Cc: Christoph Hellwig <hch@...radead.org>,
Anup Patel <anup.patel@....com>,
Atish Patra <atish.patra@....com>,
Palmer Dabbelt <palmerdabbelt@...gle.com>, guoren@...nel.org,
christoph.muellner@...ll.eu,
Philipp Tomsich <philipp.tomsich@...ll.eu>,
Liu Shaohua <liush@...winnertech.com>,
Wei Wu (吴伟) <lazyparser@...il.com>,
Drew Fustini <drew@...gleboard.org>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
taiten.peng@...onical.com, aniket.ponkshe@...onical.com,
heinrich.schuchardt@...onical.com, gordan.markus@...onical.com,
guoren@...ux.alibaba.com, Arnd Bergmann <arnd@...db.de>,
Chen-Yu Tsai <wens@...e.org>,
Maxime Ripard <maxime@...no.tech>,
Daniel Lustig <dlustig@...dia.com>,
Greg Favor <gfavor@...tanamicro.com>,
Andrea Mondelli <andrea.mondelli@...wei.com>,
Jonathan Behrens <behrensj@....edu>,
Xinhaoqu <xinhaoqu@...wei.com>,
Bill Huffman <huffman@...ence.com>,
Nick Kossifidis <mick@....forth.gr>,
Allen Baum <allen.baum@...erantotech.com>,
Josh Scheid <jscheid@...tanamicro.com>,
Richard Trauben <rtrauben@...il.com>
Subject: Re: [RESEND PATCH V3 2/2] riscv: add RISC-V Svpbmt extension supports
Hi Christoph,
Great thanks for your review.
On Tue, Nov 2, 2021 at 2:04 PM Christoph Hellwig <hch@....de> wrote:
>
> On Mon, Oct 25, 2021 at 10:49:11PM +0800, Wei Fu wrote:
> > > > + >> _PAGE_PFN_SHIFT);
> > >
> > > > static inline unsigned long _pmd_pfn(pmd_t pmd)
> > > > {
> > > > - return pmd_val(pmd) >> _PAGE_PFN_SHIFT;
> > > > + return (pmd_val(pmd) & _PAGE_CHG_MASK) >> _PAGE_PFN_SHIFT;
> > > > }
> > >
> > > The "(pud_val(pud) & _PAGE_CHG_MASK) >> _PAGE_PFN_SHIFT" expression begs
> > > for readable and well-documented helper.
> >
> > How about these:
> > #define _chg_of_pmd(pmd) (pmd_val(pmd) & _PAGE_CHG_MASK)
> > #define _chg_of_pud(pud) (pud_val(pud) & _PAGE_CHG_MASK)
>
> I'd use inline functions instead of macros if possible, but otherwise
> yes.
Great thanks for your suggestion, I will change this to inline :-)
>
> > How about :
> >
> > extern unsigned long _svpbmt_mask
> > extern unsigned long _svpbmt_mt_pma
> > extern unsigned long _svpbmt_mt_nc
> > extern unsigned long _svpbmt_mt_io
> >
> > #define _PAGE_MT_MASK _svpbmt_mask
> > #define _PAGE_MT_PMA _svpbmt_mt_pma
> > #define _PAGE_MT_NC _svpbmt_mt_nc
> > #define _PAGE_MT_IO _svpbmt_mt_io
>
> Looks much better.
Thanks , will do this way
>
Powered by blists - more mailing lists