Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/amd/svm_softc.h
Show All 31 Lines | |||||
#define SVM_IO_BITMAP_SIZE (3 * PAGE_SIZE) | #define SVM_IO_BITMAP_SIZE (3 * PAGE_SIZE) | ||||
#define SVM_MSR_BITMAP_SIZE (2 * PAGE_SIZE) | #define SVM_MSR_BITMAP_SIZE (2 * PAGE_SIZE) | ||||
struct asid { | struct asid { | ||||
uint64_t gen; /* range is [1, ~0UL] */ | uint64_t gen; /* range is [1, ~0UL] */ | ||||
uint32_t num; /* range is [1, nasid - 1] */ | uint32_t num; /* range is [1, nasid - 1] */ | ||||
}; | }; | ||||
enum nmi_blocking { | |||||
NMI_UNBLOCKED = 0, | |||||
NMI_IRET_INTERCEPT, /* iret intercept is enabled */ | |||||
NMI_IRET_TRACING, /* iret tracing is enabled */ | |||||
}; | |||||
/* | /* | ||||
* XXX separate out 'struct vmcb' from 'svm_vcpu' to avoid wasting space | * XXX separate out 'struct vmcb' from 'svm_vcpu' to avoid wasting space | ||||
* due to VMCB alignment requirements. | * due to VMCB alignment requirements. | ||||
*/ | */ | ||||
struct svm_vcpu { | struct svm_vcpu { | ||||
struct vmcb vmcb; /* hardware saved vcpu context */ | struct vmcb vmcb; /* hardware saved vcpu context */ | ||||
struct svm_regctx swctx; /* software saved vcpu context */ | struct svm_regctx swctx; /* software saved vcpu context */ | ||||
uint64_t vmcb_pa; /* VMCB physical address */ | uint64_t vmcb_pa; /* VMCB physical address */ | ||||
uint64_t nextrip; /* next instruction to be executed by guest */ | uint64_t nextrip; /* next instruction to be executed by guest */ | ||||
int lastcpu; /* host cpu that the vcpu last ran on */ | int lastcpu; /* host cpu that the vcpu last ran on */ | ||||
uint32_t dirty; /* state cache bits that must be cleared */ | uint32_t dirty; /* state cache bits that must be cleared */ | ||||
long eptgen; /* pmap->pm_eptgen when the vcpu last ran */ | long eptgen; /* pmap->pm_eptgen when the vcpu last ran */ | ||||
struct asid asid; | struct asid asid; | ||||
struct { | |||||
enum nmi_blocking blocking; | |||||
uint32_t exception_bitmap; | |||||
uint64_t rflags; | |||||
} nmi; | |||||
} __aligned(PAGE_SIZE); | } __aligned(PAGE_SIZE); | ||||
/* | /* | ||||
* SVM softc, one per virtual machine. | * SVM softc, one per virtual machine. | ||||
*/ | */ | ||||
struct svm_softc { | struct svm_softc { | ||||
uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ | uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ | ||||
uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ | uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |