[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6f68d7af6a618c087a85d2db6ad40b346e055452.camel@intel.com>
Date: Wed, 01 Apr 2020 12:08:16 -0700
From: Yu-cheng Yu <yu-cheng.yu@...el.com>
To: Dave Hansen <dave.hansen@...el.com>, 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>,
Borislav Petkov <bp@...en8.de>,
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>, x86-patch-review@...el.com
Subject: Re: [RFC PATCH v9 09/27] x86/mm: Introduce _PAGE_DIRTY_SW
On Wed, 2020-02-26 at 13:35 -0800, Dave Hansen wrote:
> On 2/5/20 10:19 AM, Yu-cheng Yu wrote:
> > When Shadow Stack (SHSTK) is introduced, a R/O and Dirty PTE exists in the
> > following cases:
> >
> > (a) A modified, copy-on-write (COW) page;
> > (b) A R/O page that has been COW'ed;
> > (c) A SHSTK page.
[...]
> > diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
> > index e647e3c75578..826823df917f 100644
> > --- a/arch/x86/include/asm/pgtable_types.h
> > +++ b/arch/x86/include/asm/pgtable_types.h
> > @@ -23,7 +23,8 @@
> > #define _PAGE_BIT_SOFTW2 10 /* " */
> > #define _PAGE_BIT_SOFTW3 11 /* " */
> > #define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
> > -#define _PAGE_BIT_SOFTW4 58 /* available for programmer */
> > +#define _PAGE_BIT_SOFTW4 57 /* available for programmer */
> > +#define _PAGE_BIT_SOFTW5 58 /* available for programmer */
> > #define _PAGE_BIT_PKEY_BIT0 59 /* Protection Keys, bit 1/4 */
> > #define _PAGE_BIT_PKEY_BIT1 60 /* Protection Keys, bit 2/4 */
> > #define _PAGE_BIT_PKEY_BIT2 61 /* Protection Keys, bit 3/4 */
> > @@ -35,6 +36,12 @@
> > #define _PAGE_BIT_SOFT_DIRTY _PAGE_BIT_SOFTW3 /* software dirty tracking */
> > #define _PAGE_BIT_DEVMAP _PAGE_BIT_SOFTW4
> >
> > +/*
> > + * This bit indicates a copy-on-write page, and is different from
> > + * _PAGE_BIT_SOFT_DIRTY, which tracks which pages a task writes to.
> > + */
> > +#define _PAGE_BIT_DIRTY_SW _PAGE_BIT_SOFTW5 /* was written to */
>
> Does it *only* indicate a copy-on-write (or copy-on-access) page? If
> so, haven't we misnamed it?
It indicates either a copy-on-write page or a read-only page that has been
cow'ed. What about _PAGE_BIT_COW?
Yu-cheng
Powered by blists - more mailing lists