Advertisement
Guest User

Untitled

a guest
Aug 10th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
DIV 1.50 KB | None | 0 0
  1. diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
  2. index b3d6e32..ede3fde 100644
  3. --- a/xen/arch/x86/x86_64/entry.S
  4. +++ b/xen/arch/x86/x86_64/entry.S
  5. @@ -52,6 +52,15 @@ restore_all_guest:
  6.          movq  8(%rsp),%rcx            # RIP
  7.          movq  24(%rsp),%r11           # RFLAGS
  8.          movq  32(%rsp),%rsp           # RSP
  9. +
  10. +        cmp  $135792468, %rax      # IF this is dummy hvc
  11. +   jne orig_out
  12. +   rdtsc
  13. +   shl  $0x20, %rdx
  14. +   OR   %rax, %rdx
  15. +   movq $135792469, %rax
  16. +
  17. +orig_out:
  18.          je    1f
  19.          sysretq
  20.  1:      sysretl
  21. @@ -120,6 +129,14 @@ restore_all_xen:
  22.   * the space left by the trampoline.
  23.   */
  24.  ENTRY(syscall_enter)
  25. +        cmp  $39, %rax     # IF this is dummy hvc
  26. +   jne orig_syscall_enter
  27. +   rdtsc
  28. +   shl  $0x20, %rdx
  29. +   OR   %rax, %rdx
  30. +   movq $39, %rax
  31. +
  32. +orig_syscall_enter:
  33.          sti
  34.          movl  $FLAT_KERNEL_SS,24(%rsp)
  35.          pushq %rcx
  36. @@ -772,6 +789,7 @@ ENTRY(hypercall_table)
  37.          .quad do_domctl
  38.          .quad do_kexec_op
  39.          .quad do_tmem_op
  40. +   .quad do_dummy_hyp          /* 39 */
  41.          .rept __HYPERVISOR_arch_0-((.-hypercall_table)/8)
  42.          .quad do_ni_hypercall
  43.          .endr
  44. @@ -821,6 +839,7 @@ ENTRY(hypercall_args_table)
  45.          .BYTE 1 /* do_domctl            */
  46.          .BYTE 2 /* do_kexec             */
  47.          .BYTE 1 /* do_tmem_op           */
  48. +        .BYTE 0 /* do_dummy_hyp        */
  49.          .rept __HYPERVISOR_arch_0-(.-hypercall_args_table)
  50.          .BYTE 0 /* do_ni_hypercall      */
  51.          .endr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement