mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active
Reading from the E9 port if the emergency console is active should return
0xe9 according to the documentation from Bochs:
https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
See `port_e9_hack` section description.
Fix Xen so it also returns the port address. OSes can use it to detect
whether the emergency console is available or not.
Fixes: d1bd157fbc ("Big merge the HVM full-virtualisation abstractions.")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
3d3a690f17
commit
db5a3c31a6
1 file changed
+9
-3
@@ -567,9 +567,15 @@ static int cf_check hvm_print_line(
|
||||
|
||||
ASSERT(bytes == 1 && port == XEN_HVM_DEBUGCONS_IOPORT);
|
||||
|
||||
/* Deny any input requests. */
|
||||
if ( dir != IOREQ_WRITE )
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
if ( dir == IOREQ_READ )
|
||||
{
|
||||
/*
|
||||
* According to Bochs documentation, reading from the E9 port should
|
||||
* return 0xE9 if the "port E9 hack" is implemented.
|
||||
*/
|
||||
*val = XEN_HVM_DEBUGCONS_IOPORT;
|
||||
return X86EMUL_OKAY;
|
||||
}
|
||||
|
||||
if ( !is_console_printable(c) )
|
||||
return X86EMUL_OKAY;
|
||||
|
||||