[Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-15 Thread Andrew Cooper
Newer versions of binutils are capable of emitting an exact number bytes worth of optimised nops, which are P6 nops. Use this in preference to .skip when available. Check at boot time whether the toolchain nops are the correct for the running hardware, andskip optimising nops entirely when possib

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-28 Thread Andrew Cooper
On 17/08/18 13:45, Jan Beulich wrote: On 15.08.18 at 19:57, wrote: >> --- a/xen/arch/x86/Rules.mk >> +++ b/xen/arch/x86/Rules.mk >> @@ -29,6 +29,10 @@ $(call as-option-add,CFLAGS,CC,"invpcid >> (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) >> $(call as-option-add,CFLAGS,CC,\ >> ".if ((1 > 0)

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-28 Thread Jan Beulich
>>> On 28.08.18 at 19:58, wrote: > On 17/08/18 13:45, Jan Beulich wrote: > On 15.08.18 at 19:57, wrote: >>> --- a/xen/arch/x86/alternative.c >>> +++ b/xen/arch/x86/alternative.c >>> @@ -84,6 +84,19 @@ static const unsigned char * const >>> p6_nops[ASM_NOP_MAX+1] > >>> init_or_livepatch_con

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Roger Pau Monné
On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: > Newer versions of binutils are capable of emitting an exact number bytes worth > of optimised nops, which are P6 nops. Use this in preference to .skip when > available. > > Check at boot time whether the toolchain nops are the corre

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Jan Beulich
>>> On 16.08.18 at 11:55, wrote: > On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: >> --- a/xen/arch/x86/Rules.mk >> +++ b/xen/arch/x86/Rules.mk >> @@ -29,6 +29,10 @@ $(call as-option-add,CFLAGS,CC,"invpcid >> (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) >> $(call as-option-add,CFLAGS,

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Andrew Cooper
On 16/08/18 10:55, Roger Pau Monné wrote: > On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: >> Newer versions of binutils are capable of emitting an exact number bytes >> worth >> of optimised nops, which are P6 nops. Use this in preference to .skip when >> available. >> >> Check a

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Jan Beulich
>>> On 16.08.18 at 12:42, wrote: > On 16/08/18 10:55, Roger Pau Monné wrote: >> On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: >>> @@ -112,6 +125,11 @@ static void __init arch_init_ideal_nops(void) >>> ideal_nops = k8_nops; >>> break; >>> } >>> + >>> +#if

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Andrew Cooper
On 16/08/18 12:34, Jan Beulich wrote: On 16.08.18 at 12:42, wrote: >> On 16/08/18 10:55, Roger Pau Monné wrote: >>> On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: @@ -112,6 +125,11 @@ static void __init arch_init_ideal_nops(void) ideal_nops = k8_nops; >>

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Roger Pau Monné
On Thu, Aug 16, 2018 at 04:18:03AM -0600, Jan Beulich wrote: > >>> On 16.08.18 at 11:55, wrote: > > On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: > >> --- a/xen/arch/x86/Rules.mk > >> +++ b/xen/arch/x86/Rules.mk > >> @@ -29,6 +29,10 @@ $(call as-option-add,CFLAGS,CC,"invpcid > >>

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Jan Beulich
>>> On 16.08.18 at 13:57, wrote: > On Thu, Aug 16, 2018 at 04:18:03AM -0600, Jan Beulich wrote: >> >>> On 16.08.18 at 11:55, wrote: >> > On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: >> >> --- a/xen/arch/x86/Rules.mk >> >> +++ b/xen/arch/x86/Rules.mk >> >> @@ -29,6 +29,10 @@ $(ca

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Jan Beulich
>>> On 16.08.18 at 13:48, wrote: > On 16/08/18 12:34, Jan Beulich wrote: > On 16.08.18 at 12:42, wrote: >>> On 16/08/18 10:55, Roger Pau Monné wrote: On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: > @@ -112,6 +125,11 @@ static void __init arch_init_ideal_nops(void) >>

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Roger Pau Monné
On Thu, Aug 16, 2018 at 11:42:56AM +0100, Andrew Cooper wrote: > On 16/08/18 10:55, Roger Pau Monné wrote: > > On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: > >> diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk > >> index ac585a3..c84ed20 100644 > >> --- a/xen/arch/x86/Ru

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Andrew Cooper
On 16/08/18 15:31, Roger Pau Monné wrote: > On Thu, Aug 16, 2018 at 11:42:56AM +0100, Andrew Cooper wrote: >> On 16/08/18 10:55, Roger Pau Monné wrote: >>> On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index ac585

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-16 Thread Roger Pau Monné
On Thu, Aug 16, 2018 at 04:56:04PM +0100, Andrew Cooper wrote: > On 16/08/18 15:31, Roger Pau Monné wrote: > > On Thu, Aug 16, 2018 at 11:42:56AM +0100, Andrew Cooper wrote: > >> On 16/08/18 10:55, Roger Pau Monné wrote: > >>> On Wed, Aug 15, 2018 at 06:57:38PM +0100, Andrew Cooper wrote: > di

Re: [Xen-devel] [PATCH] x86/build: Use new .nops directive when available

2018-08-17 Thread Jan Beulich
>>> On 15.08.18 at 19:57, wrote: > --- a/xen/arch/x86/Rules.mk > +++ b/xen/arch/x86/Rules.mk > @@ -29,6 +29,10 @@ $(call as-option-add,CFLAGS,CC,"invpcid > (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) > $(call as-option-add,CFLAGS,CC,\ > ".if ((1 > 0) < 0); .error \"\";.endif",,-DHAVE_AS_NEGATIV