OpenCloudOS-Kernel/drivers/tty/hvc
David Woodhouse 192e6eba4e hvc/xen: fix event channel handling for secondary consoles
commit ef5dd8ec88ac11e8e353164407d55b73c988b369 upstream.

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
Link: https://lore.kernel.org/r/20231020161529.355083-2-dwmw2@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:19:57 +00:00
..
Kconfig tty: hvc: dcc: Bind driver to CPU core0 for reads and writes 2022-05-05 22:45:57 +02:00
Makefile
hvc_console.c tty: hvc: convert counts to size_t 2023-08-11 21:12:47 +02:00
hvc_console.h tty: Call ->dtr_rts() parameter active consistently 2023-01-19 16:04:35 +01:00
hvc_dcc.c tty: hvc: dcc: Bind driver to CPU core0 for reads and writes 2022-05-05 22:45:57 +02:00
hvc_irq.c
hvc_iucv.c tty: Call ->dtr_rts() parameter active consistently 2023-01-19 16:04:35 +01:00
hvc_opal.c tty: Explicitly include correct DT includes 2023-07-25 20:19:05 +02:00
hvc_riscv_sbi.c
hvc_rtas.c tty: hvc: make hvc_rtas_dev static 2022-11-03 03:52:36 +01:00
hvc_udbg.c tty: hvc: make symbol 'hvc_udbg_dev' static 2021-04-10 10:41:40 +02:00
hvc_vio.c tty: hvc: Prepare cleanup of powerpc's asm/prom.h 2022-04-15 08:42:26 +02:00
hvc_xen.c hvc/xen: fix event channel handling for secondary consoles 2023-11-28 17:19:57 +00:00
hvcs.c tty: hvc: convert counts to size_t 2023-08-11 21:12:47 +02:00
hvsi.c tty: hvc: convert counts to size_t 2023-08-11 21:12:47 +02:00
hvsi_lib.c