From nobody Thu Mar 28 17:26:41 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=1574930786; cv=none; d=zohomail.com; s=zohoarc; b=O29htiZaM4kB+uNH+7FYjoK5ikAV+pWswk+oWIDZYS7K/HD+yo4MzgwhWku9+sURlps4IUENPkXowEfzFHLEjslPw+D95rbm0OuFLEUFk9Rs9TevS7YS83unJ+M09L1fvMSvPmkWa3H1JxVlVIpSyAhI7fPAPwoTZApbihR7dKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574930786; 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=3SLKLTZodmx1IxfduH74qinLeb0eB2mN/HJgUqiqAmA=; b=jT+dGPtQEYErXSEJGk+qdQci/i+okI89RzeQ4s9XVajOCaCdNCl+xedCu/viOKqi3u8ZcvnUzZ6rY/sMs51bPINb3SPce5aIo5xrQSzxFmQmiM4eDFfYVKmFgfucehlydGaQIZjHtoHEyegOwxofbue/8UU9FnkscbJLg1DOYj0= 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 1574930786699922.5308191613155; Thu, 28 Nov 2019 00:46:26 -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 1iaFQs-0005tK-PW; Thu, 28 Nov 2019 08:45:50 +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 1iaFQq-0005t8-Mb for xen-devel@lists.xenproject.org; Thu, 28 Nov 2019 08:45:48 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 791ab738-11bb-11ea-a3cd-12813bfff9fa; Thu, 28 Nov 2019 08:45:48 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 32A43B174; Thu, 28 Nov 2019 08:45:47 +0000 (UTC) X-Inumbo-ID: 791ab738-11bb-11ea-a3cd-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: Thu, 28 Nov 2019 09:45:45 +0100 Message-Id: <20191128084545.13831-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v2] 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 --- V2: adapt commit message (Jan Beulich) --- 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