1 .. SPDX-License-Identifier: GPL-2.0
4 ============================
5 Protected Execution Facility
6 ============================
14 Protected Execution Facility
15 ############################
17 Protected Execution Facility (PEF) is an architectural change for
18 POWER 9 that enables Secure Virtual Machines (SVMs). DD2.3 chips
19 (PVR=0x004e1203) or greater will be PEF-capable. A new ISA release
20 will include the PEF RFC02487 changes.
22 When enabled, PEF adds a new higher privileged mode, called Ultravisor
23 mode, to POWER architecture. Along with the new mode there is new
24 firmware called the Protected Execution Ultravisor (or Ultravisor
25 for short). Ultravisor mode is the highest privileged mode in POWER
40 PEF protects SVMs from the hypervisor, privileged users, and other
41 VMs in the system. SVMs are protected while at rest and can only be
42 executed by an authorized machine. All virtual machines utilize
43 hypervisor services. The Ultravisor filters calls between the SVMs
44 and the hypervisor to assure that information does not accidentally
45 leak. All hypercalls except H_RANDOM are reflected to the hypervisor.
46 H_RANDOM is not reflected to prevent the hypervisor from influencing
47 random values in the SVM.
49 To support this there is a refactoring of the ownership of resources
50 in the CPU. Some of the resources which were previously hypervisor
51 privileged are now ultravisor privileged.
56 The hardware changes include the following:
58 * There is a new bit in the MSR that determines whether the current
59 process is running in secure mode, MSR(S) bit 41. MSR(S)=1, process
60 is in secure mode, MSR(s)=0 process is in normal mode.
62 * The MSR(S) bit can only be set by the Ultravisor.
64 * HRFID cannot be used to set the MSR(S) bit. If the hypervisor needs
65 to return to a SVM it must use an ultracall. It can determine if
66 the VM it is returning to is secure.
68 * There is a new Ultravisor privileged register, SMFCTRL, which has an
69 enable/disable bit SMFCTRL(E).
71 * The privilege of a process is now determined by three MSR bits,
72 MSR(S, HV, PR). In each of the tables below the modes are listed
73 from least privilege to highest privilege. The higher privilege
74 modes can access all the resources of the lower privilege modes.
76 **Secure Mode MSR Settings**
78 +---+---+---+---------------+
79 | S | HV| PR|Privilege |
80 +===+===+===+===============+
81 | 1 | 0 | 1 | Problem |
82 +---+---+---+---------------+
83 | 1 | 0 | 0 | Privileged(OS)|
84 +---+---+---+---------------+
85 | 1 | 1 | 0 | Ultravisor |
86 +---+---+---+---------------+
87 | 1 | 1 | 1 | Reserved |
88 +---+---+---+---------------+
90 **Normal Mode MSR Settings**
92 +---+---+---+---------------+
93 | S | HV| PR|Privilege |
94 +===+===+===+===============+
95 | 0 | 0 | 1 | Problem |
96 +---+---+---+---------------+
97 | 0 | 0 | 0 | Privileged(OS)|
98 +---+---+---+---------------+
99 | 0 | 1 | 0 | Hypervisor |
100 +---+---+---+---------------+
101 | 0 | 1 | 1 | Problem (Host)|
102 +---+---+---+---------------+
104 * Memory is partitioned into secure and normal memory. Only processes
105 that are running in secure mode can access secure memory.
107 * The hardware does not allow anything that is not running secure to
108 access secure memory. This means that the Hypervisor cannot access
109 the memory of the SVM without using an ultracall (asking the
110 Ultravisor). The Ultravisor will only allow the hypervisor to see
111 the SVM memory encrypted.
113 * I/O systems are not allowed to directly address secure memory. This
114 limits the SVMs to virtual I/O only.
116 * The architecture allows the SVM to share pages of memory with the
117 hypervisor that are not protected with encryption. However, this
118 sharing must be initiated by the SVM.
120 * When a process is running in secure mode all hypercalls
121 (syscall lev=1) go to the Ultravisor.
123 * When a process is in secure mode all interrupts go to the
126 * The following resources have become Ultravisor privileged and
127 require an Ultravisor interface to manipulate:
129 * Processor configurations registers (SCOMs).
131 * Stop state information.
133 * The debug registers CIABR, DAWR, and DAWRX when SMFCTRL(D) is set.
134 If SMFCTRL(D) is not set they do not work in secure mode. When set,
135 reading and writing requires an Ultravisor call, otherwise that
136 will cause a Hypervisor Emulation Assistance interrupt.
138 * PTCR and partition table entries (partition table is in secure
139 memory). An attempt to write to PTCR will cause a Hypervisor
140 Emulation Assitance interrupt.
142 * LDBAR (LD Base Address Register) and IMC (In-Memory Collection)
143 non-architected registers. An attempt to write to them will cause a
144 Hypervisor Emulation Assistance interrupt.
146 * Paging for an SVM, sharing of memory with Hypervisor for an SVM.
147 (Including Virtual Processor Area (VPA) and virtual I/O).
153 The software changes include:
155 * SVMs are created from normal VM using (open source) tooling supplied
158 * All SVMs start as normal VMs and utilize an ultracall, UV_ESM
159 (Enter Secure Mode), to make the transition.
161 * When the UV_ESM ultracall is made the Ultravisor copies the VM into
162 secure memory, decrypts the verification information, and checks the
163 integrity of the SVM. If the integrity check passes the Ultravisor
164 passes control in secure mode.
166 * The verification information includes the pass phrase for the
167 encrypted disk associated with the SVM. This pass phrase is given
168 to the SVM when requested.
170 * The Ultravisor is not involved in protecting the encrypted disk of
171 the SVM while at rest.
173 * For external interrupts the Ultravisor saves the state of the SVM,
174 and reflects the interrupt to the hypervisor for processing.
175 For hypercalls, the Ultravisor inserts neutral state into all
176 registers not needed for the hypercall then reflects the call to
177 the hypervisor for processing. The H_RANDOM hypercall is performed
178 by the Ultravisor and not reflected.
180 * For virtual I/O to work bounce buffering must be done.
182 * The Ultravisor uses AES (IAPM) for protection of SVM memory. IAPM
183 is a mode of AES that provides integrity and secrecy concurrently.
185 * The movement of data between normal and secure pages is coordinated
186 with the Ultravisor by a new HMM plug-in in the Hypervisor.
188 The Ultravisor offers new services to the hypervisor and SVMs. These
189 are accessed through ultracalls.
194 * Hypercalls: special system calls used to request services from
197 * Normal memory: Memory that is accessible to Hypervisor.
199 * Normal page: Page backed by normal memory and available to
202 * Shared page: A page backed by normal memory and available to both
203 the Hypervisor/QEMU and the SVM (i.e page has mappings in SVM and
206 * Secure memory: Memory that is accessible only to Ultravisor and
209 * Secure page: Page backed by secure memory and only available to
212 * SVM: Secure Virtual Machine.
214 * Ultracalls: special system calls used to request services from
221 This section describes Ultravisor calls (ultracalls) needed to
222 support Secure Virtual Machines (SVM)s and Paravirtualized KVM. The
223 ultracalls allow the SVMs and Hypervisor to request services from the
224 Ultravisor such as accessing a register or memory region that can only
225 be accessed when running in Ultravisor-privileged mode.
227 The specific service needed from an ultracall is specified in register
228 R3 (the first parameter to the ultracall). Other parameters to the
229 ultracall, if any, are specified in registers R4 through R12.
231 Return value of all ultracalls is in register R3. Other output values
232 from the ultracall, if any, are returned in registers R4 through R12.
233 The only exception to this register usage is the ``UV_RETURN``
234 ultracall described below.
236 Each ultracall returns specific error codes, applicable in the context
237 of the ultracall. However, like with the PowerPC Architecture Platform
238 Reference (PAPR), if no specific error code is defined for a
239 particular situation, then the ultracall will fallback to an erroneous
240 parameter-position based code. i.e U_PARAMETER, U_P2, U_P3 etc
241 depending on the ultracall parameter that may have caused the error.
243 Some ultracalls involve transferring a page of data between Ultravisor
244 and Hypervisor. Secure pages that are transferred from secure memory
245 to normal memory may be encrypted using dynamically generated keys.
246 When the secure pages are transferred back to secure memory, they may
247 be decrypted using the same dynamically generated keys. Generation and
248 management of these keys will be covered in a separate document.
250 For now this only covers ultracalls currently implemented and being
251 used by Hypervisor and SVMs but others can be added here when it
254 The full specification for all hypercalls/ultracalls will eventually
255 be made available in the public/OpenPower version of the PAPR
260 If PEF is not enabled, the ultracalls will be redirected to the
261 Hypervisor which must handle/fail the calls.
263 Ultracalls used by Hypervisor
264 =============================
266 This section describes the virtual memory management ultracalls used
267 by the Hypervisor to manage SVMs.
272 Encrypt and move the contents of a page from secure memory to normal
280 uint64_t ultracall(const uint64_t UV_PAGE_OUT,
281 uint16_t lpid, /* LPAR ID */
282 uint64_t dest_ra, /* real address of destination page */
283 uint64_t src_gpa, /* source guest-physical-address */
284 uint8_t flags, /* flags */
285 uint64_t order) /* page size order */
290 One of the following values:
292 * U_SUCCESS on success.
293 * U_PARAMETER if ``lpid`` is invalid.
294 * U_P2 if ``dest_ra`` is invalid.
295 * U_P3 if the ``src_gpa`` address is invalid.
296 * U_P4 if any bit in the ``flags`` is unrecognized
297 * U_P5 if the ``order`` parameter is unsupported.
298 * U_FUNCTION if functionality is not supported.
299 * U_BUSY if page cannot be currently paged-out.
304 Encrypt the contents of a secure-page and make it available to
305 Hypervisor in a normal page.
307 By default, the source page is unmapped from the SVM's partition-
308 scoped page table. But the Hypervisor can provide a hint to the
309 Ultravisor to retain the page mapping by setting the ``UV_SNAPSHOT``
310 flag in ``flags`` parameter.
312 If the source page is already a shared page the call returns
313 U_SUCCESS, without doing anything.
318 #. QEMU attempts to access an address belonging to the SVM but the
319 page frame for that address is not mapped into QEMU's address
320 space. In this case, the Hypervisor will allocate a page frame,
321 map it into QEMU's address space and issue the ``UV_PAGE_OUT``
322 call to retrieve the encrypted contents of the page.
324 #. When Ultravisor runs low on secure memory and it needs to page-out
325 an LRU page. In this case, Ultravisor will issue the
326 ``H_SVM_PAGE_OUT`` hypercall to the Hypervisor. The Hypervisor will
327 then allocate a normal page and issue the ``UV_PAGE_OUT`` ultracall
328 and the Ultravisor will encrypt and move the contents of the secure
329 page into the normal page.
331 #. When Hypervisor accesses SVM data, the Hypervisor requests the
332 Ultravisor to transfer the corresponding page into a insecure page,
333 which the Hypervisor can access. The data in the normal page will
339 Move the contents of a page from normal memory to secure memory.
346 uint64_t ultracall(const uint64_t UV_PAGE_IN,
347 uint16_t lpid, /* the LPAR ID */
348 uint64_t src_ra, /* source real address of page */
349 uint64_t dest_gpa, /* destination guest physical address */
350 uint64_t flags, /* flags */
351 uint64_t order) /* page size order */
356 One of the following values:
358 * U_SUCCESS on success.
359 * U_BUSY if page cannot be currently paged-in.
360 * U_FUNCTION if functionality is not supported
361 * U_PARAMETER if ``lpid`` is invalid.
362 * U_P2 if ``src_ra`` is invalid.
363 * U_P3 if the ``dest_gpa`` address is invalid.
364 * U_P4 if any bit in the ``flags`` is unrecognized
365 * U_P5 if the ``order`` parameter is unsupported.
370 Move the contents of the page identified by ``src_ra`` from normal
371 memory to secure memory and map it to the guest physical address
374 If `dest_gpa` refers to a shared address, map the page into the
375 partition-scoped page-table of the SVM. If `dest_gpa` is not shared,
376 copy the contents of the page into the corresponding secure page.
377 Depending on the context, decrypt the page before being copied.
379 The caller provides the attributes of the page through the ``flags``
380 parameter. Valid values for ``flags`` are:
386 The Hypervisor must pin the page in memory before making
387 ``UV_PAGE_IN`` ultracall.
392 #. When a normal VM switches to secure mode, all its pages residing
393 in normal memory, are moved into secure memory.
395 #. When an SVM requests to share a page with Hypervisor the Hypervisor
396 allocates a page and informs the Ultravisor.
398 #. When an SVM accesses a secure page that has been paged-out,
399 Ultravisor invokes the Hypervisor to locate the page. After
400 locating the page, the Hypervisor uses UV_PAGE_IN to make the
401 page available to Ultravisor.
406 Invalidate the Ultravisor mapping of a page.
413 uint64_t ultracall(const uint64_t UV_PAGE_INVAL,
414 uint16_t lpid, /* the LPAR ID */
415 uint64_t guest_pa, /* destination guest-physical-address */
416 uint64_t order) /* page size order */
421 One of the following values:
423 * U_SUCCESS on success.
424 * U_PARAMETER if ``lpid`` is invalid.
425 * U_P2 if ``guest_pa`` is invalid (or corresponds to a secure
427 * U_P3 if the ``order`` is invalid.
428 * U_FUNCTION if functionality is not supported.
429 * U_BUSY if page cannot be currently invalidated.
434 This ultracall informs Ultravisor that the page mapping in Hypervisor
435 corresponding to the given guest physical address has been invalidated
436 and that the Ultravisor should not access the page. If the specified
437 ``guest_pa`` corresponds to a secure page, Ultravisor will ignore the
438 attempt to invalidate the page and return U_P2.
443 #. When a shared page is unmapped from the QEMU's page table, possibly
444 because it is paged-out to disk, Ultravisor needs to know that the
445 page should not be accessed from its side too.
451 Validate and write the partition table entry (PATE) for a given
459 uint64_t ultracall(const uint64_t UV_WRITE_PATE,
460 uint32_t lpid, /* the LPAR ID */
461 uint64_t dw0 /* the first double word to write */
462 uint64_t dw1) /* the second double word to write */
467 One of the following values:
469 * U_SUCCESS on success.
470 * U_BUSY if PATE cannot be currently written to.
471 * U_FUNCTION if functionality is not supported.
472 * U_PARAMETER if ``lpid`` is invalid.
473 * U_P2 if ``dw0`` is invalid.
474 * U_P3 if the ``dw1`` address is invalid.
475 * U_PERMISSION if the Hypervisor is attempting to change the PATE
476 of a secure virtual machine or if called from a
477 context other than Hypervisor.
482 Validate and write a LPID and its partition-table-entry for the given
483 LPID. If the LPID is already allocated and initialized, this call
484 results in changing the partition table entry.
489 #. The Partition table resides in Secure memory and its entries,
490 called PATE (Partition Table Entries), point to the partition-
491 scoped page tables for the Hypervisor as well as each of the
492 virtual machines (both secure and normal). The Hypervisor
493 operates in partition 0 and its partition-scoped page tables
494 reside in normal memory.
496 #. This ultracall allows the Hypervisor to register the partition-
497 scoped and process-scoped page table entries for the Hypervisor
498 and other partitions (virtual machines) with the Ultravisor.
500 #. If the value of the PATE for an existing partition (VM) changes,
501 the TLB cache for the partition is flushed.
503 #. The Hypervisor is responsible for allocating LPID. The LPID and
504 its PATE entry are registered together. The Hypervisor manages
505 the PATE entries for a normal VM and can change the PATE entry
506 anytime. Ultravisor manages the PATE entries for an SVM and
507 Hypervisor is not allowed to modify them.
512 Return control from the Hypervisor back to the Ultravisor after
513 processing an hypercall or interrupt that was forwarded (aka
514 *reflected*) to the Hypervisor.
521 uint64_t ultracall(const uint64_t UV_RETURN)
526 This call never returns to Hypervisor on success. It returns
527 U_INVALID if ultracall is not made from a Hypervisor context.
532 When an SVM makes an hypercall or incurs some other exception, the
533 Ultravisor usually forwards (aka *reflects*) the exceptions to the
534 Hypervisor. After processing the exception, Hypervisor uses the
535 ``UV_RETURN`` ultracall to return control back to the SVM.
537 The expected register state on entry to this ultracall is:
539 * Non-volatile registers are restored to their original values.
540 * If returning from an hypercall, register R0 contains the return
541 value (**unlike other ultracalls**) and, registers R4 through R12
542 contain any output values of the hypercall.
543 * R3 contains the ultracall number, i.e UV_RETURN.
544 * If returning with a synthesized interrupt, R2 contains the
545 synthesized interrupt number.
550 #. Ultravisor relies on the Hypervisor to provide several services to
551 the SVM such as processing hypercall and other exceptions. After
552 processing the exception, Hypervisor uses UV_RETURN to return
553 control back to the Ultravisor.
555 #. Hypervisor has to use this ultracall to return control to the SVM.
561 Register an SVM address-range with specified properties.
568 uint64_t ultracall(const uint64_t UV_REGISTER_MEM_SLOT,
569 uint64_t lpid, /* LPAR ID of the SVM */
570 uint64_t start_gpa, /* start guest physical address */
571 uint64_t size, /* size of address range in bytes */
572 uint64_t flags /* reserved for future expansion */
573 uint16_t slotid) /* slot identifier */
578 One of the following values:
580 * U_SUCCESS on success.
581 * U_PARAMETER if ``lpid`` is invalid.
582 * U_P2 if ``start_gpa`` is invalid.
583 * U_P3 if ``size`` is invalid.
584 * U_P4 if any bit in the ``flags`` is unrecognized.
585 * U_P5 if the ``slotid`` parameter is unsupported.
586 * U_PERMISSION if called from context other than Hypervisor.
587 * U_FUNCTION if functionality is not supported.
593 Register a memory range for an SVM. The memory range starts at the
594 guest physical address ``start_gpa`` and is ``size`` bytes long.
600 #. When a virtual machine goes secure, all the memory slots managed by
601 the Hypervisor move into secure memory. The Hypervisor iterates
602 through each of memory slots, and registers the slot with
603 Ultravisor. Hypervisor may discard some slots such as those used
606 #. When new memory is hot-plugged, a new memory slot gets registered.
609 UV_UNREGISTER_MEM_SLOT
610 ----------------------
612 Unregister an SVM address-range that was previously registered using
613 UV_REGISTER_MEM_SLOT.
620 uint64_t ultracall(const uint64_t UV_UNREGISTER_MEM_SLOT,
621 uint64_t lpid, /* LPAR ID of the SVM */
622 uint64_t slotid) /* reservation slotid */
627 One of the following values:
629 * U_SUCCESS on success.
630 * U_FUNCTION if functionality is not supported.
631 * U_PARAMETER if ``lpid`` is invalid.
632 * U_P2 if ``slotid`` is invalid.
633 * U_PERMISSION if called from context other than Hypervisor.
638 Release the memory slot identified by ``slotid`` and free any
639 resources allocated towards the reservation.
644 #. Memory hot-remove.
650 Terminate an SVM and release its resources.
657 uint64_t ultracall(const uint64_t UV_SVM_TERMINATE,
658 uint64_t lpid, /* LPAR ID of the SVM */)
663 One of the following values:
665 * U_SUCCESS on success.
666 * U_FUNCTION if functionality is not supported.
667 * U_PARAMETER if ``lpid`` is invalid.
668 * U_INVALID if VM is not secure.
669 * U_PERMISSION if not called from a Hypervisor context.
674 Terminate an SVM and release all its resources.
679 #. Called by Hypervisor when terminating an SVM.
682 Ultracalls used by SVM
683 ======================
688 Share a set of guest physical pages with the Hypervisor.
695 uint64_t ultracall(const uint64_t UV_SHARE_PAGE,
696 uint64_t gfn, /* guest page frame number */
697 uint64_t num) /* number of pages of size PAGE_SIZE */
702 One of the following values:
704 * U_SUCCESS on success.
705 * U_FUNCTION if functionality is not supported.
706 * U_INVALID if the VM is not secure.
707 * U_PARAMETER if ``gfn`` is invalid.
708 * U_P2 if ``num`` is invalid.
713 Share the ``num`` pages starting at guest physical frame number ``gfn``
714 with the Hypervisor. Assume page size is PAGE_SIZE bytes. Zero the
715 pages before returning.
717 If the address is already backed by a secure page, unmap the page and
718 back it with an insecure page, with the help of the Hypervisor. If it
719 is not backed by any page yet, mark the PTE as insecure and back it
720 with an insecure page when the address is accessed. If it is already
721 backed by an insecure page, zero the page and return.
726 #. The Hypervisor cannot access the SVM pages since they are backed by
727 secure pages. Hence an SVM must explicitly request Ultravisor for
728 pages it can share with Hypervisor.
730 #. Shared pages are needed to support virtio and Virtual Processor Area
737 Restore a shared SVM page to its initial state.
744 uint64_t ultracall(const uint64_t UV_UNSHARE_PAGE,
745 uint64_t gfn, /* guest page frame number */
746 uint73 num) /* number of pages of size PAGE_SIZE*/
751 One of the following values:
753 * U_SUCCESS on success.
754 * U_FUNCTION if functionality is not supported.
755 * U_INVALID if VM is not secure.
756 * U_PARAMETER if ``gfn`` is invalid.
757 * U_P2 if ``num`` is invalid.
762 Stop sharing ``num`` pages starting at ``gfn`` with the Hypervisor.
763 Assume that the page size is PAGE_SIZE. Zero the pages before
766 If the address is already backed by an insecure page, unmap the page
767 and back it with a secure page. Inform the Hypervisor to release
768 reference to its shared page. If the address is not backed by a page
769 yet, mark the PTE as secure and back it with a secure page when that
770 address is accessed. If it is already backed by an secure page zero
776 #. The SVM may decide to unshare a page from the Hypervisor.
782 Unshare all pages the SVM has shared with Hypervisor.
789 uint64_t ultracall(const uint64_t UV_UNSHARE_ALL_PAGES)
794 One of the following values:
796 * U_SUCCESS on success.
797 * U_FUNCTION if functionality is not supported.
798 * U_INVAL if VM is not secure.
803 Unshare all shared pages from the Hypervisor. All unshared pages are
804 zeroed on return. Only pages explicitly shared by the SVM with the
805 Hypervisor (using UV_SHARE_PAGE ultracall) are unshared. Ultravisor
806 may internally share some pages with the Hypervisor without explicit
807 request from the SVM. These pages will not be unshared by this
813 #. This call is needed when ``kexec`` is used to boot a different
814 kernel. It may also be needed during SVM reset.
819 Secure the virtual machine (*enter secure mode*).
826 uint64_t ultracall(const uint64_t UV_ESM,
827 uint64_t esm_blob_addr, /* location of the ESM blob */
828 unint64_t fdt) /* Flattened device tree */
833 One of the following values:
835 * U_SUCCESS on success (including if VM is already secure).
836 * U_FUNCTION if functionality is not supported.
837 * U_INVALID if VM is not secure.
838 * U_PARAMETER if ``esm_blob_addr`` is invalid.
839 * U_P2 if ``fdt`` is invalid.
840 * U_PERMISSION if any integrity checks fail.
841 * U_RETRY insufficient memory to create SVM.
842 * U_NO_KEY symmetric key unavailable.
847 Secure the virtual machine. On successful completion, return
848 control to the virtual machine at the address specified in the
854 #. A normal virtual machine can choose to switch to a secure mode.
859 This document describes the Hypervisor calls (hypercalls) that are
860 needed to support the Ultravisor. Hypercalls are services provided by
861 the Hypervisor to virtual machines and Ultravisor.
863 Register usage for these hypercalls is identical to that of the other
864 hypercalls defined in the Power Architecture Platform Reference (PAPR)
865 document. i.e on input, register R3 identifies the specific service
866 that is being requested and registers R4 through R11 contain
867 additional parameters to the hypercall, if any. On output, register
868 R3 contains the return value and registers R4 through R9 contain any
869 other output values from the hypercall.
871 This document only covers hypercalls currently implemented/planned
872 for Ultravisor usage but others can be added here when it makes sense.
874 The full specification for all hypercalls/ultracalls will eventually
875 be made available in the public/OpenPower version of the PAPR
878 Hypervisor calls to support Ultravisor
879 ======================================
881 Following are the set of hypercalls needed to support Ultravisor.
886 Begin the process of converting a normal virtual machine into an SVM.
893 uint64_t hypercall(const uint64_t H_SVM_INIT_START)
898 One of the following values:
900 * H_SUCCESS on success.
905 Initiate the process of securing a virtual machine. This involves
906 coordinating with the Ultravisor, using ultracalls, to allocate
907 resources in the Ultravisor for the new SVM, transferring the VM's
908 pages from normal to secure memory etc. When the process is
909 completed, Ultravisor issues the H_SVM_INIT_DONE hypercall.
914 #. Ultravisor uses this hypercall to inform Hypervisor that a VM
915 has initiated the process of switching to secure mode.
921 Complete the process of securing an SVM.
928 uint64_t hypercall(const uint64_t H_SVM_INIT_DONE)
933 One of the following values:
935 * H_SUCCESS on success.
936 * H_UNSUPPORTED if called from the wrong context (e.g.
937 from an SVM or before an H_SVM_INIT_START
943 Complete the process of securing a virtual machine. This call must
944 be made after a prior call to ``H_SVM_INIT_START`` hypercall.
949 On successfully securing a virtual machine, the Ultravisor informs
950 Hypervisor about it. Hypervisor can use this call to finish setting
951 up its internal state for this virtual machine.
957 Move the contents of a page from normal memory to secure memory.
964 uint64_t hypercall(const uint64_t H_SVM_PAGE_IN,
965 uint64_t guest_pa, /* guest-physical-address */
966 uint64_t flags, /* flags */
967 uint64_t order) /* page size order */
972 One of the following values:
974 * H_SUCCESS on success.
975 * H_PARAMETER if ``guest_pa`` is invalid.
976 * H_P2 if ``flags`` is invalid.
977 * H_P3 if ``order`` of page is invalid.
982 Retrieve the content of the page, belonging to the VM at the specified
983 guest physical address.
985 Only valid value(s) in ``flags`` are:
987 * H_PAGE_IN_SHARED which indicates that the page is to be shared
990 * H_PAGE_IN_NONSHARED indicates that the UV is not anymore
991 interested in the page. Applicable if the page is a shared page.
993 The ``order`` parameter must correspond to the configured page size.
998 #. When a normal VM becomes a secure VM (using the UV_ESM ultracall),
999 the Ultravisor uses this hypercall to move contents of each page of
1000 the VM from normal memory to secure memory.
1002 #. Ultravisor uses this hypercall to ask Hypervisor to provide a page
1003 in normal memory that can be shared between the SVM and Hypervisor.
1005 #. Ultravisor uses this hypercall to page-in a paged-out page. This
1006 can happen when the SVM touches a paged-out page.
1008 #. If SVM wants to disable sharing of pages with Hypervisor, it can
1009 inform Ultravisor to do so. Ultravisor will then use this hypercall
1010 and inform Hypervisor that it has released access to the normal
1016 Move the contents of the page to normal memory.
1023 uint64_t hypercall(const uint64_t H_SVM_PAGE_OUT,
1024 uint64_t guest_pa, /* guest-physical-address */
1025 uint64_t flags, /* flags (currently none) */
1026 uint64_t order) /* page size order */
1031 One of the following values:
1033 * H_SUCCESS on success.
1034 * H_PARAMETER if ``guest_pa`` is invalid.
1035 * H_P2 if ``flags`` is invalid.
1036 * H_P3 if ``order`` is invalid.
1041 Move the contents of the page identified by ``guest_pa`` to normal
1044 Currently ``flags`` is unused and must be set to 0. The ``order``
1045 parameter must correspond to the configured page size.
1050 #. If Ultravisor is running low on secure pages, it can move the
1051 contents of some secure pages, into normal pages using this
1052 hypercall. The content will be encrypted.
1057 .. [1] `Supporting Protected Computing on IBM Power Architecture <https://developer.ibm.com/articles/l-support-protected-computing/>`_