From: "Luis R. Rodriguez" Subject: Re: [Xen-devel] [RFC v3 2/2] x86/xen: allow privcmd hypercalls to be preempted Date: Thu, 22 Jan 2015 18:56:37 +0100 Message-ID: <20150122175637.GN17887@wotan.suse.de> References: <1421893039-426-1-git-send-email-mcgrof@do-not-panic.com> <1421893039-426-3-git-send-email-mcgrof@do-not-panic.com> <54C0F335.6030403@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andy Lutomirski , "Luis R. Rodriguez" , kvm list , X86 ML , "linux-kernel@vger.kernel.org" , Steven Rostedt , Ingo Molnar , Jan Beulich , "H. Peter Anvin" , Masami Hiramatsu , "xen-devel@lists.xenproject.org" , Boris Ostrovsky , Borislav Petkov , Thomas Gleixner To: David Vrabel Return-path: Content-Disposition: inline In-Reply-To: <54C0F335.6030403@citrix.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Thu, Jan 22, 2015 at 12:55:17PM +0000, David Vrabel wrote: > On 22/01/15 03:18, Andy Lutomirski wrote: > >> --- a/drivers/xen/events/events_base.c > >> +++ b/drivers/xen/events/events_base.c > >> @@ -32,6 +32,8 @@ > >> #include > >> #include > >> #include > >> +#include > >> +#include > >> > >> #ifdef CONFIG_X86 > >> #include > >> @@ -1243,6 +1245,17 @@ void xen_evtchn_do_upcall(struct pt_regs *regs) > >> set_irq_regs(old_regs); > >> } > >> > >> +notrace void xen_end_upcall(struct pt_regs *regs) > >> +{ > >> + if (!xen_is_preemptible_hypercall(regs) || > >> + __this_cpu_read(xed_nesting_count)) > >> + return; > > > > What's xed_nesting_count? > > It used to prevent nested upcalls when a hypercall called from an upcall > triggers another upcall. > > There's no way a such a nested hypercall can be preemptible so the check > for xed_nesting_count an be removed from here. Removed. Luis