From nobody Thu Mar 28 17:54:37 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1572875992; cv=none; d=zoho.com; s=zohoarc; b=E1CLLSczzypbRLE7v4lfRV5QluVqXoHKQ6W//XygQIz7pBSBCGWYjz11DA/e5sL4oJEBfQJcOaJkn5VDbhNQnBTkl/ofzmmysB0Wu6LkdA5MD1jJEXQBgiHBq1RI7kB0xM+E8iR5qQxyLGlOvQRsOxwJWsC0D+fHQzmfSjvcMsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572875992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=noDeQrfLw5fvE1Y2GU5wGzvIUDKEpMHJCP5pUb0LKqU=; b=C+Pu4HrPyvFsLFt4O+yAWasErR8giU1SF2JLIIYM6dXQodJNW6blFSkVC61p2Ji7zs2LTEeW1xsrlu6+U+kp36/C4lSXYD4udpV1lngxXrVAY30LzEW5+r+PbINuAnCw0eO6iLNWaNN17Tuzftvj4rCuFXcbXWTrG45+I0A/d18= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157287599203940.8418153328314; Mon, 4 Nov 2019 05:59:52 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iRcsQ-0006uD-QV; Mon, 04 Nov 2019 13:58:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iRcsQ-0006u7-5D for xen-devel@lists.xenproject.org; Mon, 04 Nov 2019 13:58:38 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 31e26734-ff0b-11e9-b678-bc764e2007e4; Mon, 04 Nov 2019 13:58:36 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 56D91B417; Mon, 4 Nov 2019 13:58:35 +0000 (UTC) X-Inumbo-ID: 31e26734-ff0b-11e9-b678-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Date: Mon, 4 Nov 2019 14:58:12 +0100 Message-Id: <20191104135812.2314-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] xen/events: remove event handling recursion detection X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" __xen_evtchn_do_upcall() contains guards against being called recursively. This mechanism was introduced in the early pvops times (kernel 2.6.26) when there were still Xen versions around not honoring disabled interrupts for sending events to pv guests. This was changed in Xen 3.0, which is much older than any Xen version supported by the kernel, so the recursion detection can be removed. Signed-off-by: Juergen Gross --- drivers/xen/events/events_base.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_b= ase.c index 6c8843968a52..33212c494afd 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -1213,31 +1213,21 @@ void xen_send_IPI_one(unsigned int cpu, enum ipi_ve= ctor vector) notify_remote_via_irq(irq); } =20 -static DEFINE_PER_CPU(unsigned, xed_nesting_count); - static void __xen_evtchn_do_upcall(void) { struct vcpu_info *vcpu_info =3D __this_cpu_read(xen_vcpu); - int cpu =3D get_cpu(); - unsigned count; + int cpu =3D smp_processor_id(); =20 do { vcpu_info->evtchn_upcall_pending =3D 0; =20 - if (__this_cpu_inc_return(xed_nesting_count) - 1) - goto out; - xen_evtchn_handle_events(cpu); =20 BUG_ON(!irqs_disabled()); =20 - count =3D __this_cpu_read(xed_nesting_count); - __this_cpu_write(xed_nesting_count, 0); - } while (count !=3D 1 || vcpu_info->evtchn_upcall_pending); - -out: + rmb(); /* Hypervisor can set upcall pending. */ =20 - put_cpu(); + } while (vcpu_info->evtchn_upcall_pending); } =20 void xen_evtchn_do_upcall(struct pt_regs *regs) --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel