Re: [PATCH v21 08/26] x86/mm: Introduce _PAGE_COW
From: Yu, Yu-cheng <hidden>
Date: 2021-03-03 11:02:24
Also in:
linux-arch, linux-doc, lkml
From: Yu, Yu-cheng <hidden>
Date: 2021-03-03 11:02:24
Also in:
linux-arch, linux-doc, lkml
On 3/1/2021 7:52 AM, Borislav Petkov wrote:
On Wed, Feb 17, 2021 at 02:27:12PM -0800, Yu-cheng Yu wrote:
[...]
quoted
static inline pmd_t pmd_mkdirty(pmd_t pmd) { - return pmd_set_flags(pmd, _PAGE_DIRTY | _PAGE_SOFT_DIRTY); + pmdval_t dirty = _PAGE_DIRTY; + + /* Avoid creating (HW)Dirty=1, Write=0 PMDs */ + if (cpu_feature_enabled(X86_FEATURE_SHSTK) && !(pmd_flags(pmd) & _PAGE_RW))!(pmd_write(pmd))
There is a problem of doing that: pmd_write() is defined after this function. Maybe we can declare it first, or leave this as-is? -- Yu-cheng