Advertisement
jintack

Xen x86 trap in

Mar 20th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
  2. index 664ed83..ea47a9b 100644
  3. --- a/xen/arch/x86/hvm/vmx/entry.S
  4. +++ b/xen/arch/x86/hvm/vmx/entry.S
  5. @@ -30,6 +30,13 @@
  6. #define VMLAUNCH .byte 0x0f,0x01,0xc2
  7.  
  8. ENTRY(vmx_asm_vmexit_handler)
  9. + cmp $0x4b000000, %rax
  10. + jne .Lnormal
  11. + RDTSC
  12. + shl $0x20, %rdx
  13. + or %rax, %rdx
  14. + mov $0x4b000000, %rax
  15. +.Lnormal:
  16. push %rdi
  17. push %rsi
  18. push %rdx
  19. diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
  20. index f2554d6..e5191fe 100644
  21. --- a/xen/arch/x86/hvm/vmx/vmx.c
  22. +++ b/xen/arch/x86/hvm/vmx/vmx.c
  23. @@ -2955,7 +2955,14 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
  24. {
  25. int rc;
  26. HVMTRACE_1D(VMMCALL, regs->eax);
  27. + if (regs->rax == 0x4b000000)
  28. + {
  29. + regs->rdx = hvm_get_guest_tsc_fixed(v, regs->rdx);
  30. + rc = HVM_HCALL_completed;
  31. + goto skip_vmcall;
  32. + }
  33. rc = hvm_do_hypercall(regs);
  34. +skip_vmcall:
  35. if ( rc != HVM_HCALL_preempted )
  36. {
  37. update_guest_eip(); /* Safe: VMCALL */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement