Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-17 Thread Jan Beulich
>>> On 16.08.17 at 18:17, wrote: > On 16/08/17 16:07, Jan Beulich wrote: > On 16.08.17 at 16:22, wrote: >>> On 16/08/17 15:14, Andrew Cooper wrote: On 16/08/17 15:11, Jan Beulich wrote: On 16.08.17 at 15:58,

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Andrew Cooper
On 16/08/17 16:07, Jan Beulich wrote: On 16.08.17 at 16:22, wrote: >> On 16/08/17 15:14, Andrew Cooper wrote: >>> On 16/08/17 15:11, Jan Beulich wrote: >>> On 16.08.17 at 15:58, wrote: > --- a/xen/include/asm-x86/x86_64/page.h

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Jan Beulich
>>> On 16.08.17 at 16:22, wrote: > On 16/08/17 15:14, Andrew Cooper wrote: >> On 16/08/17 15:11, Jan Beulich wrote: >> On 16.08.17 at 15:58, wrote: --- a/xen/include/asm-x86/x86_64/page.h +++ b/xen/include/asm-x86/x86_64/page.h

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Andrew Cooper
On 16/08/17 15:14, Andrew Cooper wrote: > On 16/08/17 15:11, Jan Beulich wrote: > On 16.08.17 at 15:58, wrote: >>> --- a/xen/include/asm-x86/x86_64/page.h >>> +++ b/xen/include/asm-x86/x86_64/page.h >>> @@ -51,13 +51,15 @@ extern unsigned long xen_virt_end; >>>

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Jan Beulich
>>> On 16.08.17 at 16:14, wrote: > On 16/08/17 15:11, Jan Beulich wrote: > On 16.08.17 at 15:58, wrote: >>> --- a/xen/include/asm-x86/x86_64/page.h >>> +++ b/xen/include/asm-x86/x86_64/page.h >>> @@ -51,13 +51,15 @@ extern unsigned long

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Andrew Cooper
On 16/08/17 15:11, Jan Beulich wrote: On 16.08.17 at 15:58, wrote: >> --- a/xen/include/asm-x86/x86_64/page.h >> +++ b/xen/include/asm-x86/x86_64/page.h >> @@ -51,13 +51,15 @@ extern unsigned long xen_virt_end; >> >> static inline unsigned long

Re: [Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Jan Beulich
>>> On 16.08.17 at 15:58, wrote: > --- a/xen/include/asm-x86/x86_64/page.h > +++ b/xen/include/asm-x86/x86_64/page.h > @@ -51,13 +51,15 @@ extern unsigned long xen_virt_end; > > static inline unsigned long __virt_to_maddr(unsigned long va) > { > -ASSERT(va >=

[Xen-devel] [PATCH] x86/mm: Reduce debug overhead of __virt_to_maddr()

2017-08-16 Thread Andrew Cooper
__virt_to_maddr() is used very frequently, but has a large footprint due to its assertions and comparasons. Rearange its logic to drop one assertion entirely, encoding its check in a second assertion (with no additional branch, and the comparason performed with a 32bit immediate rather than