kvm_svm.h 1001 字节
Newer Older
A
Avi Kivity 已提交
1 2 3
#ifndef __KVM_SVM_H
#define __KVM_SVM_H

4
#include <linux/kernel.h>
A
Avi Kivity 已提交
5 6
#include <linux/types.h>
#include <linux/list.h>
7
#include <linux/kvm_host.h>
A
Avi Kivity 已提交
8 9
#include <asm/msr.h>

10
#include <asm/svm.h>
A
Avi Kivity 已提交
11

12
static const u32 host_save_user_msrs[] = {
13
#ifdef CONFIG_X86_64
A
Avi Kivity 已提交
14
	MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
15
	MSR_FS_BASE,
A
Avi Kivity 已提交
16 17 18 19
#endif
	MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
};

20
#define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs)
A
Avi Kivity 已提交
21

22 23
struct kvm_vcpu;

A
Avi Kivity 已提交
24
struct vcpu_svm {
R
Rusty Russell 已提交
25
	struct kvm_vcpu vcpu;
A
Avi Kivity 已提交
26 27 28 29
	struct vmcb *vmcb;
	unsigned long vmcb_pa;
	struct svm_cpu_data *svm_data;
	uint64_t asid_generation;
30 31
	uint64_t sysenter_esp;
	uint64_t sysenter_eip;
A
Avi Kivity 已提交
32 33 34

	u64 next_rip;

35 36
	u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
	u64 host_gs_base;
A
Avi Kivity 已提交
37
	unsigned long host_cr2;
38 39

	u32 *msrpm;
A
Alexander Graf 已提交
40 41
	struct vmcb *hsave;
	u64 hsave_msr;
A
Alexander Graf 已提交
42 43 44 45 46 47 48 49

	u64 nested_vmcb;

	/* These are the merged vectors */
	u32 *nested_msrpm;

	/* gpa pointers to the real vectors */
	u64 nested_vmcb_msrpm;
A
Avi Kivity 已提交
50 51 52 53
};

#endif