From nobody Fri Apr 26 18:02:14 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.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 (zohomail.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=1575031221; cv=none; d=zohomail.com; s=zohoarc; b=QO1BJKBywafF4vEW76rtLE8cuIa7VoX5V/y9Xf5LIiFVWBZaU8a5rTQV06UTkas1joYQU+xm5g7FuxW9UHFib4F+gkNd9j953uyJzffI7UkyS8bw3iQHwJzGKXA1aX5q5VTy4FNqHWydjrduWMgRRsEF4K3q1AMrdxq6tCj3jB4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575031221; 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=OP79hZEyAmtjthE91mvuyLFxMVrLOOfj6eevTAVEgjk=; b=bZXe2QFpetthiVD9nX2up00tG3esiXPzLGVPq4oemVsx9Uy0yDyqv1kXzmExj42eaECxH+a8lOVv50YDegfwyqicbbRD8/Wx2zb3hWM9cuyKfJVwDeOFUC4zm2dhe6cN3SJJ7EzxD11qj+OPamOewq71Y5w66NEE/4ycYcan6zI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.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 1575031221351681.7153369443488; Fri, 29 Nov 2019 04:40:21 -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 1iafYp-0006pL-IW; Fri, 29 Nov 2019 12:39:47 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iafYo-0006pF-8h for xen-devel@lists.xenproject.org; Fri, 29 Nov 2019 12:39:46 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5206f3ba-12a5-11ea-a3e5-12813bfff9fa; Fri, 29 Nov 2019 12:39:44 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BCA62ACE0; Fri, 29 Nov 2019 12:39:43 +0000 (UTC) X-Inumbo-ID: 5206f3ba-12a5-11ea-a3e5-12813bfff9fa 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: Fri, 29 Nov 2019 13:39:41 +0100 Message-Id: <20191129123941.11975-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v3] 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 all the Xen backend drivers missing from the upstream kernel, and some of those out-of-tree drivers were enabling interrupts in their event handlers (which was explicitly allowed in the initial XenoLinux). Nowadays we don't need to support those old drivers any more and the capability to allow recursive calls of __xen_evtchn_do_upcall() can be removed. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- V2: adapt commit message (Jan Beulich) V3: rmb() -> virt_rmb() (Boris Ostrovsky) --- 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..499eff7d3f65 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: + virt_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