lkml.org 
[lkml]   [2021]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH V4 1/6] riscv: pgtable: Add custom protection_map init
Hi Christoph,

On Wed, Sep 15, 2021 at 3:46 PM Christoph Hellwig <hch@lst.de> wrote:
>
> On Sat, Sep 11, 2021 at 05:21:34PM +0800, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Some RISC-V CPU vendors have defined their own PTE attributes to
> > solve non-coherent DMA bus problems. That makes _P/SXXX definitions
> > contain global variables which could be initialized at the early
> > boot stage before setup_vm. The patch prevents compile errors.
>
> That sounds way to nice for someone who deliberatly ignores the
> specification and should definitively not go into the kernel
> commit log like this.
Okay. In the next version, I will optimize the wording.

>
> > This patch is similar to 316d097c4cd4 (x86/pti: Filter at
> > vma->vm_page_prot population) which give a choice for arch custom
> > implementation.
>
> How? To me it looks like a bad duplication of such functionality in
> a way that totally breaks abstractions. architectures really do not
> have any business changing protection_map.
D1's _P/SXXX definintion is different from riscv standard spec to get
non-coherency supported. It sets the highest bits and current spec
must keep zero. So we using a global variable struct in the _P/SXXX
definition to let vendors init their own _P/SXXX values during
bootstrap that is very early stage before setup_vm().


--
Best Regards
Guo Ren

ML: https://lore.kernel.org/linux-csky/

\
 
 \ /
  Last update: 2021-09-16 01:53    [W:0.080 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site