mirror of
https://github.com/opnsense/src.git
synced 2026-05-25 02:35:01 -04:00
Xen PVHVM guest. Submitted by: Roger Pau Monné Sponsored by: Citrix Systems R&D Reviewed by: gibbs Approved by: re (blanket Xen) MFC after: 2 weeks sys/amd64/amd64/mp_machdep.c: sys/i386/i386/mp_machdep.c: - Make sure that are no MMU related IPIs pending on migration. - Reset pending IPI_BITMAP on resume. - Init vcpu_info on resume. sys/amd64/include/intr_machdep.h: sys/i386/include/intr_machdep.h: sys/x86/acpica/acpi_wakeup.c: sys/x86/x86/intr_machdep.c: sys/x86/isa/atpic.c: sys/x86/x86/io_apic.c: sys/x86/x86/local_apic.c: - Add a "suspend_cancelled" parameter to pic_resume(). For the Xen PIC, restoration of interrupt services differs between the aborted suspend and normal resume cases, so we must provide this information. sys/dev/acpica/acpi_timer.c: sys/dev/xen/timer/timer.c: sys/timetc.h: - Don't swap out "suspend safe" timers across a suspend/resume cycle. This includes the Xen PV and ACPI timers. sys/dev/xen/control/control.c: - Perform proper suspend/resume process for PVHVM: - Suspend all APs before going into suspension, this allows us to reset the vcpu_info on resume for each AP. - Reset shared info page and callback on resume. sys/dev/xen/timer/timer.c: - Implement suspend/resume support for the PV timer. Since FreeBSD doesn't perform a per-cpu resume of the timer, we need to call smp_rendezvous in order to correctly resume the timer on each CPU. sys/dev/xen/xenpci/xenpci.c: - Don't reset the PCI interrupt on each suspend/resume. sys/kern/subr_smp.c: - When suspending a PVHVM domain make sure there are no MMU IPIs in-flight, or we will get a lockup on resume due to the fact that pending event channels are not carried over on migration. - Implement a generic version of restart_cpus that can be used by suspended and stopped cpus. sys/x86/xen/hvm.c: - Implement resume support for the hypercall page and shared info. - Clear vcpu_info so it can be reset by APs when resuming from suspension. sys/dev/xen/xenpci/xenpci.c: sys/x86/xen/hvm.c: sys/x86/xen/xen_intr.c: - Support UP kernel configurations. sys/x86/xen/xen_intr.c: - Properly rebind per-cpus VIRQs and IPIs on resume.
89 lines
2.7 KiB
C
89 lines
2.7 KiB
C
/*-
|
|
* ----------------------------------------------------------------------------
|
|
* "THE BEER-WARE LICENSE" (Revision 42):
|
|
* <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
|
|
* can do whatever you want with this stuff. If we meet some day, and you think
|
|
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
|
* ----------------------------------------------------------------------------
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
#ifndef _SYS_TIMETC_H_
|
|
#define _SYS_TIMETC_H_
|
|
|
|
#ifndef _KERNEL
|
|
#error "no user-serviceable parts inside"
|
|
#endif
|
|
|
|
/*-
|
|
* `struct timecounter' is the interface between the hardware which implements
|
|
* a timecounter and the MI code which uses this to keep track of time.
|
|
*
|
|
* A timecounter is a binary counter which has two properties:
|
|
* * it runs at a fixed, known frequency.
|
|
* * it has sufficient bits to not roll over in less than approximately
|
|
* max(2 msec, 2/HZ seconds). (The value 2 here is really 1 + delta,
|
|
* for some indeterminate value of delta.)
|
|
*/
|
|
|
|
struct timecounter;
|
|
typedef u_int timecounter_get_t(struct timecounter *);
|
|
typedef void timecounter_pps_t(struct timecounter *);
|
|
|
|
struct timecounter {
|
|
timecounter_get_t *tc_get_timecount;
|
|
/*
|
|
* This function reads the counter. It is not required to
|
|
* mask any unimplemented bits out, as long as they are
|
|
* constant.
|
|
*/
|
|
timecounter_pps_t *tc_poll_pps;
|
|
/*
|
|
* This function is optional. It will be called whenever the
|
|
* timecounter is rewound, and is intended to check for PPS
|
|
* events. Normal hardware does not need it but timecounters
|
|
* which latch PPS in hardware (like sys/pci/xrpu.c) do.
|
|
*/
|
|
u_int tc_counter_mask;
|
|
/* This mask should mask off any unimplemented bits. */
|
|
uint64_t tc_frequency;
|
|
/* Frequency of the counter in Hz. */
|
|
char *tc_name;
|
|
/* Name of the timecounter. */
|
|
int tc_quality;
|
|
/*
|
|
* Used to determine if this timecounter is better than
|
|
* another timecounter higher means better. Negative
|
|
* means "only use at explicit request".
|
|
*/
|
|
u_int tc_flags;
|
|
#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */
|
|
#define TC_FLAGS_SUSPEND_SAFE 2 /*
|
|
* Timer functional across
|
|
* suspend/resume.
|
|
*/
|
|
|
|
void *tc_priv;
|
|
/* Pointer to the timecounter's private parts. */
|
|
struct timecounter *tc_next;
|
|
/* Pointer to the next timecounter. */
|
|
};
|
|
|
|
extern struct timecounter *timecounter;
|
|
extern int tc_min_ticktock_freq; /*
|
|
* Minimal tc_ticktock() call frequency,
|
|
* required to handle counter wraps.
|
|
*/
|
|
|
|
u_int64_t tc_getfrequency(void);
|
|
void tc_init(struct timecounter *tc);
|
|
void tc_setclock(struct timespec *ts);
|
|
void tc_ticktock(int cnt);
|
|
void cpu_tick_calibration(void);
|
|
|
|
#ifdef SYSCTL_DECL
|
|
SYSCTL_DECL(_kern_timecounter);
|
|
#endif
|
|
|
|
#endif /* !_SYS_TIMETC_H_ */
|