Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Dave Hansen
On 02/16/2018 10:25 AM, Nadav Amit wrote: >> --- a/arch/x86/mm/pageattr.c~kpti-no-global-for-kernel-mappings >> 2018-02-13 15:17:56.148210060 -0800 >> +++ b/arch/x86/mm/pageattr.c 2018-02-13 15:17:56.153210060 -0800 >> @@ -593,7 +593,8 @@ try_preserve_large_page(pte_t *kpte, uns >> * di

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Dave Hansen
On 02/16/2018 11:54 AM, Nadav Amit wrote: >> But I don't really want to hide that gunk in a macro like that. It >> might make more sense as a static inline. I'll give that a shot and resent. > Since determining whether PTI is on is done in several places in the kernel, > maybe there should a sing

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Nadav Amit
Dave Hansen wrote: > On 02/16/2018 10:25 AM, Nadav Amit wrote: >>> +#ifdef CONFIG_PAGE_TABLE_ISOLATION >>> +#define __PAGE_KERNEL_GLOBAL 0 >>> +#else >>> +#define __PAGE_KERNEL_GLOBAL _PAGE_GLOBAL >>> +#endif >> ... >>> --- a/arch/x86/mm/pageattr.c~kpti-no-global-for-k

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Dave Hansen
On 02/16/2018 10:25 AM, Nadav Amit wrote: >> +#ifdef CONFIG_PAGE_TABLE_ISOLATION >> +#define __PAGE_KERNEL_GLOBAL0 >> +#else >> +#define __PAGE_KERNEL_GLOBAL_PAGE_GLOBAL >> +#endif > ... >> --- a/arch/x86/mm/pageattr.c~kpti-no-global-for-kernel-mappings >> 2018

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Nadav Amit
Dave Hansen wrote: > On 02/16/2018 09:47 AM, Nadav Amit wrote: >>> But, this also means that we now get *no* opportunity to use >>> global pages with PTI, even for data which is shared such as the >>> cpu_entry_area and entry/exit text. >> >> Doesn’t this patch change the kernel behavior when th

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Dave Hansen
On 02/16/2018 09:47 AM, Nadav Amit wrote: >> But, this also means that we now get *no* opportunity to use >> global pages with PTI, even for data which is shared such as the >> cpu_entry_area and entry/exit text. > > Doesn’t this patch change the kernel behavior when the “nopti” > parameter is use

Re: [PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-16 Thread Nadav Amit
Dave Hansen wrote: > > From: Dave Hansen > > Kernel mappings are historically _PAGE_GLOBAL. But, with PTI, we do not > want them to be _PAGE_GLOBAL. We currently accomplish this by simply > clearing _PAGE_GLOBAL from the suppotred mask which ensures it is > cleansed from many of our PTE cons

[PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-15 Thread Dave Hansen
From: Dave Hansen Kernel mappings are historically _PAGE_GLOBAL. But, with PTI, we do not want them to be _PAGE_GLOBAL. We currently accomplish this by simply clearing _PAGE_GLOBAL from the suppotred mask which ensures it is cleansed from many of our PTE construction sites: if (!stati

[PATCH 2/3] x86/mm: introduce __PAGE_KERNEL_GLOBAL

2018-02-13 Thread Dave Hansen
From: Dave Hansen Kernel mappings are historically _PAGE_GLOBAL. But, with PTI, we do not want them to be _PAGE_GLOBAL. We currently accomplish this by simply clearing _PAGE_GLOBAL from the suppotred mask which ensures it is cleansed from many of our PTE construction sites: if (!stati