Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933156AbbBCLFW (ORCPT ); Tue, 3 Feb 2015 06:05:22 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:53493 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754803AbbBCLFT (ORCPT ); Tue, 3 Feb 2015 06:05:19 -0500 X-IronPort-AV: E=Sophos;i="5.09,512,1418083200"; d="scan'208";a="223808826" Message-ID: <54D0AB6B.9060909@citrix.com> Date: Tue, 3 Feb 2015 11:05:15 +0000 From: David Vrabel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: "Luis R. Rodriguez" , , , , CC: Borislav Petkov , , "Luis R. Rodriguez" , , , , Andy Lutomirski , Ingo Molnar , Jan Beulich , "H. Peter Anvin" , Masami Hiramatsu , Thomas Gleixner , Subject: Re: [Xen-devel] [PATCH v5 1/2] xen: add xen_is_preemptible_hypercall() References: <1422323467-16713-1-git-send-email-mcgrof@do-not-panic.com> <1422323467-16713-2-git-send-email-mcgrof@do-not-panic.com> In-Reply-To: <1422323467-16713-2-git-send-email-mcgrof@do-not-panic.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 818 Lines: 23 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/