[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ns16550c: avoid crash in ns16550_endboot in PV shim mode



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

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

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
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: smime.p7s
Description: S/MIME cryptographic signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.