hypercalls.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Linux KVM Hypercall:
  2. ===================
  3. X86:
  4. KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall
  5. instruction. The hypervisor can replace it with instructions that are
  6. guaranteed to be supported.
  7. Up to four arguments may be passed in rbx, rcx, rdx, and rsi respectively.
  8. The hypercall number should be placed in rax and the return value will be
  9. placed in rax. No other registers will be clobbered unless explicitly stated
  10. by the particular hypercall.
  11. S390:
  12. R2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall
  13. number. The return value is written to R2.
  14. S390 uses diagnose instruction as hypercall (0x500) along with hypercall
  15. number in R1.
  16. PowerPC:
  17. It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.
  18. Return value is placed in R3.
  19. KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions'
  20. property inside the device tree's /hypervisor node.
  21. For more information refer to Documentation/virtual/kvm/ppc-pv.txt
  22. KVM Hypercalls Documentation
  23. ===========================
  24. The template for each hypercall is:
  25. 1. Hypercall name.
  26. 2. Architecture(s)
  27. 3. Status (deprecated, obsolete, active)
  28. 4. Purpose
  29. 1. KVM_HC_VAPIC_POLL_IRQ
  30. ------------------------
  31. Architecture: x86
  32. Status: active
  33. Purpose: Trigger guest exit so that the host can check for pending
  34. interrupts on reentry.
  35. 2. KVM_HC_MMU_OP
  36. ------------------------
  37. Architecture: x86
  38. Status: deprecated.
  39. Purpose: Support MMU operations such as writing to PTE,
  40. flushing TLB, release PT.
  41. 3. KVM_HC_FEATURES
  42. ------------------------
  43. Architecture: PPC
  44. Status: active
  45. Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
  46. used to enumerate which hypercalls are available. On PPC, either device tree
  47. based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration
  48. mechanism (which is this hypercall) can be used.
  49. 4. KVM_HC_PPC_MAP_MAGIC_PAGE
  50. ------------------------
  51. Architecture: PPC
  52. Status: active
  53. Purpose: To enable communication between the hypervisor and guest there is a
  54. shared page that contains parts of supervisor visible register state.
  55. The guest can map this shared page to access its supervisor register through
  56. memory using this hypercall.