kvm-asm-offsets.c 778 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Generate definitions needed by assembly language modules.
  4. * This code generates raw asm output which is post-processed to extract
  5. * and format the required data.
  6. */
  7. #define COMPILE_OFFSETS
  8. #include <linux/kbuild.h>
  9. #include "vmx/vmx.h"
  10. #include "svm/svm.h"
  11. static void __used common(void)
  12. {
  13. if (IS_ENABLED(CONFIG_KVM_AMD)) {
  14. BLANK();
  15. OFFSET(SVM_vcpu_arch_regs, vcpu_svm, vcpu.arch.regs);
  16. OFFSET(SVM_current_vmcb, vcpu_svm, current_vmcb);
  17. OFFSET(SVM_spec_ctrl, vcpu_svm, spec_ctrl);
  18. OFFSET(SVM_vmcb01, vcpu_svm, vmcb01);
  19. OFFSET(KVM_VMCB_pa, kvm_vmcb_info, pa);
  20. OFFSET(SD_save_area_pa, svm_cpu_data, save_area_pa);
  21. }
  22. if (IS_ENABLED(CONFIG_KVM_INTEL)) {
  23. BLANK();
  24. OFFSET(VMX_spec_ctrl, vcpu_vmx, spec_ctrl);
  25. }
  26. }