lkml.org 
[lkml]   [2020]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] MIPS changes for v5.8-rc1
On Wed, Jun 3, 2020 at 6:11 PM maobibo <maobibo@loongson.cn> wrote:
>
> On architectures that manage the access bit in hardware, access bit is
> set at the beginning even if there is no memory access. On MIPS system
> access bit is not set at the beginning, it is set in page fault handling.

I had a hard time parsing that.

But I think you mean that the access bit is already set in the pgprot
bits on other architectures. And yeah, you seem to be right for at
least x86.

So yes, it seems unnecessary to set the accessed bit again, when the
accessed bit is already there from the pgprot bits. Good point.

> I am investigating why access bit is not set at the
> beginning in MIPS system.

Yeah, that does seem to be the right thing to do.

On x86, we have (for example)

#define PAGE_COPY __pg(__PP| 0|_USR|___A|__NX| 0| 0| 0)
..
#define __P010 PAGE_COPY

where that "__A" bit is the accessed bit (_PAGE_ACCESSED), just a
small internal macro to make all those line up nicely.

And that ends up being used for that protection_map[] array.

MIPS fills in the initial protection bits in protection_map[] with
dummy values, and then seems to initialize them without ever setting
the accessed bit there.

Not sure why that initialization then doesn't just add the pte_mkyoung..

Linus

\
 
 \ /
  Last update: 2020-06-04 03:25    [W:0.048 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site