Thread (222 messages) 222 messages, 21 authors, 2022-11-03

Re: [PATCH v2 12/39] x86/mm: Update ptep_set_wrprotect() and pmdp_set_wrprotect() for transition from _PAGE_DIRTY to _PAGE_COW

From: Nadav Amit <hidden>
Date: 2022-10-03 23:18:02
Also in: linux-arch, linux-doc, linux-mm, lkml

On Oct 3, 2022, at 3:28 PM, Edgecombe, Rick P [off-list ref] wrote:
On Mon, 2022-10-03 at 11:11 -0700, Nadav Amit wrote:
quoted
Did you have a look at ptep_set_access_flags() and friends and
checked they
do not need to be changed too? 
ptep_set_access_flags() doesn't actually set any additional dirty bits
on x86, so I think it's ok.
Are you sure about that? (lost my confidence today so I am hesitant).

Looking on insert_pfn(), I see:

                        entry = maybe_mkwrite(pte_mkdirty(entry), vma);
                        if (ptep_set_access_flags(vma, addr, pte, entry, 1)) ...

This appears to set the dirty bit while potentially leaving the write-bit
clear. This is the scenario you want to avoid, no?
quoted
Perhaps you should at least add some
assertion just to ensure nothing breaks.
You mean in ptep_set_access_flags()? I think some assertions would be
really great, I'm just not sure where.
Yes, on x86’s version of the function.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help