lkml.org 
[lkml]   [2015]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH v5 1/2] xen: add xen_is_preemptible_hypercall()
On 27/01/15 01:51, Luis R. Rodriguez wrote:
>
> +#ifndef CONFIG_PREEMPT
> +extern struct { char _entry[32]; } preemptible_hypercall_page[];
> +
> +static inline bool xen_is_preemptible_hypercall(struct pt_regs *regs)
> +{
> + return !user_mode_vm(regs) &&
> + regs->ip >= (unsigned long)preemptible_hypercall_page &&
> + regs->ip < (unsigned long)preemptible_hypercall_page + PAGE_SIZE;

I asked for this test to be optimized.

return (regs->ip >> PAGE_SHIFT)
== ((unsigned long)preemptible_hypercall_page >> PAGE_SHIFT)
&& !user_mode_vm(regs);

David


\
 
 \ /
  Last update: 2015-02-03 12:41    [W:0.950 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site