Re: [Xen-devel] [PATCH v3 5/7] x86/alt: Support for automatic padding calculations

2018-03-08 Thread Andrew Cooper
On 08/03/18 16:49, Jan Beulich wrote: On 08.03.18 at 17:23, wrote: >> On 08/03/18 15:42, Jan Beulich wrote: >> On 07.03.18 at 16:51, wrote: @@ -175,18 +175,47 @@ void init_or_livepatch apply_alternatives(const struct

Re: [Xen-devel] [PATCH v3 5/7] x86/alt: Support for automatic padding calculations

2018-03-08 Thread Jan Beulich
>>> On 08.03.18 at 17:23, wrote: > On 08/03/18 15:42, Jan Beulich wrote: > On 07.03.18 at 16:51, wrote: >>> @@ -175,18 +175,47 @@ void init_or_livepatch apply_alternatives(const >>> struct alt_instr *start, >>> * So be careful if

Re: [Xen-devel] [PATCH v3 5/7] x86/alt: Support for automatic padding calculations

2018-03-08 Thread Andrew Cooper
On 08/03/18 15:42, Jan Beulich wrote: On 07.03.18 at 16:51, wrote: >> @@ -175,18 +175,47 @@ void init_or_livepatch apply_alternatives(const struct >> alt_instr *start, >> * So be careful if you want to change the scan order to any other >> * order. >>

Re: [Xen-devel] [PATCH v3 5/7] x86/alt: Support for automatic padding calculations

2018-03-08 Thread Jan Beulich
>>> On 07.03.18 at 16:51, wrote: > @@ -175,18 +175,47 @@ void init_or_livepatch apply_alternatives(const struct > alt_instr *start, > * So be careful if you want to change the scan order to any other > * order. > */ > -for ( a = start; a < end;

[Xen-devel] [PATCH v3 5/7] x86/alt: Support for automatic padding calculations

2018-03-07 Thread Andrew Cooper
The correct amount of padding in an origin patch site can be calculated automatically, based on the relative lengths of the replacements. This requires a bit of trickery to calculate correctly, especially in the ALTENRATIVE_2 case where a branchless max() calculation in needed. The calculation