Fixes for running under Xen
cover Fixes for running under Xen
The following are a few issues discovered in the course of investigating Debian bug #678042 [0], including the fix for that actual bug (which is cause by Xen not supporting SMM mode).
The following changes since commit 9166c4ae6d21d49bd97e0fb42eea2ffd6dd6f06d:
Xen: add definition of xen_hypercall_page (2012-06-27 21:07:24 -0400)
are available in the git repository at:
git://xenbits.xen.org/people/ianc/seabios.git bugfixes
Ian Campbell (3):
enable Xen support by default.
Xen: Autodetect debug I/O port at runtime instead of via Kconfig
SMM: Disable use of SMM when running under Xen
src/Kconfig | 9 +-------- src/output.c | 4 +++- src/smm.c | 3 +++ src/util.h | 1 + src/xen.c | 6 ++++++ 5 files changed, 14 insertions(+), 9 deletions(-)
Thanks,
Ian.
PATCH 1/3 enable Xen support by default.
--- src/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
src/Kconfig +1 -1
@@ -13,7 +13,7 @@ menu "General Features" config XEN depends on !COREBOOT bool "Build for Xen HVM" - default n + default y help Configure to be used by xen hvmloader, for a HVM guest.
Signature · 1 line
1.7.2.5
PATCH 2/3 Xen: Autodetect debug I/O port at runtime instead of via Kconfig
In reply to Ian CampbellThis allows a common image which supports Xen to still print debug
--- src/Kconfig | 7 ------- src/output.c | 4 +++- src/util.h | 1 + src/xen.c | 6 ++++++ 4 files changed, 10 insertions(+), 8 deletions(-)
src/Kconfig +0 -7
@@ -361,11 +361,4 @@ menu "Debugging" information by outputing strings in a special port present in the IO space. - config DEBUG_IO_PORT - depends on DEBUG_IO - hex "Debug IO port address" - default 0x0402 - help - Bochs uses the 0x0402 address by default, whereas Xen - makes the 0xe9 IO address available for guests use. endmenu
src/output.c +3 -1
@@ -23,6 +23,8 @@ struct putcinfo {#define DEBUG_TIMEOUT 100000 +u16 DebugOutputPort VAR16VISIBLE = 0x402; +void debug_serial_setup (void ) {
@@ -77,7 +79,7 @@ putc_debug(struct putcinfo *action, char c)return ;if (CONFIG_DEBUG_IO )// Send character to debug port. -outb (c,CONFIG_DEBUG_IO_PORT ); +outb (c,GET_GLOBAL (DebugOutputPort));if (c =='\n' )debug_serial ('\r' );debug_serial (c);
src/util.h +1 -0
@@ -231,6 +231,7 @@ int wait_preempt(void);void check_preempt (void );// output.c +extern u16 DebugOutputPort;void debug_serial_setup (void );void panic (const char *fmt, ...) __attribute__ ((format (printf,1 ,2 )))__noreturn ;
src/xen.c +6 -0
@@ -65,6 +65,10 @@ void xen_probe(void)dprintf (1 ,"Found hypervisor signature \"%s\" at %x\n" , signature, base);if (strcmp (signature,"XenVMMXenVMM" ) ==0 ) { +/* Set debug_io_port first, so the following messages work. */ + DebugOutputPort =0xe9 ; +dprintf (1 ,"SeaBIOS (version %s)\n\n" ,VERSION ); +dprintf (1 ,"Found Xen hypervisor signature at %x\n" , base);if ((eax - base) <2 )panic ("Insufficient Xen cpuid leaves. eax=%x at base %x\n" , eax, base);
@@ -72,6 +76,8 @@ void xen_probe(void)break ; } } +if (!xen_cpuid_base) +dprintf (1 ,"No Xen hypervisor found.\n" ); }static int hypercall_xen_version (int cmd,void *arg)
Signature · 1 line
1.7.2.5
PATCH 3/3 SMM: Disable use of SMM when running under Xen
In reply to Ian CampbellXen does not support SMM mode.
--- src/smm.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
src/smm.c +3 -0
@@ -10,6 +10,7 @@#include "config.h" // CONFIG_* #include "ioport.h" // outb #include "pci_ids.h" // PCI_VENDOR_ID_INTEL +#include "xen.h" // usingXen ASM32FLAT ( ".global smm_relocation_start\n"
@@ -151,6 +152,8 @@ smm_init(void)return ;if (!CONFIG_USE_SMM )return ; +if (usingXen ()) +return ;dprintf (3 ,"init smm\n" );pci_find_init_device (smm_init_tbl,NULL );
Signature · 1 line
1.7.2.5
Sorry, forgot to CC xen-devel on the 0/3 mail, and obviously when I bounced it to xen-devel it didn't make it into the CC line either. Please CC both lists if you happen to reply...
Quoted 33 lines · Ian Campbell
The following are a few issues discovered in the course of investigating Debian bug #678042 [0], including the fix for that actual bug (which is cause by Xen not supporting SMM mode).
The following changes since commit
9166c4ae6d21d49bd97e0fb42eea2ffd6dd6f06d:Xen: add definition of
xen_hypercall_page(2012-06-27 21:07:24 -0400)are available in the git repository at:
git://xenbits.xen.org/people/ianc/seabios.gitbugfixesIan Campbell (3):
enable Xen support by default.
Xen: Autodetect debug I/O port at runtime instead of viaKconfig
SMM: Disable use of SMM when running under Xensrc/Kconfig | 9 +-------- src/output.c | 4 +++- src/smm.c | 3 +++ src/util.h | 1 + src/xen.c | 6 ++++++ 5 files changed, 14 insertions(+), 9 deletions(-)Thanks,
Ian.[0] http://bugs.debian.org/678042
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 3 lines · Ian Campbell
The following are a few issues discovered in the course of investigating Debian bug #678042 [0], including the fix for that actual bug (which is cause by Xen not supporting SMM mode).
Thanks. I applied your changes.
-Kevin
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Kevin O'Connor
Quoted 3 lines · Ian Campbell
The following are a few issues discovered in the course of investigating Debian bug #678042 [0], including the fix for that actual bug (which is cause by Xen not supporting SMM mode).
Thanks. I applied your changes.
Thank you!
Quoted 8 lines
-Kevin
_______________________________________________
SeaBIOS mailing list
[email protected]
http://www.seabios.org/mailman/listinfo/seabios