Re: [Xen-devel] [PATCH v3 1/2] gnttab: don't use possibly unbounded tail calls

2017-08-16 Thread Jan Beulich
>>> On 16.08.17 at 12:01, wrote: > On 16/08/17 10:52, Jan Beulich wrote: > On 15.08.17 at 17:04, wrote: >>> On 15/08/17 14:49, Jan Beulich wrote: @@ -2608,7 +2610,7 @@ static long gnttab_copy( { if ( i &&

Re: [Xen-devel] [PATCH v3 1/2] gnttab: don't use possibly unbounded tail calls

2017-08-16 Thread Andrew Cooper
On 16/08/17 10:52, Jan Beulich wrote: On 15.08.17 at 17:04, wrote: >> On 15/08/17 14:49, Jan Beulich wrote: >>> @@ -2608,7 +2610,7 @@ static long gnttab_copy( >>> { >>> if ( i && hypercall_preempt_check() ) >>> { >>> -rc = i; >>>

Re: [Xen-devel] [PATCH v3 1/2] gnttab: don't use possibly unbounded tail calls

2017-08-16 Thread Jan Beulich
>>> On 15.08.17 at 17:04, wrote: > On 15/08/17 14:49, Jan Beulich wrote: >> @@ -2608,7 +2610,7 @@ static long gnttab_copy( >> { >> if ( i && hypercall_preempt_check() ) >> { >> -rc = i; >> +rc = count - i; > > Somewhere,

Re: [Xen-devel] [PATCH v3 1/2] gnttab: don't use possibly unbounded tail calls

2017-08-15 Thread Andrew Cooper
On 15/08/17 14:49, Jan Beulich wrote: > @@ -2608,7 +2610,7 @@ static long gnttab_copy( > { > if ( i && hypercall_preempt_check() ) > { > -rc = i; > +rc = count - i; Somewhere, probably as a comment for gnttab_copy(), we should have a comment

[Xen-devel] [PATCH v3 1/2] gnttab: don't use possibly unbounded tail calls

2017-08-15 Thread Jan Beulich
There is no guarantee that the compiler would actually translate them to branches instead of calls, so only ones with a known recursion limit are okay: - __release_grant_for_copy() can call itself only once, as __acquire_grant_for_copy() won't permit use of multi-level transitive grants, -