diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2013-11-13 05:15:02 -0500 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2013-12-11 13:03:52 -0500 |
commit | d9101fca3d572b8675b7fe3f4ef9f6f99bbf4364 (patch) | |
tree | b44063261ec8214ec373bdc9b0162e5842ba53da /Documentation/virtual | |
parent | d6d63b51fe3bfea0cf596993afa480b0b3b02c32 (diff) |
KVM: s390: diagnose call documentation
Add some further documentation on the DIAGNOSE calls we support.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'Documentation/virtual')
-rw-r--r-- | Documentation/virtual/kvm/hypercalls.txt | 3 | ||||
-rw-r--r-- | Documentation/virtual/kvm/s390-diag.txt | 80 |
2 files changed, 83 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/hypercalls.txt b/Documentation/virtual/kvm/hypercalls.txt index 022198e389d7..d922d73efa7b 100644 --- a/Documentation/virtual/kvm/hypercalls.txt +++ b/Documentation/virtual/kvm/hypercalls.txt | |||
@@ -17,6 +17,9 @@ S390: | |||
17 | S390 uses diagnose instruction as hypercall (0x500) along with hypercall | 17 | S390 uses diagnose instruction as hypercall (0x500) along with hypercall |
18 | number in R1. | 18 | number in R1. |
19 | 19 | ||
20 | For further information on the S390 diagnose call as supported by KVM, | ||
21 | refer to Documentation/virtual/kvm/s390-diag.txt. | ||
22 | |||
20 | PowerPC: | 23 | PowerPC: |
21 | It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. | 24 | It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. |
22 | Return value is placed in R3. | 25 | Return value is placed in R3. |
diff --git a/Documentation/virtual/kvm/s390-diag.txt b/Documentation/virtual/kvm/s390-diag.txt new file mode 100644 index 000000000000..f1de4fbade15 --- /dev/null +++ b/Documentation/virtual/kvm/s390-diag.txt | |||
@@ -0,0 +1,80 @@ | |||
1 | The s390 DIAGNOSE call on KVM | ||
2 | ============================= | ||
3 | |||
4 | KVM on s390 supports the DIAGNOSE call for making hypercalls, both for | ||
5 | native hypercalls and for selected hypercalls found on other s390 | ||
6 | hypervisors. | ||
7 | |||
8 | Note that bits are numbered as by the usual s390 convention (most significant | ||
9 | bit on the left). | ||
10 | |||
11 | |||
12 | General remarks | ||
13 | --------------- | ||
14 | |||
15 | DIAGNOSE calls by the guest cause a mandatory intercept. This implies | ||
16 | all supported DIAGNOSE calls need to be handled by either KVM or its | ||
17 | userspace. | ||
18 | |||
19 | All DIAGNOSE calls supported by KVM use the RS-a format: | ||
20 | |||
21 | -------------------------------------- | ||
22 | | '83' | R1 | R3 | B2 | D2 | | ||
23 | -------------------------------------- | ||
24 | 0 8 12 16 20 31 | ||
25 | |||
26 | The second-operand address (obtained by the base/displacement calculation) | ||
27 | is not used to address data. Instead, bits 48-63 of this address specify | ||
28 | the function code, and bits 0-47 are ignored. | ||
29 | |||
30 | The supported DIAGNOSE function codes vary by the userspace used. For | ||
31 | DIAGNOSE function codes not specific to KVM, please refer to the | ||
32 | documentation for the s390 hypervisors defining them. | ||
33 | |||
34 | |||
35 | DIAGNOSE function code 'X'500' - KVM virtio functions | ||
36 | ----------------------------------------------------- | ||
37 | |||
38 | If the function code specifies 0x500, various virtio-related functions | ||
39 | are performed. | ||
40 | |||
41 | General register 1 contains the virtio subfunction code. Supported | ||
42 | virtio subfunctions depend on KVM's userspace. Generally, userspace | ||
43 | provides either s390-virtio (subcodes 0-2) or virtio-ccw (subcode 3). | ||
44 | |||
45 | Upon completion of the DIAGNOSE instruction, general register 2 contains | ||
46 | the function's return code, which is either a return code or a subcode | ||
47 | specific value. | ||
48 | |||
49 | Subcode 0 - s390-virtio notification and early console printk | ||
50 | Handled by userspace. | ||
51 | |||
52 | Subcode 1 - s390-virtio reset | ||
53 | Handled by userspace. | ||
54 | |||
55 | Subcode 2 - s390-virtio set status | ||
56 | Handled by userspace. | ||
57 | |||
58 | Subcode 3 - virtio-ccw notification | ||
59 | Handled by either userspace or KVM (ioeventfd case). | ||
60 | |||
61 | General register 2 contains a subchannel-identification word denoting | ||
62 | the subchannel of the virtio-ccw proxy device to be notified. | ||
63 | |||
64 | General register 3 contains the number of the virtqueue to be notified. | ||
65 | |||
66 | General register 4 contains a 64bit identifier for KVM usage (the | ||
67 | kvm_io_bus cookie). If general register 4 does not contain a valid | ||
68 | identifier, it is ignored. | ||
69 | |||
70 | After completion of the DIAGNOSE call, general register 2 may contain | ||
71 | a 64bit identifier (in the kvm_io_bus cookie case). | ||
72 | |||
73 | See also the virtio standard for a discussion of this hypercall. | ||
74 | |||
75 | |||
76 | DIAGNOSE function code 'X'501 - KVM breakpoint | ||
77 | ---------------------------------------------- | ||
78 | |||
79 | If the function code specifies 0x501, breakpoint functions may be performed. | ||
80 | This function code is handled by userspace. | ||