Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3979817ybx; Mon, 4 Nov 2019 05:59:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzBsdimgPU/jFkQ5FeLmz8Qo1YZxxetqYuvMXf+0R+AQLu3mlZQmc4kTTomkBX9U69qXgWG X-Received: by 2002:a50:e002:: with SMTP id e2mr29895180edl.278.1572875976278; Mon, 04 Nov 2019 05:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572875976; cv=none; d=google.com; s=arc-20160816; b=c/wgG7EguY8AKThOtb3FFg1Zd9aVwFk6LWGvZHyfuKjtJkMKZncuvNo42jRSQAaeYM /BFiz7xH2xo69wPHLl1NA0/oK/zKSeTzEI693B0WtZtFPwjSo2heRhMzPbN1EpbOdVpi S3P/bzq3zKR94bmHb6UQyDNoPdvymsRpeUWbNtdeMsqvbaGbZmI77NRULDGasxzF+Bp1 4OydwPLOf0kA1nHeelOWTb+ma8v7Q1Nudr02NvPoEEtNXFHKtopOc/sn94wz3S1CExUP uGrvKNNa+avCKjodm7JH5bQrqYxw/cpTKZuVVwfSNzLTDsLhFd6QGEXOjrQxaYQYv/oB L0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=SAFJRXft3W4Yi1TMGJzYnNxNLLaKRiRFUHA2EjX5KY8=; b=piQ67PXVKCuDEdye2200jQSTPKfGOIq2moxKrSLuNGCSL59mtse7VCqGlT0y3BbEl+ iyl2OKJuNkCc9i0hDmPlKGNbthA3r1Fu6GoWgIN0hLCHga4jAsxKLWRDCihYO3TnbHbI Geu5fFvG2RKZOr2B8qJtCYl6pJn1+56Z8UqvSP2xhIPQ12mNjSK+PxWi166/jUmTKUgW lDoolbfuxw8z10yea0D1q/oI0UA3SkjSChYdWiCITAqgRLSTiPMaLvfIbZ173CJaldK1 3Iikwy2BYCIFu6DgVz4Yn6yXOUIfBE9W63Z4fAr8KmnaEpg4P8hTRZufC2+aESm5GQSP vrtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si2458561eds.434.2019.11.04.05.59.12; Mon, 04 Nov 2019 05:59:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729090AbfKDN6h (ORCPT + 99 others); Mon, 4 Nov 2019 08:58:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:36854 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727891AbfKDN6g (ORCPT ); Mon, 4 Nov 2019 08:58:36 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de 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) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH] xen/events: remove event handling recursion detection 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __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_base.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_vector vector) notify_remote_via_irq(irq); } -static DEFINE_PER_CPU(unsigned, xed_nesting_count); - static void __xen_evtchn_do_upcall(void) { struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); - int cpu = get_cpu(); - unsigned count; + int cpu = smp_processor_id(); do { vcpu_info->evtchn_upcall_pending = 0; - if (__this_cpu_inc_return(xed_nesting_count) - 1) - goto out; - xen_evtchn_handle_events(cpu); BUG_ON(!irqs_disabled()); - count = __this_cpu_read(xed_nesting_count); - __this_cpu_write(xed_nesting_count, 0); - } while (count != 1 || vcpu_info->evtchn_upcall_pending); - -out: + rmb(); /* Hypervisor can set upcall pending. */ - put_cpu(); + } while (vcpu_info->evtchn_upcall_pending); } void xen_evtchn_do_upcall(struct pt_regs *regs) -- 2.16.4