[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5f8da4cc-9c5c-73f9-7426-924c77797995@intel.com>
Date: Tue, 26 Jan 2021 08:45:06 -0800
From: "Yu, Yu-cheng" <yu-cheng.yu@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Andy Lutomirski <luto@...nel.org>,
Balbir Singh <bsingharora@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Eugene Syromiatnikov <esyr@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
"H.J. Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>,
Dave Martin <Dave.Martin@....com>,
Weijiang Yang <weijiang.yang@...el.com>,
Pengfei Xu <pengfei.xu@...el.com>
Subject: Re: [PATCH v17 11/26] x86/mm: Update ptep_set_wrprotect() and
pmdp_set_wrprotect() for transition from _PAGE_DIRTY to _PAGE_COW
On 1/26/2021 2:24 AM, Borislav Petkov wrote:
> On Mon, Jan 25, 2021 at 02:18:37PM -0800, Yu, Yu-cheng wrote:
>> For example, when a thread reads a W=1, D=0 PTE and before changing it to
>> W=0,D=0, another thread could have written to the page and the PTE is W=1,
>> D=1 now. When try_cmpxchg() detects the difference, old_pte is read again.
>
> None of that is mentioned in the comment above it and if anything,
> *that* is what should be explained there - not some guarantee about some
> processors which doesn't even apply here.
>
> Also, add the fact that try_cmpxchg() will update old_pte with any
> modified bits - D=1 for example - when it fails. As Peter just explained
> to me on IRC.
>
> Thx.
>
Yes, I will fix it. Thanks!
Powered by blists - more mailing lists