diff options
author | Roger Pau Monné <royger@FreeBSD.org> | 2024-01-22 13:20:25 +0000 |
---|---|---|
committer | Roger Pau Monné <royger@FreeBSD.org> | 2024-02-22 10:08:03 +0000 |
commit | 399386f190f157073baaa56925e92cc90edded8c (patch) | |
tree | c00a3391b83fb3734d73c73fbf4d6e322fb83bd1 /sys/xen | |
parent | 4ece79968e70b96d3283f202635d49a4bf04a7e7 (diff) | |
download | src-399386f190f157073baaa56925e92cc90edded8c.tar.gz src-399386f190f157073baaa56925e92cc90edded8c.zip |
x86/xen: introduce non-hypercall based emergency print
The current xc_printf() function uses an hypercall in order to send character
buffers to the hypervisor for it to print on the hypervisor console (if the
hypervisor is configured to print such messages).
This requires the hypercall page to be initialized, which is extra work and can
go wrong.
On x86 instead of using the console IO hypercall use the debug console IO port,
also called "port E9 hack". This allows sending characters to Xen using an
outb instruction, without any initialization required.
Keep the previous hypervisor based implementation by using the weak attribute,
which allows each architecture to provide an alternate (arch-specific)
implementation.
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43929
Diffstat (limited to 'sys/xen')
-rw-r--r-- | sys/xen/xen-os.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index d7e9b3ca8632..98be41124846 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -151,6 +151,13 @@ int xenmem_free(device_t dev, int res_id, struct resource *res); /* Debug/emergency function, prints directly to hypervisor console */ void xc_printf(const char *, ...) __printflike(1, 2); +/* + * Emergency print function, can be defined per-arch, otherwise defaults to + * HYPERVISOR_console_write. Should not be called directly, use xc_printf + * instead. + */ +void xen_emergency_print(const char *str, size_t size); + #ifndef xen_mb #define xen_mb() mb() #endif |