[PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-06 Thread Dave Hansen
From: Dave Hansen The entry/exit text and cpu_entry_area are mapped into userspace and the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary TLB misses. Add the _PAGE_GLOBAL flag for these areas. Signed-off-by: Dave Hansen Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Linus

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-04 Thread Thomas Gleixner
On Wed, 4 Apr 2018, Nadav Amit wrote: > Dave Hansen wrote: > > On 04/03/2018 09:45 PM, Nadav Amit wrote: > >> Dave Hansen wrote: > >>> void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags) > >>> { > >>> unsigned long va = (unsigned long) cea_vaddr; > >>> + pte_t pte = pfn_pte(pa >>

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-04 Thread Nadav Amit
Dave Hansen wrote: > On 04/03/2018 09:45 PM, Nadav Amit wrote: >> Dave Hansen wrote: >> >>> From: Dave Hansen >>> >>> The entry/exit text and cpu_entry_area are mapped into userspace and >>> the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary >>> TLB misses. >>> >>> Add th

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-04 Thread Dave Hansen
On 04/03/2018 09:45 PM, Nadav Amit wrote: > Dave Hansen wrote: > >> >> From: Dave Hansen >> >> The entry/exit text and cpu_entry_area are mapped into userspace and >> the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary >> TLB misses. >> >> Add the _PAGE_GLOBAL flag for these a

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-03 Thread Nadav Amit
Dave Hansen wrote: > > From: Dave Hansen > > The entry/exit text and cpu_entry_area are mapped into userspace and > the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary > TLB misses. > > Add the _PAGE_GLOBAL flag for these areas. > > Signed-off-by: Dave Hansen > Cc: Andrea

[PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-03 Thread Dave Hansen
From: Dave Hansen The entry/exit text and cpu_entry_area are mapped into userspace and the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary TLB misses. Add the _PAGE_GLOBAL flag for these areas. Signed-off-by: Dave Hansen Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Linus

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-02 Thread Dave Hansen
On 04/02/2018 10:56 AM, Linus Torvalds wrote: > On Mon, Apr 2, 2018 at 10:27 AM, Dave Hansen > wrote: >> + /* >> +* The cpu_entry_area is shared between the user and kernel >> +* page tables. All of its ptes can safely be global. >> +*/ >> + if (boot_cpu_has(X8

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-02 Thread Linus Torvalds
On Mon, Apr 2, 2018 at 10:27 AM, Dave Hansen wrote: > > + /* > +* The cpu_entry_area is shared between the user and kernel > +* page tables. All of its ptes can safely be global. > +*/ > + if (boot_cpu_has(X86_FEATURE_PGE)) > + pte = pte_set_flags

[PATCH 09/11] x86/pti: enable global pages for shared areas

2018-04-02 Thread Dave Hansen
From: Dave Hansen The entry/exit text and cpu_entry_area are mapped into userspace and the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary TLB misses. Add the _PAGE_GLOBAL flag for these areas. Signed-off-by: Dave Hansen Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Linus

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-03-23 Thread Dave Hansen
On 03/23/2018 12:12 PM, Nadav Amit wrote: >> /* >> + * Setting 'target_pmd' below creates a mapping in both >> + * the user and kernel page tables. It is effectively >> + * global, so set it as global in both copies. >> + */ >> +

Re: [PATCH 09/11] x86/pti: enable global pages for shared areas

2018-03-23 Thread Nadav Amit
Dave Hansen wrote: > > From: Dave Hansen > > The entry/exit text and cpu_entry_area are mapped into userspace and > the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary > TLB misses. > > Add the _PAGE_GLOBAL flag for these areas. > > static void __init > diff -puN arch/x86/

[PATCH 09/11] x86/pti: enable global pages for shared areas

2018-03-23 Thread Dave Hansen
From: Dave Hansen The entry/exit text and cpu_entry_area are mapped into userspace and the kernel. But, they are not _PAGE_GLOBAL. This creates unnecessary TLB misses. Add the _PAGE_GLOBAL flag for these areas. Signed-off-by: Dave Hansen Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Linus