Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/io/vioapic.c
Show All 26 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_bhyve_snapshot.h" | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <x86/apicreg.h> | #include <x86/apicreg.h> | ||||
#include <machine/vmm.h> | #include <machine/vmm.h> | ||||
#include <machine/vmm_snapshot.h> | |||||
#include "vmm_ktr.h" | #include "vmm_ktr.h" | ||||
#include "vmm_lapic.h" | #include "vmm_lapic.h" | ||||
#include "vlapic.h" | #include "vlapic.h" | ||||
#include "vioapic.h" | #include "vioapic.h" | ||||
#define IOREGSEL 0x00 | #define IOREGSEL 0x00 | ||||
#define IOWIN 0x10 | #define IOWIN 0x10 | ||||
▲ Show 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
int | int | ||||
vioapic_pincount(struct vm *vm) | vioapic_pincount(struct vm *vm) | ||||
{ | { | ||||
return (REDIR_ENTRIES); | return (REDIR_ENTRIES); | ||||
} | } | ||||
#ifdef BHYVE_SNAPSHOT | |||||
int | |||||
vioapic_snapshot(struct vioapic *vioapic, struct vm_snapshot_meta *meta) | |||||
{ | |||||
int ret; | |||||
int i; | |||||
SNAPSHOT_VAR_OR_LEAVE(vioapic->ioregsel, meta, ret, done); | |||||
for (i = 0; i < nitems(vioapic->rtbl); i++) { | |||||
SNAPSHOT_VAR_OR_LEAVE(vioapic->rtbl[i].reg, meta, ret, done); | |||||
pmooney_pfmooney.com: The write operators for these register tables enforce certain invariants about their contents. | |||||
Done Inline ActionsAdded this to the analysis document under restore checks with TODO. darius.mihaim_gmail.com: Added this to the analysis document under restore checks with TODO. | |||||
SNAPSHOT_VAR_OR_LEAVE(vioapic->rtbl[i].acnt, meta, ret, done); | |||||
} | |||||
done: | |||||
return (ret); | |||||
} | |||||
#endif |
The write operators for these register tables enforce certain invariants about their contents. The restore process likely needs to do the same enforcement. Additionally, I believe this is skipping TMR updates for the CPUs.