From: David Woodhouse <dwmw2@infradead.org>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Paul Durrant <paul@xen.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, Dawei Li <set_pte_at@outlook.com>,
Jiri Slaby <jirislaby@kernel.org>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v2 1/3] hvc/xen: fix event channel handling for secondary consoles
Date: Fri, 20 Oct 2023 17:15:27 +0100 [thread overview]
Message-ID: <20231020161529.355083-2-dwmw2@infradead.org> (raw)
In-Reply-To: <20231020161529.355083-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
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: fe415186b4 ("xen/console: harden hvc_xen against event channel storms")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
---
drivers/tty/hvc/hvc_xen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 98764e740c07..f24e285b6441 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -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;
--
2.40.1
next prev parent reply other threads:[~2023-10-20 16:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 16:15 [PATCH v2 0/3] hvc/xen: Xen console fixes David Woodhouse
2023-10-20 16:15 ` David Woodhouse [this message]
2023-10-21 16:32 ` [PATCH v2 1/3] hvc/xen: fix event channel handling for secondary consoles Greg Kroah-Hartman
2023-10-20 16:15 ` [PATCH v2 2/3] hvc/xen: fix error path in xen_hvc_init() to always register frontend driver David Woodhouse
2023-10-20 16:15 ` [PATCH v2 3/3] hvc/xen: fix console unplug David Woodhouse
2023-10-23 8:14 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231020161529.355083-2-dwmw2@infradead.org \
--to=dwmw2@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paul@xen.org \
--cc=roger.pau@citrix.com \
--cc=set_pte_at@outlook.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).