aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual/kvm
diff options
context:
space:
mode:
authorRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>2012-08-07 03:39:59 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-08-13 16:39:59 -0400
commitfc16123937ccfc2f2bbe98a5e41c4f6d26a22b24 (patch)
tree8f8f3965a65066d3b4cd03c413c4378928ea1fbe /Documentation/virtual/kvm
parent51d59c6b422f3f95940ae4e5b42f165595906aee (diff)
KVM: Add documentation on hypercalls
Thanks Alex for KVM_HC_FEATURES inputs and Jan for VAPIC_POLL_IRQ, and Peter (HPA) for suggesting hypercall ABI addition. Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'Documentation/virtual/kvm')
-rw-r--r--Documentation/virtual/kvm/hypercalls.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/hypercalls.txt b/Documentation/virtual/kvm/hypercalls.txt
new file mode 100644
index 000000000000..ea113b5d87a4
--- /dev/null
+++ b/Documentation/virtual/kvm/hypercalls.txt
@@ -0,0 +1,66 @@
1Linux KVM Hypercall:
2===================
3X86:
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
8 Up to four arguments may be passed in rbx, rcx, rdx, and rsi respectively.
9 The hypercall number should be placed in rax and the return value will be
10 placed in rax. No other registers will be clobbered unless explicitly stated
11 by the particular hypercall.
12
13S390:
14 R2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall
15 number. The return value is written to R2.
16
17 S390 uses diagnose instruction as hypercall (0x500) along with hypercall
18 number in R1.
19
20 PowerPC:
21 It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers.
22 Return value is placed in R3.
23
24 KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions'
25 property inside the device tree's /hypervisor node.
26 For more information refer to Documentation/virtual/kvm/ppc-pv.txt
27
28KVM Hypercalls Documentation
29===========================
30The template for each hypercall is:
311. Hypercall name.
322. Architecture(s)
333. Status (deprecated, obsolete, active)
344. Purpose
35
361. KVM_HC_VAPIC_POLL_IRQ
37------------------------
38Architecture: x86
39Status: active
40Purpose: Trigger guest exit so that the host can check for pending
41interrupts on reentry.
42
432. KVM_HC_MMU_OP
44------------------------
45Architecture: x86
46Status: deprecated.
47Purpose: Support MMU operations such as writing to PTE,
48flushing TLB, release PT.
49
503. KVM_HC_FEATURES
51------------------------
52Architecture: PPC
53Status: active
54Purpose: Expose hypercall availability to the guest. On x86 platforms, cpuid
55used to enumerate which hypercalls are available. On PPC, either device tree
56based lookup ( which is also what EPAPR dictates) OR KVM specific enumeration
57mechanism (which is this hypercall) can be used.
58
594. KVM_HC_PPC_MAP_MAGIC_PAGE
60------------------------
61Architecture: PPC
62Status: active
63Purpose: To enable communication between the hypervisor and guest there is a
64shared page that contains parts of supervisor visible register state.
65The guest can map this shared page to access its supervisor register through
66memory using this hypercall.