| 399386f1 | 22-Jan-2024 |
Roger Pau Monné <royger@FreeBSD.org> |
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 conso
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
show more ...
|
| 4c9e6ad3 | 02-Dec-2023 |
Elliott Mitchell <ehem+freebsd@m5p.com> |
xen: add atomic #defines to accomodate differing xen_ulong_t sizes
Alas, ARM declared xen_ulong_t to be 64-bits long, unlike i386 where it matches the word size. As a result, compatibility wrappers
xen: add atomic #defines to accomodate differing xen_ulong_t sizes
Alas, ARM declared xen_ulong_t to be 64-bits long, unlike i386 where it matches the word size. As a result, compatibility wrappers are needed for Xen atomic operations.
Reviewed by: royger
show more ...
|
| c7368ccb | 06-Aug-2022 |
Elliott Mitchell <ehem+freebsd@m5p.com> |
xen: remove xen_domain_type enum/variable
The vm_guest variable readily covers all uses of xen_domain_type, so merge them together. Since support for PV domains has been removed hard-core xen_pv_do
xen: remove xen_domain_type enum/variable
The vm_guest variable readily covers all uses of xen_domain_type, so merge them together. Since support for PV domains has been removed hard-core xen_pv_domain() to return false.
Reviewed by: royger
show more ...
|
| 6d765bff | 16-Feb-2021 |
Elliott Mitchell <ehem+freebsd@m5p.com> |
xen: move common variables off of sys/x86/xen/hvm.c
The xen_domain_type and HYPERVISOR_shared_info variables are shared by all Xen architectures, so they should be in common rather than reimplemente
xen: move common variables off of sys/x86/xen/hvm.c
The xen_domain_type and HYPERVISOR_shared_info variables are shared by all Xen architectures, so they should be in common rather than reimplemented by each architecture.
hvm_start_flags is used by xen_initial_domain() and so needs to be in common.
Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D28982
show more ...
|
| d32d6527 | 09-Nov-2021 |
Elliott Mitchell <ehem+freebsd@m5p.com> |
xen/intr: move evtchn_type to intr-internal.h
The evtchn_type enum is only touched by the Xen interrupt code. Other event channel uses no longer need the value, so that has been moved to restrict i
xen/intr: move evtchn_type to intr-internal.h
The evtchn_type enum is only touched by the Xen interrupt code. Other event channel uses no longer need the value, so that has been moved to restrict its use.
Copyright note. The current evtchn_type was introduced at 76acc41fb7c7 by Justin T. Gibbs. This in turn appears to have been heavily inspired by 30d1eefe3937 done by Kip Macy.
Reviewed by: royger
show more ...
|
| af610cab | 21-Apr-2021 |
Elliott Mitchell <ehem+freebsd@m5p.com> |
xen/intr: adjust xen_intr_handle_upcall() to match driver filter
xen_intr_handle_upcall() has two interfaces. It needs to be called by the x86 assembly code invoked by the APIC. Second, it needs t
xen/intr: adjust xen_intr_handle_upcall() to match driver filter
xen_intr_handle_upcall() has two interfaces. It needs to be called by the x86 assembly code invoked by the APIC. Second, it needs to be called as a driver_filter_t for the XenPCI code and for architectures besides x86.
Unfortunately the driver_filter_t interface was implemented as a wrapper around the x86-APIC interface. Now create a simple wrapper for the x86-APIC code, which calls an architecture-independent xen_intr_handle_upcall().
When called via intr_event_handle(), driver_filter_t functions expect preemption to be disabled. This removes the need for critical_enter()/critical_exit() when called this way.
The lapic_eoi() call is only needed on x86 in some cases when invoked directly as an APIC vector handler.
Additionally driver_filter_t functions have no need to handle interrupt counters. The intrcnt_add() calling function was reworked to match the current situation. intrcnt_add() is now only called via one path.
The increment/decrement of curthread->td_intr_nesting_level had previously been left out. Appears this was mostly harmless, but this was noticed during implementation and has been added.
CONFIG_X86 is a leftover from use with Linux. While the barrier isn't needed for FreeBSD on x86, it will be needed for FreeBSD on other architectures.
Copyright note. xen_intr_intrcnt_add() was introduced at 76acc41fb7c7 by Justin T. Gibbs. xen_intrcnt_init() was introduced at fd036deac1695 by John Baldwin.
sys/x86/xen/xen_arch_intr.c was originally created by Julien Grall in 2015 for the purpose of holding the x86 interrupt interface. Later it was found xen_intr_handle_upcall() was better earlier, and the x86 interrupt interface better later. As such the filename and header list belong to Julien Grall, but what those were created for is later.
Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D30006
show more ...
|