Skip to contentSkip to conversation

FAILED: patch "[PATCH] hvc/xen: fix event channel handling for secondary consoles" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Nov 22, 2023

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x ef5dd8ec88ac11e8e353164407d55b73c988b369
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023112211-papyrus-december-999f@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..

Possible dependencies:

ef5dd8ec88ac ("hvc/xen: fix event channel handling for secondary consoles") fe415186b43d ("xen/console: harden hvc_xen against event channel storms") 3bd5371a4da6 ("xen/events: Remove unused bind_evtchn_to_irq_lateeoi()") 54c9de89895e ("xen/events: add a new "late EOI" evtchn framework") 0102e4efda76 ("xen: Use evtchn_type_t as a type for event channels")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From ef5dd8ec88ac11e8e353164407d55b73c988b369 Mon Sep 17 00:00:00 2001
From: David Woodhouse <[email protected]>
Date: Fri, 20 Oct 2023 17:15:27 +0100
Subject: [PATCH] hvc/xen: fix event channel handling for secondary consoles
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The xencons_connect_backend() function allocates a local interdomain event channel with xenbus_alloc_evtchn(), then calls bind_interdomain_evtchn_to_irq_lateeoi() to bind to that port# on the *remote* domain.

That doesn't work very well:

(qemu) device_add xen-console,id=con1,chardev=pty0

[   44.323872] xenconsole console-1: 2 xenbus_dev_probe on device/console/1
[   44.323995] xenconsole: probe of console-1 failed with error -2

Fix it to use bind_evtchn_to_irq_lateeoi(), which does the right thing by just binding that *local* event channel to an irq. The backend will do the interdomain binding.

This didn't affect the primary console because the setup for that is special — the toolstack allocates the guest event channel and the guest discovers it with HVMOP_get_param.

Fixes fe415186b43d ("xen/console: harden hvc_xen against event channel storms")
drivers/tty/hvc/hvc_xen.c +1 -1
index 98764e740c07..f24e285b6441 100644
@@ -433,7 +433,7 @@ static int xencons_connect_backend(struct xenbus_device *dev,
 	if (ret)
 		return ret;
 	info->evtchn = evtchn;
-	irq = bind_interdomain_evtchn_to_irq_lateeoi(dev, evtchn);
+	irq = bind_evtchn_to_irq_lateeoi(evtchn);
 	if (irq < 0)
 		return irq;
 	info->irq = irq;