[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201124101901.GB9682@infradead.org>
Date: Tue, 24 Nov 2020 10:19:01 +0000
From: "hch@...radead.org" <hch@...radead.org>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
Cc: "hch@...radead.org" <hch@...radead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"peterz@...radead.org" <peterz@...radead.org>,
"jeyu@...nel.org" <jeyu@...nel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"rppt@...nel.org" <rppt@...nel.org>,
"ast@...nel.org" <ast@...nel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Weiny, Ira" <ira.weiny@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"Reshetova, Elena" <elena.reshetova@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"luto@...nel.org" <luto@...nel.org>
Subject: Re: [PATCH RFC 01/10] vmalloc: Add basic perm alloc implementation
On Mon, Nov 23, 2020 at 08:44:12PM +0000, Edgecombe, Rick P wrote:
> Well, there were two reasons:
> 1. Non-standard naming for the PAGE_FOO flags. For example,
> PAGE_KERNEL_ROX vs PAGE_KERNEL_READ_EXEC. This could be unified. I
> think it's just riscv that breaks the conventions. Others are just
> missing some.
We need to standardize those anyway. I've done that for a few
PAGE_* constants already but as you see there is more work to do.
> But I thought that using those pgprot flags was still sort overloading
> the meaning of pgprot. My understanding was that it is supposed to hold
> the actual bits set in the PTE. For example large pages or TLB hints
> (like PAGE_KERNEL_EXEC_CONT) could set or unset extra bits, so asking
> for PAGE_KERNEL_EXEC wouldn't necessarily mean "set these bits in all
> of the PTEs", it could mean something more like "infer what I want from
> these bits and do that".
>
> x86's cpa will also avoid changing NX if it is not supported, so if the
> caller asked for PAGE_KERNEL->PAGE_KERNEL_EXEC in perm_change() it
> should not necessarily bother setting all of the PAGE_KERNEL_EXEC bits
> in the actual PTEs. Asking for PERM_RW->PERM_RWX on the other hand,
> would let the implementation do whatever it needs to set the memory
> executable, like set_memory_x() does. It should work either way but
> seems like the expectations would be a little clearer with the PERM_
> flags.
Ok, maybe that is an argument, and we should use the new flags more
broadly.
> Could easily wrap this one, but just to clarify, do you mean lines over
> 80 chars? There were already some over 80 in vmalloc before the move to
> 100 chars, so figured it was ok to stretch out now.
CodingStyle still says 80 characters unless you have an exception where
a longer line improves the readability. The quoted code absolutely
does not fit the definition of an exception or improves readability.
Powered by blists - more mailing lists