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
Reply to
Borislav Petkov, 2021-03-01
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
Thread (44 messages) 44 messages, 3 authors, last reply 2021-03-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help