Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4133151ybx; Mon, 4 Nov 2019 08:20:14 -0800 (PST) X-Google-Smtp-Source: APXvYqw+C+LGVkn9yp1KcqDmauRb4cjRZxJSvH3KtcUn3FkfYT1+ke6Q9QGt586FwmUt1+1bdQx3 X-Received: by 2002:aa7:c453:: with SMTP id n19mr2903610edr.103.1572884414203; Mon, 04 Nov 2019 08:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572884414; cv=none; d=google.com; s=arc-20160816; b=LkF48s0XSsutTQbEeznMHdbIv/ifBcEvMi9wEglQtL26BMKcnnlfO9v4VPe2oGVgBB s916ategjcmQXmOCnTDeiNNfYIVZnLqmX2reBiIj9J6o51zD24/RPXlqBrjQSAfvAI2H CEeBhyJ6XFkjKWPyiLxxUI4ATDf9GT0HDkrvD6CChAgNgFcBl6PCyhMWUUtpXh6rtb5E h+CbUkReozPX/IaeQLjWyCIan1q2j23jNedj51XqMIA8xfB66wSICo0+T/LskFKN3MVv ScW83lq1+osz3ZA4Ww7KN4P7N6uayEIAdF1sRt4u3ZtkkTnCyJEO1LzwUpaw4KSbyJYJ 4Kcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=sgTtrR/CMhaYTvaMjf+D7eX1FFjT07Y214KTzYxPepU=; b=qzDs2J39uYrkuQMebBykvC23JfHqulI+hIqJ+awbUsw23BbhcUIUe1WZF/qjHgWFym YkMIkrU26uUomIgffu+c3fDAVTSeLQJxbezzPU4HpBKRogxzArzHyFc/hh0NIl6pcF26 ctxX+phLvgzva0/vQZ7/HfWeKToufQENMAK6+PNf1/zhdeEJZftPKJyshO2qTlyBgHIN JbEVAUmYmM8wVAas3mZ7kXDuj6wLUvW/glSA+OAurB5voJHyPIgPVgJuaQcYke/qlzcr nJB61eQ5IcAWY0D7Pi23n4aOq3FSql4ASvYrpjyHzZOfUPbiaBwrG4nEAQ7Vkb4FjAIB njBg== 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 j52si8757988eda.438.2019.11.04.08.19.50; Mon, 04 Nov 2019 08:20:14 -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 S1729351AbfKDQSh (ORCPT + 99 others); Mon, 4 Nov 2019 11:18:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:45944 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727838AbfKDQSh (ORCPT ); Mon, 4 Nov 2019 11:18:37 -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 E80B7AB8F; Mon, 4 Nov 2019 16:18:35 +0000 (UTC) Subject: Re: [Xen-devel] [PATCH] xen/events: remove event handling recursion detection To: Jan Beulich Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Stefano Stabellini , Boris Ostrovsky References: <20191104135812.2314-1-jgross@suse.com> <40cba9d9-24b0-3141-4ba8-02e03049f1bf@suse.com> From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Message-ID: Date: Mon, 4 Nov 2019 17:18:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.11.19 16:19, Jan Beulich wrote: > On 04.11.2019 16:09, Jürgen Groß wrote: >> On 04.11.19 15:35, Jan Beulich wrote: >>> On 04.11.2019 14:58, Juergen Gross wrote: >>>> __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. >>> >>> Would you mind pointing out which exact change(s) this was(were)? >> >> Linux kernel: 229664bee6126e01f8662976a5fe2e79813b77c8 >> Xen: d8263e8dbaf5ef1445bee0662143a0fcb6d43466 > > Are you sure about the latter, touching only header files underneath > xen/, and there mostly public interface ones? No, you are right, this was a false interpretation of mine. > >>> It had always been my understanding that the recursion detection >>> was mainly to guard against drivers re-enabling interrupts >>> transiently in their handlers (which in turn may no longer be an >>> issue in modern Linux kernels). >> >> This would have been doable with a simple bool. The more complex >> xchg based logic was IMO for recursion detection at any point. > > Well, the respective XenoLinux c/s 13098 has no mention of this, i.e. > it simply leaves open what the actual reason was: > > "[LINUX] Disallow nested event delivery. > > This eliminates the risk of overflowing the kernel stack and is a > reasonable policy given that we have no concept of priorities among > event sources." For XenoLinux it makes at least a little bit sense, as interrupts were enabled during calls of some handlers AFAIK. The complexity is rather strange, though, as the bool would have been much easier to understand. I'll adapt the commit message. Juergen