Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-28 Thread Yu-cheng Yu
On Wed, 2019-08-28 at 09:03 +0200, Peter Zijlstra wrote: > On Tue, Aug 27, 2019 at 03:37:12PM -0700, Yu-cheng Yu wrote: > > On Fri, 2019-08-23 at 16:02 +0200, Peter Zijlstra wrote: > > > On Tue, Aug 13, 2019 at 01:52:09PM -0700, Yu-cheng Yu wrote: > > > > > > > +static inline pte_t pte_move_flags(

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-28 Thread Peter Zijlstra
On Tue, Aug 27, 2019 at 03:37:12PM -0700, Yu-cheng Yu wrote: > On Fri, 2019-08-23 at 16:02 +0200, Peter Zijlstra wrote: > > On Tue, Aug 13, 2019 at 01:52:09PM -0700, Yu-cheng Yu wrote: > > > > > +static inline pte_t pte_move_flags(pte_t pte, pteval_t from, pteval_t to) > > > +{ > > > + if (pte_fla

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-27 Thread Yu-cheng Yu
On Fri, 2019-08-23 at 16:02 +0200, Peter Zijlstra wrote: > On Tue, Aug 13, 2019 at 01:52:09PM -0700, Yu-cheng Yu wrote: > > > +static inline pte_t pte_move_flags(pte_t pte, pteval_t from, pteval_t to) > > +{ > > + if (pte_flags(pte) & from) > > + pte = pte_set_flags(pte_clear_flags(pte

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-23 Thread Peter Zijlstra
On Tue, Aug 13, 2019 at 01:52:09PM -0700, Yu-cheng Yu wrote: > +static inline pte_t pte_move_flags(pte_t pte, pteval_t from, pteval_t to) > +{ > + if (pte_flags(pte) & from) > + pte = pte_set_flags(pte_clear_flags(pte, from), to); > + return pte; > +} Aside of the whole condit

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-14 Thread Dave Hansen
On 8/14/19 9:42 AM, Yu-cheng Yu wrote: > On Tue, 2019-08-13 at 16:02 -0700, Dave Hansen wrote: > [...] >> Please also reconcile the supervisor XSAVE portion of your patches with >> the ones that Fenghua has been sending around. I've given quite a bit >> of feedback to improve those. Please consol

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-14 Thread Yu-cheng Yu
On Tue, 2019-08-13 at 16:02 -0700, Dave Hansen wrote: [...] > Please also reconcile the supervisor XSAVE portion of your patches with > the ones that Fenghua has been sending around. I've given quite a bit > of feedback to improve those. Please consolidate and agree on a common > set of patches w

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-13 Thread Andy Lutomirski
On Aug 13, 2019, at 4:02 PM, Dave Hansen wrote: >> >> static inline pte_t pte_mkwrite(pte_t pte) >> { >> +pte = pte_move_flags(pte, _PAGE_DIRTY_SW, _PAGE_DIRTY_HW); >>return pte_set_flags(pte, _PAGE_RW); >> } > > It also isn't clear to me why this *must* move bits here. Its doubly >

Re: [PATCH v8 11/27] x86/mm: Introduce _PAGE_DIRTY_SW

2019-08-13 Thread Dave Hansen
> +#if defined(CONFIG_X86_INTEL_SHADOW_STACK_USER) > +static inline pte_t pte_move_flags(pte_t pte, pteval_t from, pteval_t to) > +{ > + if (pte_flags(pte) & from) > + pte = pte_set_flags(pte_clear_flags(pte, from), to); > + return pte; Why is this conditional on the compile op