Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-20 Thread Jan Beulich
>>> On 19.05.15 at 18:59, wrote: > On 18/05/15 13:46, Jan Beulich wrote: >> +stub_va = XEN_VIRT_END - (cpu + 1) * PAGE_SIZE; >> +if ( map_pages_to_xen(stub_va, page_to_mfn(pg), 1, >> + PAGE_HYPERVISOR_RX | MAP_SMALL_PAGES) ) >> +{ >> +if ( !*mfn ) >> +

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-20 Thread Andrew Cooper
On 20/05/15 14:37, Jan Beulich wrote: On 19.05.15 at 18:59, wrote: >> On 18/05/15 13:46, Jan Beulich wrote: >>> @@ -616,6 +653,24 @@ static void cpu_smpboot_free(unsigned in >>> free_cpumask_var(per_cpu(cpu_sibling_mask, cpu)); >>> free_cpumask_var(per_cpu(cpu_core_mask, cpu)); >>>

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-20 Thread Jan Beulich
>>> On 19.05.15 at 18:59, wrote: > On 18/05/15 13:46, Jan Beulich wrote: >> @@ -616,6 +653,24 @@ static void cpu_smpboot_free(unsigned in >> free_cpumask_var(per_cpu(cpu_sibling_mask, cpu)); >> free_cpumask_var(per_cpu(cpu_core_mask, cpu)); >> >> +if ( per_cpu(stubs.addr, cpu) ) >>

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-20 Thread Jan Beulich
>>> On 19.05.15 at 18:59, wrote: > On 18/05/15 13:46, Jan Beulich wrote: >> +unsigned long alloc_stub_page(unsigned int cpu, unsigned long *mfn) >> +{ >> +unsigned long stub_va; >> +struct page_info *pg; >> + >> +if ( *mfn ) >> +pg = mfn_to_page(*mfn); >> +else >> +{ >>

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-19 Thread Andrew Cooper
On 18/05/15 13:46, Jan Beulich wrote: > --- a/xen/arch/x86/smpboot.c > +++ b/xen/arch/x86/smpboot.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -603,6 +604,42 @@ static int do_boot_cpu(int apicid, int c > return rc; > } >

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-19 Thread Andrew Cooper
On 19/05/15 07:41, Jan Beulich wrote: On 18.05.15 at 20:39, wrote: >> On 18/05/15 13:46, Jan Beulich wrote: >>> This is needed as stacks are going to become non-executable. Use >>> separate stub pages (shared among suitable CPUs on the same node) >>> instead. >>> >>> Signed-off-by: Jan Beulic

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-18 Thread Jan Beulich
>>> On 18.05.15 at 20:39, wrote: > On 18/05/15 13:46, Jan Beulich wrote: >> This is needed as stacks are going to become non-executable. Use >> separate stub pages (shared among suitable CPUs on the same node) >> instead. >> >> Signed-off-by: Jan Beulich > > Can you please include a description

Re: [Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-18 Thread Andrew Cooper
On 18/05/15 13:46, Jan Beulich wrote: > This is needed as stacks are going to become non-executable. Use > separate stub pages (shared among suitable CPUs on the same node) > instead. > > Signed-off-by: Jan Beulich Can you please include a description of how you intend the stubs to function, and

[Xen-devel] [PATCH 1/4] x86: move syscall trampolines off the stack

2015-05-18 Thread Jan Beulich
This is needed as stacks are going to become non-executable. Use separate stub pages (shared among suitable CPUs on the same node) instead. Signed-off-by: Jan Beulich --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1270,6 +1270,10 @@ void __init noreturn __start_xen(unsigne init