kvm_svm.h 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef __KVM_SVM_H
  2. #define __KVM_SVM_H
  3. #include <linux/kernel.h>
  4. #include <linux/types.h>
  5. #include <linux/list.h>
  6. #include <linux/kvm_host.h>
  7. #include <asm/msr.h>
  8. #include <asm/svm.h>
  9. static const u32 host_save_user_msrs[] = {
  10. #ifdef CONFIG_X86_64
  11. MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
  12. MSR_FS_BASE,
  13. #endif
  14. MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
  15. };
  16. #define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs)
  17. struct kvm_vcpu;
  18. struct vcpu_svm {
  19. struct kvm_vcpu vcpu;
  20. struct vmcb *vmcb;
  21. unsigned long vmcb_pa;
  22. struct svm_cpu_data *svm_data;
  23. uint64_t asid_generation;
  24. u64 next_rip;
  25. u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
  26. u64 host_gs_base;
  27. unsigned long host_cr2;
  28. u32 *msrpm;
  29. struct vmcb *hsave;
  30. u64 hsave_msr;
  31. u64 nested_vmcb;
  32. /* These are the merged vectors */
  33. u32 *nested_msrpm;
  34. /* gpa pointers to the real vectors */
  35. u64 nested_vmcb_msrpm;
  36. };
  37. #endif