Lines Matching +full:guest +full:- +full:index +full:- +full:bits

1 .. SPDX-License-Identifier: GPL-2.0
4 Hypercall Op-codes (hcalls)
10 Virtualization on 64-bit Power Book3S Platforms is based on the PAPR
11 specification [1]_ which describes the run-time environment for a guest
15 - **IBM PowerVM (PHYP)**: IBM's proprietary hypervisor that supports AIX,
16 IBM-i and Linux as supported guests (termed as Logical Partitions
19 - **Qemu/KVM**: Supports PPC64 linux guests running on a PPC64 linux host.
22 On PPC64 arch a guest kernel running on top of a PAPR hypervisor is called
23 a *pSeries guest*. A pseries guest runs in a supervisor mode (HV=0) and must
28 Hence a Hypercall (hcall) is essentially a request by the pseries guest
29 asking hypervisor to perform a privileged operation on behalf of the guest. The
30 guest issues a with necessary input operands. The hypervisor after performing
32 guest.
36 The ABI specification for a hcall between a pseries guest and PAPR hypervisor
39 and any in-arguments for the hcall are provided in registers *r4-r12*. If values
41 in Big-endian byte order.
43 Once control returns back to the guest after hypervisor has serviced the
45 out values are returned in registers *r4-r12*. Again like in case of in-arguments,
46 any out values stored in a memory buffer will be in Big-endian byte order.
50 running as pseries guest.
56 of "64-Bit ELF V2 ABI Specification: Power Architecture"[5]_. Table below
59 +----------+----------+-------------------------------------------+
63 | r0 | Y | Optional-usage |
64 +----------+----------+-------------------------------------------+
66 +----------+----------+-------------------------------------------+
68 +----------+----------+-------------------------------------------+
70 +----------+----------+-------------------------------------------+
71 | r4-r10 | Y | in and out values |
72 +----------+----------+-------------------------------------------+
73 | r11 | Y | Optional-usage/Environmental pointer |
74 +----------+----------+-------------------------------------------+
75 | r12 | Y | Optional-usage/Function entry address at |
77 +----------+----------+-------------------------------------------+
78 | r13 | N | Thread-Pointer |
79 +----------+----------+-------------------------------------------+
80 | r14-r31 | N | Local Variables |
81 +----------+----------+-------------------------------------------+
83 +----------+----------+-------------------------------------------+
85 +----------+----------+-------------------------------------------+
86 | XER | Y | Fixed-point exception register. |
87 +----------+----------+-------------------------------------------+
88 | CR0-1 | Y | Condition register fields. |
89 +----------+----------+-------------------------------------------+
90 | CR2-4 | N | Condition register fields. |
91 +----------+----------+-------------------------------------------+
92 | CR5-7 | Y | Condition register fields. |
93 +----------+----------+-------------------------------------------+
95 +----------+----------+-------------------------------------------+
101 DR1 Guest
102 +--+ +------------+ +---------+
103 | | <----> | | | User |
104 +--+ DRC1 | | DRC | Space |
105 | PAPR | Index +---------+
107 +--+ | | <-----> | Kernel |
108 | | <----> | | Hcall | |
109 +--+ DRC2 +------------+ +---------+
113 an LPAR, PHYP creates a data-structure called Dynamic Resource Connector (DRC)
114 to manage LPAR access. An LPAR refers to a DRC via an opaque 32-bit number
115 called DRC-Index. The DRC-index value is provided to the LPAR via device-tree
119 HCALL Return-values
122 After servicing the hcall, hypervisor sets the return-value in *r3* indicating
129 accept an opaque value *continue-token* within there argument list and a
133 To make such hcalls the guest need to set *continue-token == 0* for the
134 initial call and use the hypervisor returned value of *continue-token*
138 HCALL Op-codes
146 | Input: *drcIndex, offset, buffer-address, numBytesToRead*
150 Given a DRC Index of an NVDIMM, read N-bytes from the metadata area
153 bad-blocks etc. The metadata area is located out-of-band of NVDIMM storage
162 Given a DRC Index of an NVDIMM, write N-bytes to the metadata area
168 | *targetLogicalMemoryAddress, continue-token*
169 | Out: *continue-token, targetLogicalMemoryAddress, numScmBlocksToBound*
173 Given a DRC-Index of an NVDIMM, map a continuous SCM blocks range
174 *(startingScmBlockIndex, startingScmBlockIndex+numScmBlocksToBind)* to the guest
175 at *targetLogicalMemoryAddress* within guest physical address space. In
177 assigns a target address to the guest. The HCALL can fail if the Guest has
186 Given a DRC-Index of an NVDimm, unmap *numScmBlocksToUnbind* SCM blocks starting
187 at *startingScmLogicalMemoryAddress* from guest physical address space. The
188 HCALL can fail if the Guest has an active PTE entry to the SCM block being
194 | Out: *Guest-Physical-Address*
197 Given a DRC-Index and an SCM Block index return the guest physical address to
202 | Input: *Guest-Physical-Address*
206 Given a guest physical address return which DRC Index and SCM block is mapped
223 | Out: *health-bitmap (r4), health-bit-valid-bitmap (r5)*
226 Given a DRC Index return the info on predictive failure and overall health of
227 the PMEM device. The asserted bits in the health-bitmap indicate one or more states
228 (described in table below) of the PMEM device and health-bit-valid-bitmap indicate
229 which bits in health-bitmap are valid. The bits are reported in
231 indicates bits 0, 1, and 5 are valid.
235 +------+-----------------------------------------------------------------------+
240 +------+-----------------------------------------------------------------------+
244 +------+-----------------------------------------------------------------------+
247 +------+-----------------------------------------------------------------------+
250 +------+-----------------------------------------------------------------------+
252 +------+-----------------------------------------------------------------------+
254 +------+-----------------------------------------------------------------------+
258 +------+-----------------------------------------------------------------------+
260 +------+-----------------------------------------------------------------------+
262 +------+-----------------------------------------------------------------------+
265 +------+-----------------------------------------------------------------------+
267 +------+-----------------------------------------------------------------------+
275 Given a DRC Index collect the performance statistics for NVDIMM and copy them
280 | Input: *drcIndex, continue-token*
281 | Out: *continue-token*
284 Given a DRC Index Flush the data to backend NVDIMM device.
288 *continue-token* from the output to be passed in the argument list of
298 .. [3] "Definitions and Notation" Book III-Section 14.5.3
299 https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0
301 .. [5] "64-Bit ELF V2 ABI Specification: Power Architecture"
302 … https://openpowerfoundation.org/?resource_lib=64-bit-elf-v2-abi-specification-power-architecture