1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Ultravisor Interfaces 4 * 5 * Copyright IBM Corp. 2019, 2024 6 * 7 * Author(s): 8 * Vasily Gorbik <gor@linux.ibm.com> 9 * Janosch Frank <frankja@linux.ibm.com> 10 */ 11 #ifndef _ASM_S390_UV_H 12 #define _ASM_S390_UV_H 13 14 #include <linux/types.h> 15 #include <linux/errno.h> 16 #include <linux/bug.h> 17 #include <linux/sched.h> 18 #include <asm/page.h> 19 #include <asm/asm.h> 20 21 #define UVC_CC_OK 0 22 #define UVC_CC_ERROR 1 23 #define UVC_CC_BUSY 2 24 #define UVC_CC_PARTIAL 3 25 26 #define UVC_RC_EXECUTED 0x0001 27 #define UVC_RC_INV_CMD 0x0002 28 #define UVC_RC_INV_STATE 0x0003 29 #define UVC_RC_INV_LEN 0x0005 30 #define UVC_RC_NO_RESUME 0x0007 31 #define UVC_RC_MORE_DATA 0x0100 32 #define UVC_RC_NEED_DESTROY 0x8000 33 34 #define UVC_CMD_QUI 0x0001 35 #define UVC_CMD_QUERY_KEYS 0x0002 36 #define UVC_CMD_INIT_UV 0x000f 37 #define UVC_CMD_CREATE_SEC_CONF 0x0100 38 #define UVC_CMD_DESTROY_SEC_CONF 0x0101 39 #define UVC_CMD_DESTROY_SEC_CONF_FAST 0x0102 40 #define UVC_CMD_CREATE_SEC_CPU 0x0120 41 #define UVC_CMD_DESTROY_SEC_CPU 0x0121 42 #define UVC_CMD_CONV_TO_SEC_STOR 0x0200 43 #define UVC_CMD_CONV_FROM_SEC_STOR 0x0201 44 #define UVC_CMD_DESTR_SEC_STOR 0x0202 45 #define UVC_CMD_SET_SEC_CONF_PARAMS 0x0300 46 #define UVC_CMD_UNPACK_IMG 0x0301 47 #define UVC_CMD_VERIFY_IMG 0x0302 48 #define UVC_CMD_CPU_RESET 0x0310 49 #define UVC_CMD_CPU_RESET_INITIAL 0x0311 50 #define UVC_CMD_PREPARE_RESET 0x0320 51 #define UVC_CMD_CPU_RESET_CLEAR 0x0321 52 #define UVC_CMD_CPU_SET_STATE 0x0330 53 #define UVC_CMD_SET_UNSHARE_ALL 0x0340 54 #define UVC_CMD_PIN_PAGE_SHARED 0x0341 55 #define UVC_CMD_UNPIN_PAGE_SHARED 0x0342 56 #define UVC_CMD_DUMP_INIT 0x0400 57 #define UVC_CMD_DUMP_CONF_STOR_STATE 0x0401 58 #define UVC_CMD_DUMP_CPU 0x0402 59 #define UVC_CMD_DUMP_COMPLETE 0x0403 60 #define UVC_CMD_SET_SHARED_ACCESS 0x1000 61 #define UVC_CMD_REMOVE_SHARED_ACCESS 0x1001 62 #define UVC_CMD_RETR_ATTEST 0x1020 63 #define UVC_CMD_ADD_SECRET 0x1031 64 #define UVC_CMD_LIST_SECRETS 0x1033 65 #define UVC_CMD_LOCK_SECRETS 0x1034 66 #define UVC_CMD_RETR_SECRET 0x1035 67 68 /* Bits in installed uv calls */ 69 enum uv_cmds_inst { 70 BIT_UVC_CMD_QUI = 0, 71 BIT_UVC_CMD_INIT_UV = 1, 72 BIT_UVC_CMD_CREATE_SEC_CONF = 2, 73 BIT_UVC_CMD_DESTROY_SEC_CONF = 3, 74 BIT_UVC_CMD_CREATE_SEC_CPU = 4, 75 BIT_UVC_CMD_DESTROY_SEC_CPU = 5, 76 BIT_UVC_CMD_CONV_TO_SEC_STOR = 6, 77 BIT_UVC_CMD_CONV_FROM_SEC_STOR = 7, 78 BIT_UVC_CMD_SET_SHARED_ACCESS = 8, 79 BIT_UVC_CMD_REMOVE_SHARED_ACCESS = 9, 80 BIT_UVC_CMD_SET_SEC_PARMS = 11, 81 BIT_UVC_CMD_UNPACK_IMG = 13, 82 BIT_UVC_CMD_VERIFY_IMG = 14, 83 BIT_UVC_CMD_CPU_RESET = 15, 84 BIT_UVC_CMD_CPU_RESET_INITIAL = 16, 85 BIT_UVC_CMD_CPU_SET_STATE = 17, 86 BIT_UVC_CMD_PREPARE_RESET = 18, 87 BIT_UVC_CMD_CPU_PERFORM_CLEAR_RESET = 19, 88 BIT_UVC_CMD_UNSHARE_ALL = 20, 89 BIT_UVC_CMD_PIN_PAGE_SHARED = 21, 90 BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22, 91 BIT_UVC_CMD_DESTROY_SEC_CONF_FAST = 23, 92 BIT_UVC_CMD_DUMP_INIT = 24, 93 BIT_UVC_CMD_DUMP_CONFIG_STOR_STATE = 25, 94 BIT_UVC_CMD_DUMP_CPU = 26, 95 BIT_UVC_CMD_DUMP_COMPLETE = 27, 96 BIT_UVC_CMD_RETR_ATTEST = 28, 97 BIT_UVC_CMD_ADD_SECRET = 29, 98 BIT_UVC_CMD_LIST_SECRETS = 30, 99 BIT_UVC_CMD_LOCK_SECRETS = 31, 100 BIT_UVC_CMD_RETR_SECRET = 33, 101 BIT_UVC_CMD_QUERY_KEYS = 34, 102 }; 103 104 enum uv_feat_ind { 105 BIT_UV_FEAT_MISC = 0, 106 BIT_UV_FEAT_AIV = 1, 107 BIT_UV_FEAT_AP = 4, 108 BIT_UV_FEAT_AP_INTR = 5, 109 }; 110 111 struct uv_cb_header { 112 u16 len; 113 u16 cmd; /* Command Code */ 114 u16 rc; /* Response Code */ 115 u16 rrc; /* Return Reason Code */ 116 } __packed __aligned(8); 117 118 /* Query Ultravisor Information */ 119 struct uv_cb_qui { 120 struct uv_cb_header header; /* 0x0000 */ 121 u64 reserved08; /* 0x0008 */ 122 u64 inst_calls_list[4]; /* 0x0010 */ 123 u64 reserved30[2]; /* 0x0030 */ 124 u64 uv_base_stor_len; /* 0x0040 */ 125 u64 reserved48; /* 0x0048 */ 126 u64 conf_base_phys_stor_len; /* 0x0050 */ 127 u64 conf_base_virt_stor_len; /* 0x0058 */ 128 u64 conf_virt_var_stor_len; /* 0x0060 */ 129 u64 cpu_stor_len; /* 0x0068 */ 130 u32 reserved70[3]; /* 0x0070 */ 131 u32 max_num_sec_conf; /* 0x007c */ 132 u64 max_guest_stor_addr; /* 0x0080 */ 133 u8 reserved88[0x9e - 0x88]; /* 0x0088 */ 134 u16 max_guest_cpu_id; /* 0x009e */ 135 u64 uv_feature_indications; /* 0x00a0 */ 136 u64 reserveda8; /* 0x00a8 */ 137 u64 supp_se_hdr_versions; /* 0x00b0 */ 138 u64 supp_se_hdr_pcf; /* 0x00b8 */ 139 u64 reservedc0; /* 0x00c0 */ 140 u64 conf_dump_storage_state_len; /* 0x00c8 */ 141 u64 conf_dump_finalize_len; /* 0x00d0 */ 142 u64 reservedd8; /* 0x00d8 */ 143 u64 supp_att_req_hdr_ver; /* 0x00e0 */ 144 u64 supp_att_pflags; /* 0x00e8 */ 145 u64 reservedf0; /* 0x00f0 */ 146 u64 supp_add_secret_req_ver; /* 0x00f8 */ 147 u64 supp_add_secret_pcf; /* 0x0100 */ 148 u64 supp_secret_types; /* 0x0108 */ 149 u16 max_assoc_secrets; /* 0x0110 */ 150 u16 max_retr_secrets; /* 0x0112 */ 151 u8 reserved114[0x120 - 0x114]; /* 0x0114 */ 152 } __packed __aligned(8); 153 154 struct uv_key_hash { 155 u64 dword[4]; 156 } __packed __aligned(8); 157 158 #define UVC_QUERY_KEYS_IDX_HK 0 159 #define UVC_QUERY_KEYS_IDX_BACK_HK 1 160 161 /* Query Ultravisor Keys */ 162 struct uv_cb_query_keys { 163 struct uv_cb_header header; /* 0x0000 */ 164 u64 reserved08[3]; /* 0x0008 */ 165 struct uv_key_hash key_hashes[15]; /* 0x0020 */ 166 } __packed __aligned(8); 167 static_assert(sizeof(struct uv_cb_query_keys) == 0x200); 168 169 /* Initialize Ultravisor */ 170 struct uv_cb_init { 171 struct uv_cb_header header; 172 u64 reserved08[2]; 173 u64 stor_origin; 174 u64 stor_len; 175 u64 reserved28[4]; 176 } __packed __aligned(8); 177 178 /* Create Guest Configuration */ 179 struct uv_cb_cgc { 180 struct uv_cb_header header; 181 u64 reserved08[2]; 182 u64 guest_handle; 183 u64 conf_base_stor_origin; 184 u64 conf_virt_stor_origin; 185 u8 reserved30[6]; 186 union { 187 struct { 188 u16 : 14; 189 u16 ap_instr_intr : 1; 190 u16 ap_allow_instr : 1; 191 }; 192 u16 raw; 193 } flags; 194 u64 guest_stor_origin; 195 u64 guest_stor_len; 196 u64 guest_sca; 197 u64 guest_asce; 198 u64 reserved58[5]; 199 } __packed __aligned(8); 200 201 /* Create Secure CPU */ 202 struct uv_cb_csc { 203 struct uv_cb_header header; 204 u64 reserved08[2]; 205 u64 cpu_handle; 206 u64 guest_handle; 207 u64 stor_origin; 208 u8 reserved30[6]; 209 u16 num; 210 u64 state_origin; 211 u64 reserved40[4]; 212 } __packed __aligned(8); 213 214 /* Convert to Secure */ 215 struct uv_cb_cts { 216 struct uv_cb_header header; 217 u64 reserved08[2]; 218 u64 guest_handle; 219 u64 gaddr; 220 } __packed __aligned(8); 221 222 /* Convert from Secure / Pin Page Shared */ 223 struct uv_cb_cfs { 224 struct uv_cb_header header; 225 u64 reserved08[2]; 226 u64 paddr; 227 } __packed __aligned(8); 228 229 /* Set Secure Config Parameter */ 230 struct uv_cb_ssc { 231 struct uv_cb_header header; 232 u64 reserved08[2]; 233 u64 guest_handle; 234 u64 sec_header_origin; 235 u32 sec_header_len; 236 u32 reserved2c; 237 u64 reserved30[4]; 238 } __packed __aligned(8); 239 240 /* Unpack */ 241 struct uv_cb_unp { 242 struct uv_cb_header header; 243 u64 reserved08[2]; 244 u64 guest_handle; 245 u64 gaddr; 246 u64 tweak[2]; 247 u64 reserved38[3]; 248 } __packed __aligned(8); 249 250 #define PV_CPU_STATE_OPR 1 251 #define PV_CPU_STATE_STP 2 252 #define PV_CPU_STATE_CHKSTP 3 253 #define PV_CPU_STATE_OPR_LOAD 5 254 255 struct uv_cb_cpu_set_state { 256 struct uv_cb_header header; 257 u64 reserved08[2]; 258 u64 cpu_handle; 259 u8 reserved20[7]; 260 u8 state; 261 u64 reserved28[5]; 262 }; 263 264 /* 265 * A common UV call struct for calls that take no payload 266 * Examples: 267 * Destroy cpu/config 268 * Verify 269 */ 270 struct uv_cb_nodata { 271 struct uv_cb_header header; 272 u64 reserved08[2]; 273 u64 handle; 274 u64 reserved20[4]; 275 } __packed __aligned(8); 276 277 /* Destroy Configuration Fast */ 278 struct uv_cb_destroy_fast { 279 struct uv_cb_header header; 280 u64 reserved08[2]; 281 u64 handle; 282 u64 reserved20[5]; 283 } __packed __aligned(8); 284 285 /* Set Shared Access */ 286 struct uv_cb_share { 287 struct uv_cb_header header; 288 u64 reserved08[3]; 289 u64 paddr; 290 u64 reserved28; 291 } __packed __aligned(8); 292 293 /* Retrieve Attestation Measurement */ 294 struct uv_cb_attest { 295 struct uv_cb_header header; /* 0x0000 */ 296 u64 reserved08[2]; /* 0x0008 */ 297 u64 arcb_addr; /* 0x0018 */ 298 u64 cont_token; /* 0x0020 */ 299 u8 reserved28[6]; /* 0x0028 */ 300 u16 user_data_len; /* 0x002e */ 301 u8 user_data[256]; /* 0x0030 */ 302 u32 reserved130[3]; /* 0x0130 */ 303 u32 meas_len; /* 0x013c */ 304 u64 meas_addr; /* 0x0140 */ 305 u8 config_uid[16]; /* 0x0148 */ 306 u32 reserved158; /* 0x0158 */ 307 u32 add_data_len; /* 0x015c */ 308 u64 add_data_addr; /* 0x0160 */ 309 u64 reserved168[4]; /* 0x0168 */ 310 } __packed __aligned(8); 311 312 struct uv_cb_dump_cpu { 313 struct uv_cb_header header; 314 u64 reserved08[2]; 315 u64 cpu_handle; 316 u64 dump_area_origin; 317 u64 reserved28[5]; 318 } __packed __aligned(8); 319 320 struct uv_cb_dump_stor_state { 321 struct uv_cb_header header; 322 u64 reserved08[2]; 323 u64 config_handle; 324 u64 dump_area_origin; 325 u64 gaddr; 326 u64 reserved28[4]; 327 } __packed __aligned(8); 328 329 struct uv_cb_dump_complete { 330 struct uv_cb_header header; 331 u64 reserved08[2]; 332 u64 config_handle; 333 u64 dump_area_origin; 334 u64 reserved30[5]; 335 } __packed __aligned(8); 336 337 /* 338 * A common UV call struct for pv guests that contains a single address 339 * Examples: 340 * Add Secret 341 */ 342 struct uv_cb_guest_addr { 343 struct uv_cb_header header; 344 u64 reserved08[3]; 345 u64 addr; 346 u64 reserved28[4]; 347 } __packed __aligned(8); 348 349 #define UVC_RC_RETR_SECR_BUF_SMALL 0x0109 350 #define UVC_RC_RETR_SECR_STORE_EMPTY 0x010f 351 #define UVC_RC_RETR_SECR_INV_IDX 0x0110 352 #define UVC_RC_RETR_SECR_INV_SECRET 0x0111 353 354 struct uv_cb_retr_secr { 355 struct uv_cb_header header; 356 u64 reserved08[2]; 357 u16 secret_idx; 358 u16 reserved1a; 359 u32 buf_size; 360 u64 buf_addr; 361 u64 reserved28[4]; 362 } __packed __aligned(8); 363 364 struct uv_cb_list_secrets { 365 struct uv_cb_header header; 366 u64 reserved08[2]; 367 u8 reserved18[6]; 368 u16 start_idx; 369 u64 list_addr; 370 u64 reserved28[4]; 371 } __packed __aligned(8); 372 373 enum uv_secret_types { 374 UV_SECRET_INVAL = 0x0, 375 UV_SECRET_NULL = 0x1, 376 UV_SECRET_ASSOCIATION = 0x2, 377 UV_SECRET_PLAIN = 0x3, 378 UV_SECRET_AES_128 = 0x4, 379 UV_SECRET_AES_192 = 0x5, 380 UV_SECRET_AES_256 = 0x6, 381 UV_SECRET_AES_XTS_128 = 0x7, 382 UV_SECRET_AES_XTS_256 = 0x8, 383 UV_SECRET_HMAC_SHA_256 = 0x9, 384 UV_SECRET_HMAC_SHA_512 = 0xa, 385 /* 0x0b - 0x10 reserved */ 386 UV_SECRET_ECDSA_P256 = 0x11, 387 UV_SECRET_ECDSA_P384 = 0x12, 388 UV_SECRET_ECDSA_P521 = 0x13, 389 UV_SECRET_ECDSA_ED25519 = 0x14, 390 UV_SECRET_ECDSA_ED448 = 0x15, 391 }; 392 393 /** 394 * uv_secret_list_item_hdr - UV secret metadata. 395 * @index: Index of the secret in the secret list. 396 * @type: Type of the secret. See `enum uv_secret_types`. 397 * @length: Length of the stored secret. 398 */ 399 struct uv_secret_list_item_hdr { 400 u16 index; 401 u16 type; 402 u32 length; 403 } __packed __aligned(8); 404 405 #define UV_SECRET_ID_LEN 32 406 /** 407 * uv_secret_list_item - UV secret entry. 408 * @hdr: The metadata of this secret. 409 * @id: The ID of this secret, not the secret itself. 410 */ 411 struct uv_secret_list_item { 412 struct uv_secret_list_item_hdr hdr; 413 u64 reserverd08; 414 u8 id[UV_SECRET_ID_LEN]; 415 } __packed __aligned(8); 416 417 /** 418 * uv_secret_list - UV secret-metadata list. 419 * @num_secr_stored: Number of secrets stored in this list. 420 * @total_num_secrets: Number of secrets stored in the UV for this guest. 421 * @next_secret_idx: positive number if there are more secrets available or zero. 422 * @secrets: Up to 85 UV-secret metadata entries. 423 */ 424 struct uv_secret_list { 425 u16 num_secr_stored; 426 u16 total_num_secrets; 427 u16 next_secret_idx; 428 u16 reserved_06; 429 u64 reserved_08; 430 struct uv_secret_list_item secrets[85]; 431 } __packed __aligned(8); 432 static_assert(sizeof(struct uv_secret_list) == PAGE_SIZE); 433 434 static inline int __uv_call(unsigned long r1, unsigned long r2) 435 { 436 int cc; 437 438 asm volatile( 439 " .insn rrf,0xb9a40000,%[r1],%[r2],0,0\n" 440 CC_IPM(cc) 441 : CC_OUT(cc, cc) 442 : [r1] "a" (r1), [r2] "a" (r2) 443 : CC_CLOBBER_LIST("memory")); 444 return CC_TRANSFORM(cc); 445 } 446 447 static inline int uv_call(unsigned long r1, unsigned long r2) 448 { 449 int cc; 450 451 do { 452 cc = __uv_call(r1, r2); 453 } while (cc > 1); 454 return cc; 455 } 456 457 /* 458 * special variant of uv_call that only transports the cpu or guest 459 * handle and the command, like destroy or verify. 460 */ 461 static inline int uv_cmd_nodata(u64 handle, u16 cmd, u16 *rc, u16 *rrc) 462 { 463 struct uv_cb_nodata uvcb = { 464 .header.cmd = cmd, 465 .header.len = sizeof(uvcb), 466 .handle = handle, 467 }; 468 int cc; 469 470 WARN(!handle, "No handle provided to Ultravisor call cmd %x\n", cmd); 471 cc = uv_call(0, (u64)&uvcb); 472 *rc = uvcb.header.rc; 473 *rrc = uvcb.header.rrc; 474 return cc ? -EINVAL : 0; 475 } 476 477 /** 478 * uv_list_secrets() - Do a List Secrets UVC. 479 * 480 * @buf: Buffer to write list into; size of one page. 481 * @start_idx: The smallest index that should be included in the list. 482 * For the fist invocation use 0. 483 * @rc: Pointer to store the return code or NULL. 484 * @rrc: Pointer to store the return reason code or NULL. 485 * 486 * This function calls the List Secrets UVC. The result is written into `buf`, 487 * that needs to be at least one page of writable memory. 488 * `buf` consists of: 489 * * %struct uv_secret_list_hdr 490 * * %struct uv_secret_list_item (multiple) 491 * 492 * For `start_idx` use _0_ for the first call. If there are more secrets available 493 * but could not fit into the page then `rc` is `UVC_RC_MORE_DATA`. 494 * In this case use `uv_secret_list_hdr.next_secret_idx` for `start_idx`. 495 * 496 * Context: might sleep. 497 * 498 * Return: The UVC condition code. 499 */ 500 static inline int uv_list_secrets(struct uv_secret_list *buf, u16 start_idx, 501 u16 *rc, u16 *rrc) 502 { 503 struct uv_cb_list_secrets uvcb = { 504 .header.len = sizeof(uvcb), 505 .header.cmd = UVC_CMD_LIST_SECRETS, 506 .start_idx = start_idx, 507 .list_addr = (u64)buf, 508 }; 509 int cc = uv_call(0, (u64)&uvcb); 510 511 if (rc) 512 *rc = uvcb.header.rc; 513 if (rrc) 514 *rrc = uvcb.header.rrc; 515 516 return cc; 517 } 518 519 struct uv_info { 520 unsigned long inst_calls_list[4]; 521 unsigned long uv_base_stor_len; 522 unsigned long guest_base_stor_len; 523 unsigned long guest_virt_base_stor_len; 524 unsigned long guest_virt_var_stor_len; 525 unsigned long guest_cpu_stor_len; 526 unsigned long max_sec_stor_addr; 527 unsigned int max_num_sec_conf; 528 unsigned short max_guest_cpu_id; 529 unsigned long uv_feature_indications; 530 unsigned long supp_se_hdr_ver; 531 unsigned long supp_se_hdr_pcf; 532 unsigned long conf_dump_storage_state_len; 533 unsigned long conf_dump_finalize_len; 534 unsigned long supp_att_req_hdr_ver; 535 unsigned long supp_att_pflags; 536 unsigned long supp_add_secret_req_ver; 537 unsigned long supp_add_secret_pcf; 538 unsigned long supp_secret_types; 539 unsigned short max_assoc_secrets; 540 unsigned short max_retr_secrets; 541 }; 542 543 extern struct uv_info uv_info; 544 545 static inline bool uv_has_feature(u8 feature_bit) 546 { 547 if (feature_bit >= sizeof(uv_info.uv_feature_indications) * 8) 548 return false; 549 return test_bit_inv(feature_bit, &uv_info.uv_feature_indications); 550 } 551 552 extern int prot_virt_guest; 553 554 static inline int is_prot_virt_guest(void) 555 { 556 return prot_virt_guest; 557 } 558 559 static inline int share(unsigned long addr, u16 cmd) 560 { 561 struct uv_cb_share uvcb = { 562 .header.cmd = cmd, 563 .header.len = sizeof(uvcb), 564 .paddr = addr 565 }; 566 567 if (!is_prot_virt_guest()) 568 return -EOPNOTSUPP; 569 /* 570 * Sharing is page wise, if we encounter addresses that are 571 * not page aligned, we assume something went wrong. If 572 * malloced structs are passed to this function, we could leak 573 * data to the hypervisor. 574 */ 575 BUG_ON(addr & ~PAGE_MASK); 576 577 if (!uv_call(0, (u64)&uvcb)) 578 return 0; 579 pr_err("%s UVC failed (rc: 0x%x, rrc: 0x%x), possible hypervisor bug.\n", 580 uvcb.header.cmd == UVC_CMD_SET_SHARED_ACCESS ? "Share" : "Unshare", 581 uvcb.header.rc, uvcb.header.rrc); 582 panic("System security cannot be guaranteed unless the system panics now.\n"); 583 } 584 585 /* 586 * Guest 2 request to the Ultravisor to make a page shared with the 587 * hypervisor for IO. 588 * 589 * @addr: Real or absolute address of the page to be shared 590 */ 591 static inline int uv_set_shared(unsigned long addr) 592 { 593 return share(addr, UVC_CMD_SET_SHARED_ACCESS); 594 } 595 596 /* 597 * Guest 2 request to the Ultravisor to make a page unshared. 598 * 599 * @addr: Real or absolute address of the page to be unshared 600 */ 601 static inline int uv_remove_shared(unsigned long addr) 602 { 603 return share(addr, UVC_CMD_REMOVE_SHARED_ACCESS); 604 } 605 606 int uv_find_secret(const u8 secret_id[UV_SECRET_ID_LEN], 607 struct uv_secret_list *list, 608 struct uv_secret_list_item_hdr *secret); 609 int uv_retrieve_secret(u16 secret_idx, u8 *buf, size_t buf_size); 610 611 extern int prot_virt_host; 612 613 static inline int is_prot_virt_host(void) 614 { 615 return prot_virt_host; 616 } 617 618 int uv_pin_shared(unsigned long paddr); 619 int uv_destroy_folio(struct folio *folio); 620 int uv_destroy_pte(pte_t pte); 621 int uv_convert_from_secure_pte(pte_t pte); 622 int s390_wiggle_split_folio(struct mm_struct *mm, struct folio *folio); 623 int __make_folio_secure(struct folio *folio, struct uv_cb_header *uvcb); 624 int uv_convert_from_secure(unsigned long paddr); 625 int uv_convert_from_secure_folio(struct folio *folio); 626 void *uv_alloc_stor_var(unsigned long size); 627 void uv_free_stor_var(void *stor_var); 628 629 void setup_uv(void); 630 631 #endif /* _ASM_S390_UV_H */ 632