All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ns16550c: avoid crash in ns16550_endboot in PV shim mode
@ 2023-10-19 16:21 David Woodhouse
  2023-10-20  6:17 ` Jan Beulich
  2023-10-20 10:14 ` Andrew Cooper
  0 siblings, 2 replies; 12+ messages in thread
From: David Woodhouse @ 2023-10-19 16:21 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, George Dunlap, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

From: David Woodhouse <dwmw@amazon.co.uk>

In shim mode there is no hardware_domain. Dereferencing the pointer
doesn't end well.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
This is about as far as I got in my abortive attempt to use the PV shim
without an actual PV console being provided by the HVM hosting
environment. It still doesn't pass the guest's console through to
serial; that only seems to shim to an actual PV console.

 xen/drivers/char/ns16550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 28ddedd50d..0818f5578c 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -586,6 +586,8 @@ static void __init cf_check ns16550_endboot(struct serial_port *port)
 
     if ( uart->remapped_io_base )
         return;
+    if (!hardware_domain)
+        return;
     rv = ioports_deny_access(hardware_domain, uart->io_base, uart->io_base + 7);
     if ( rv != 0 )
         BUG();
-- 
2.34.1



[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-23  8:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-19 16:21 [PATCH] ns16550c: avoid crash in ns16550_endboot in PV shim mode David Woodhouse
2023-10-20  6:17 ` Jan Beulich
2023-10-20 10:14 ` Andrew Cooper
2023-10-20 10:29   ` David Woodhouse
2023-10-20 13:25     ` Andrew Cooper
2023-10-20 13:29       ` Roger Pau Monné
2023-10-20 13:37         ` David Woodhouse
2023-10-20 14:50           ` Durrant, Paul
2023-10-20 15:16             ` Andrew Cooper
2023-10-23  7:52               ` Roger Pau Monné
2023-10-23  8:05                 ` Jan Beulich
2023-10-23  8:17                   ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.