Re: [PATCH v24 20/30] mm/mprotect: Exclude shadow stack from preserve_write

2021-04-09 Thread Kirill A. Shutemov
On Thu, Apr 01, 2021 at 03:10:54PM -0700, Yu-cheng Yu wrote: > In change_pte_range(), when a PTE is changed for prot_numa, _PAGE_RW is > preserved to avoid the additional write fault after the NUMA hinting fault. > However, pte_write() now includes both normal writable and shadow stack > (RW=0,

[PATCH v24 20/30] mm/mprotect: Exclude shadow stack from preserve_write

2021-04-01 Thread Yu-cheng Yu
In change_pte_range(), when a PTE is changed for prot_numa, _PAGE_RW is preserved to avoid the additional write fault after the NUMA hinting fault. However, pte_write() now includes both normal writable and shadow stack (RW=0, Dirty=1) PTEs, but the latter does not have _PAGE_RW and has no need to