/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
s390
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/s390/include/asm
mkdir
upload
Name
Size
Mode
Actions
fpu/
-
0755
rm
trace/
-
0755
rm
vdso/
-
0755
rm
airq.h
3421
0644
edit
dl
rm
alternative-asm.h
3148
0644
edit
dl
rm
alternative.h
5742
0644
edit
dl
rm
ap.h
13098
0644
edit
dl
rm
appldata.h
1593
0644
edit
dl
rm
archrandom.h
1319
0644
edit
dl
rm
asm-const.h
376
0644
edit
dl
rm
asm-prototypes.h
227
0644
edit
dl
rm
atomic.h
4225
0644
edit
dl
rm
atomic_ops.h
5100
0644
edit
dl
rm
barrier.h
1881
0644
edit
dl
rm
bitops.h
10153
0644
edit
dl
rm
boot_data.h
481
0644
edit
dl
rm
bug.h
1562
0644
edit
dl
rm
bugs.h
441
0644
edit
dl
rm
cache.h
389
0644
edit
dl
rm
ccwdev.h
8506
0644
edit
dl
rm
ccwgroup.h
2301
0644
edit
dl
rm
checksum.h
3352
0644
edit
dl
rm
chpid.h
979
0644
edit
dl
rm
chsc.h
1384
0644
edit
dl
rm
cio.h
9083
0644
edit
dl
rm
clocksource.h
184
0644
edit
dl
rm
clp.h
1426
0644
edit
dl
rm
cmb.h
425
0644
edit
dl
rm
cmpxchg.h
5195
0644
edit
dl
rm
compat.h
5333
0644
edit
dl
rm
cpacf.h
17759
0644
edit
dl
rm
cpcmd.h
1135
0644
edit
dl
rm
cpu.h
549
0644
edit
dl
rm
cpufeature.h
958
0644
edit
dl
rm
cputime.h
840
0644
edit
dl
rm
cpu_mcf.h
3064
0644
edit
dl
rm
cpu_mf-insn.h
478
0644
edit
dl
rm
cpu_mf.h
9606
0644
edit
dl
rm
crw.h
1907
0644
edit
dl
rm
css_chars.h
904
0644
edit
dl
rm
ctl_reg.h
3715
0644
edit
dl
rm
current.h
405
0644
edit
dl
rm
debug.h
14318
0644
edit
dl
rm
delay.h
647
0644
edit
dl
rm
diag.h
7017
0644
edit
dl
rm
dis.h
636
0644
edit
dl
rm
dma.h
456
0644
edit
dl
rm
dwarf.h
952
0644
edit
dl
rm
eadm.h
2082
0644
edit
dl
rm
ebcdic.h
1442
0644
edit
dl
rm
elf.h
11210
0644
edit
dl
rm
entry-common.h
1590
0644
edit
dl
rm
exec.h
269
0644
edit
dl
rm
extable.h
2184
0644
edit
dl
rm
extmem.h
804
0644
edit
dl
rm
facility.h
2760
0644
edit
dl
rm
fcx.h
8102
0644
edit
dl
rm
ftrace.h
1875
0644
edit
dl
rm
ftrace.lds.h
720
0644
edit
dl
rm
futex.h
1927
0644
edit
dl
rm
gmap.h
5760
0644
edit
dl
rm
hardirq.h
777
0644
edit
dl
rm
hugetlb.h
2966
0644
edit
dl
rm
hw_irq.h
210
0644
edit
dl
rm
idals.h
5317
0644
edit
dl
rm
idle.h
753
0644
edit
dl
rm
io.h
2153
0644
edit
dl
rm
ipl.h
3708
0644
edit
dl
rm
irq.h
2635
0644
edit
dl
rm
irqflags.h
1810
0644
edit
dl
rm
irq_work.h
204
0644
edit
dl
rm
isc.h
1036
0644
edit
dl
rm
itcw.h
950
0644
edit
dl
rm
jump_label.h
1411
0644
edit
dl
rm
kasan.h
1772
0644
edit
dl
rm
Kbuild
253
0644
edit
dl
rm
kdebug.h
386
0644
edit
dl
rm
kexec.h
2620
0644
edit
dl
rm
kfence.h
1148
0644
edit
dl
rm
kprobes.h
2175
0644
edit
dl
rm
kvm_host.h
27155
0644
edit
dl
rm
kvm_para.h
3761
0644
edit
dl
rm
linkage.h
729
0644
edit
dl
rm
livepatch.h
474
0644
edit
dl
rm
lowcore.h
6595
0644
edit
dl
rm
mem_detect.h
2589
0644
edit
dl
rm
mem_encrypt.h
365
0644
edit
dl
rm
mmu.h
1515
0644
edit
dl
rm
mmu_context.h
3491
0644
edit
dl
rm
mmzone.h
316
0644
edit
dl
rm
module.h
1209
0644
edit
dl
rm
nmi.h
3698
0644
edit
dl
rm
nospec-branch.h
342
0644
edit
dl
rm
nospec-insn.h
3616
0644
edit
dl
rm
numa.h
386
0644
edit
dl
rm
os_info.h
1136
0644
edit
dl
rm
page-states.h
486
0644
edit
dl
rm
page.h
5194
0644
edit
dl
rm
pci.h
8691
0644
edit
dl
rm
pci_clp.h
5346
0644
edit
dl
rm
pci_debug.h
608
0644
edit
dl
rm
pci_dma.h
5541
0644
edit
dl
rm
pci_insn.h
4089
0644
edit
dl
rm
pci_io.h
4405
0644
edit
dl
rm
percpu.h
6638
0644
edit
dl
rm
perf_event.h
3245
0644
edit
dl
rm
pgalloc.h
4024
0644
edit
dl
rm
pgtable.h
51845
0644
edit
dl
rm
pkey.h
737
0644
edit
dl
rm
pnet.h
325
0644
edit
dl
rm
preempt.h
3218
0644
edit
dl
rm
processor.h
9637
0644
edit
dl
rm
ptdump.h
255
0644
edit
dl
rm
ptrace.h
5865
0644
edit
dl
rm
purgatory.h
329
0644
edit
dl
rm
qdio.h
10011
0644
edit
dl
rm
runtime_instr.h
634
0644
edit
dl
rm
schid.h
525
0644
edit
dl
rm
sclp.h
4332
0644
edit
dl
rm
scsw.h
24630
0644
edit
dl
rm
seccomp.h
808
0644
edit
dl
rm
sections.h
1357
0644
edit
dl
rm
serial.h
147
0644
edit
dl
rm
setup.h
5156
0644
edit
dl
rm
set_memory.h
989
0644
edit
dl
rm
shmparam.h
285
0644
edit
dl
rm
signal.h
644
0644
edit
dl
rm
sigp.h
1900
0644
edit
dl
rm
smp.h
1932
0644
edit
dl
rm
softirq_stack.h
329
0644
edit
dl
rm
sparsemem.h
214
0644
edit
dl
rm
spinlock.h
3525
0644
edit
dl
rm
spinlock_types.h
407
0644
edit
dl
rm
stacktrace.h
6168
0644
edit
dl
rm
stp.h
1706
0644
edit
dl
rm
string.h
5847
0644
edit
dl
rm
switch_to.h
1400
0644
edit
dl
rm
syscall.h
4148
0644
edit
dl
rm
syscall_wrapper.h
5506
0644
edit
dl
rm
sysinfo.h
4339
0644
edit
dl
rm
termios.h
685
0644
edit
dl
rm
thread_info.h
3605
0644
edit
dl
rm
timex.h
6538
0644
edit
dl
rm
tlb.h
4296
0644
edit
dl
rm
tlbflush.h
3233
0644
edit
dl
rm
topology.h
2876
0644
edit
dl
rm
tpi.h
736
0644
edit
dl
rm
types.h
318
0644
edit
dl
rm
uaccess.h
10049
0644
edit
dl
rm
unistd.h
1030
0644
edit
dl
rm
unwind.h
3360
0644
edit
dl
rm
uprobes.h
588
0644
edit
dl
rm
user.h
3384
0644
edit
dl
rm
uv.h
10977
0644
edit
dl
rm
vdso.h
746
0644
edit
dl
rm
vga.h
170
0644
edit
dl
rm
vmalloc.h
90
0644
edit
dl
rm
vmlinux.lds.h
1167
0644
edit
dl
rm
vtime.h
718
0644
edit
dl
rm
vtimer.h
830
0644
edit
dl
rm
vx-insn.h
13477
0644
edit
dl
rm
xor.h
454
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/s390/include/asm/uv.h
(10977B)
/* SPDX-License-Identifier: GPL-2.0 */ /* * Ultravisor Interfaces * * Copyright IBM Corp. 2019, 2022 * * Author(s): * Vasily Gorbik <gor@linux.ibm.com> * Janosch Frank <frankja@linux.ibm.com> */ #ifndef _ASM_S390_UV_H #define _ASM_S390_UV_H #include <linux/types.h> #include <linux/errno.h> #include <linux/bug.h> #include <linux/sched.h> #include <asm/page.h> #include <asm/gmap.h> #define UVC_CC_OK 0 #define UVC_CC_ERROR 1 #define UVC_CC_BUSY 2 #define UVC_CC_PARTIAL 3 #define UVC_RC_EXECUTED 0x0001 #define UVC_RC_INV_CMD 0x0002 #define UVC_RC_INV_STATE 0x0003 #define UVC_RC_INV_LEN 0x0005 #define UVC_RC_NO_RESUME 0x0007 #define UVC_RC_NEED_DESTROY 0x8000 #define UVC_CMD_QUI 0x0001 #define UVC_CMD_INIT_UV 0x000f #define UVC_CMD_CREATE_SEC_CONF 0x0100 #define UVC_CMD_DESTROY_SEC_CONF 0x0101 #define UVC_CMD_CREATE_SEC_CPU 0x0120 #define UVC_CMD_DESTROY_SEC_CPU 0x0121 #define UVC_CMD_CONV_TO_SEC_STOR 0x0200 #define UVC_CMD_CONV_FROM_SEC_STOR 0x0201 #define UVC_CMD_DESTR_SEC_STOR 0x0202 #define UVC_CMD_SET_SEC_CONF_PARAMS 0x0300 #define UVC_CMD_UNPACK_IMG 0x0301 #define UVC_CMD_VERIFY_IMG 0x0302 #define UVC_CMD_CPU_RESET 0x0310 #define UVC_CMD_CPU_RESET_INITIAL 0x0311 #define UVC_CMD_PREPARE_RESET 0x0320 #define UVC_CMD_CPU_RESET_CLEAR 0x0321 #define UVC_CMD_CPU_SET_STATE 0x0330 #define UVC_CMD_SET_UNSHARE_ALL 0x0340 #define UVC_CMD_PIN_PAGE_SHARED 0x0341 #define UVC_CMD_UNPIN_PAGE_SHARED 0x0342 #define UVC_CMD_DUMP_INIT 0x0400 #define UVC_CMD_DUMP_CONF_STOR_STATE 0x0401 #define UVC_CMD_DUMP_CPU 0x0402 #define UVC_CMD_DUMP_COMPLETE 0x0403 #define UVC_CMD_SET_SHARED_ACCESS 0x1000 #define UVC_CMD_REMOVE_SHARED_ACCESS 0x1001 #define UVC_CMD_RETR_ATTEST 0x1020 /* Bits in installed uv calls */ enum uv_cmds_inst { BIT_UVC_CMD_QUI = 0, BIT_UVC_CMD_INIT_UV = 1, BIT_UVC_CMD_CREATE_SEC_CONF = 2, BIT_UVC_CMD_DESTROY_SEC_CONF = 3, BIT_UVC_CMD_CREATE_SEC_CPU = 4, BIT_UVC_CMD_DESTROY_SEC_CPU = 5, BIT_UVC_CMD_CONV_TO_SEC_STOR = 6, BIT_UVC_CMD_CONV_FROM_SEC_STOR = 7, BIT_UVC_CMD_SET_SHARED_ACCESS = 8, BIT_UVC_CMD_REMOVE_SHARED_ACCESS = 9, BIT_UVC_CMD_SET_SEC_PARMS = 11, BIT_UVC_CMD_UNPACK_IMG = 13, BIT_UVC_CMD_VERIFY_IMG = 14, BIT_UVC_CMD_CPU_RESET = 15, BIT_UVC_CMD_CPU_RESET_INITIAL = 16, BIT_UVC_CMD_CPU_SET_STATE = 17, BIT_UVC_CMD_PREPARE_RESET = 18, BIT_UVC_CMD_CPU_PERFORM_CLEAR_RESET = 19, BIT_UVC_CMD_UNSHARE_ALL = 20, BIT_UVC_CMD_PIN_PAGE_SHARED = 21, BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22, BIT_UVC_CMD_DUMP_INIT = 24, BIT_UVC_CMD_DUMP_CONFIG_STOR_STATE = 25, BIT_UVC_CMD_DUMP_CPU = 26, BIT_UVC_CMD_DUMP_COMPLETE = 27, BIT_UVC_CMD_RETR_ATTEST = 28, }; enum uv_feat_ind { BIT_UV_FEAT_MISC = 0, BIT_UV_FEAT_AIV = 1, }; struct uv_cb_header { u16 len; u16 cmd; /* Command Code */ u16 rc; /* Response Code */ u16 rrc; /* Return Reason Code */ } __packed __aligned(8); /* Query Ultravisor Information */ struct uv_cb_qui { struct uv_cb_header header; /* 0x0000 */ u64 reserved08; /* 0x0008 */ u64 inst_calls_list[4]; /* 0x0010 */ u64 reserved30[2]; /* 0x0030 */ u64 uv_base_stor_len; /* 0x0040 */ u64 reserved48; /* 0x0048 */ u64 conf_base_phys_stor_len; /* 0x0050 */ u64 conf_base_virt_stor_len; /* 0x0058 */ u64 conf_virt_var_stor_len; /* 0x0060 */ u64 cpu_stor_len; /* 0x0068 */ u32 reserved70[3]; /* 0x0070 */ u32 max_num_sec_conf; /* 0x007c */ u64 max_guest_stor_addr; /* 0x0080 */ u8 reserved88[158 - 136]; /* 0x0088 */ u16 max_guest_cpu_id; /* 0x009e */ u64 uv_feature_indications; /* 0x00a0 */ u64 reserveda8; /* 0x00a8 */ u64 supp_se_hdr_versions; /* 0x00b0 */ u64 supp_se_hdr_pcf; /* 0x00b8 */ u64 reservedc0; /* 0x00c0 */ u64 conf_dump_storage_state_len; /* 0x00c8 */ u64 conf_dump_finalize_len; /* 0x00d0 */ u8 reservedd8[256 - 216]; /* 0x00d8 */ } __packed __aligned(8); /* Initialize Ultravisor */ struct uv_cb_init { struct uv_cb_header header; u64 reserved08[2]; u64 stor_origin; u64 stor_len; u64 reserved28[4]; } __packed __aligned(8); /* Create Guest Configuration */ struct uv_cb_cgc { struct uv_cb_header header; u64 reserved08[2]; u64 guest_handle; u64 conf_base_stor_origin; u64 conf_virt_stor_origin; u64 reserved30; u64 guest_stor_origin; u64 guest_stor_len; u64 guest_sca; u64 guest_asce; u64 reserved58[5]; } __packed __aligned(8); /* Create Secure CPU */ struct uv_cb_csc { struct uv_cb_header header; u64 reserved08[2]; u64 cpu_handle; u64 guest_handle; u64 stor_origin; u8 reserved30[6]; u16 num; u64 state_origin; u64 reserved40[4]; } __packed __aligned(8); /* Convert to Secure */ struct uv_cb_cts { struct uv_cb_header header; u64 reserved08[2]; u64 guest_handle; u64 gaddr; } __packed __aligned(8); /* Convert from Secure / Pin Page Shared */ struct uv_cb_cfs { struct uv_cb_header header; u64 reserved08[2]; u64 paddr; } __packed __aligned(8); /* Set Secure Config Parameter */ struct uv_cb_ssc { struct uv_cb_header header; u64 reserved08[2]; u64 guest_handle; u64 sec_header_origin; u32 sec_header_len; u32 reserved2c; u64 reserved30[4]; } __packed __aligned(8); /* Unpack */ struct uv_cb_unp { struct uv_cb_header header; u64 reserved08[2]; u64 guest_handle; u64 gaddr; u64 tweak[2]; u64 reserved38[3]; } __packed __aligned(8); #define PV_CPU_STATE_OPR 1 #define PV_CPU_STATE_STP 2 #define PV_CPU_STATE_CHKSTP 3 #define PV_CPU_STATE_OPR_LOAD 5 struct uv_cb_cpu_set_state { struct uv_cb_header header; u64 reserved08[2]; u64 cpu_handle; u8 reserved20[7]; u8 state; u64 reserved28[5]; }; /* * A common UV call struct for calls that take no payload * Examples: * Destroy cpu/config * Verify */ struct uv_cb_nodata { struct uv_cb_header header; u64 reserved08[2]; u64 handle; u64 reserved20[4]; } __packed __aligned(8); /* Set Shared Access */ struct uv_cb_share { struct uv_cb_header header; u64 reserved08[3]; u64 paddr; u64 reserved28; } __packed __aligned(8); /* Retrieve Attestation Measurement */ struct uv_cb_attest { struct uv_cb_header header; /* 0x0000 */ u64 reserved08[2]; /* 0x0008 */ u64 arcb_addr; /* 0x0018 */ u64 cont_token; /* 0x0020 */ u8 reserved28[6]; /* 0x0028 */ u16 user_data_len; /* 0x002e */ u8 user_data[256]; /* 0x0030 */ u32 reserved130[3]; /* 0x0130 */ u32 meas_len; /* 0x013c */ u64 meas_addr; /* 0x0140 */ u8 config_uid[16]; /* 0x0148 */ u32 reserved158; /* 0x0158 */ u32 add_data_len; /* 0x015c */ u64 add_data_addr; /* 0x0160 */ u64 reserved168[4]; /* 0x0168 */ } __packed __aligned(8); struct uv_cb_dump_cpu { struct uv_cb_header header; u64 reserved08[2]; u64 cpu_handle; u64 dump_area_origin; u64 reserved28[5]; } __packed __aligned(8); struct uv_cb_dump_stor_state { struct uv_cb_header header; u64 reserved08[2]; u64 config_handle; u64 dump_area_origin; u64 gaddr; u64 reserved28[4]; } __packed __aligned(8); struct uv_cb_dump_complete { struct uv_cb_header header; u64 reserved08[2]; u64 config_handle; u64 dump_area_origin; u64 reserved30[5]; } __packed __aligned(8); static inline int __uv_call(unsigned long r1, unsigned long r2) { int cc; asm volatile( " .insn rrf,0xB9A40000,%[r1],%[r2],0,0\n" " ipm %[cc]\n" " srl %[cc],28\n" : [cc] "=d" (cc) : [r1] "a" (r1), [r2] "a" (r2) : "memory", "cc"); return cc; } static inline int uv_call(unsigned long r1, unsigned long r2) { int cc; do { cc = __uv_call(r1, r2); } while (cc > 1); return cc; } /* Low level uv_call that avoids stalls for long running busy conditions */ static inline int uv_call_sched(unsigned long r1, unsigned long r2) { int cc; do { cc = __uv_call(r1, r2); cond_resched(); } while (cc > 1); return cc; } /* * special variant of uv_call that only transports the cpu or guest * handle and the command, like destroy or verify. */ static inline int uv_cmd_nodata(u64 handle, u16 cmd, u16 *rc, u16 *rrc) { struct uv_cb_nodata uvcb = { .header.cmd = cmd, .header.len = sizeof(uvcb), .handle = handle, }; int cc; WARN(!handle, "No handle provided to Ultravisor call cmd %x\n", cmd); cc = uv_call_sched(0, (u64)&uvcb); *rc = uvcb.header.rc; *rrc = uvcb.header.rrc; return cc ? -EINVAL : 0; } struct uv_info { unsigned long inst_calls_list[4]; unsigned long uv_base_stor_len; unsigned long guest_base_stor_len; unsigned long guest_virt_base_stor_len; unsigned long guest_virt_var_stor_len; unsigned long guest_cpu_stor_len; unsigned long max_sec_stor_addr; unsigned int max_num_sec_conf; unsigned short max_guest_cpu_id; unsigned long uv_feature_indications; unsigned long supp_se_hdr_ver; unsigned long supp_se_hdr_pcf; unsigned long conf_dump_storage_state_len; unsigned long conf_dump_finalize_len; }; extern struct uv_info uv_info; #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST extern int prot_virt_guest; static inline int is_prot_virt_guest(void) { return prot_virt_guest; } static inline int share(unsigned long addr, u16 cmd) { struct uv_cb_share uvcb = { .header.cmd = cmd, .header.len = sizeof(uvcb), .paddr = addr }; if (!is_prot_virt_guest()) return -EOPNOTSUPP; /* * Sharing is page wise, if we encounter addresses that are * not page aligned, we assume something went wrong. If * malloced structs are passed to this function, we could leak * data to the hypervisor. */ BUG_ON(addr & ~PAGE_MASK); if (!uv_call(0, (u64)&uvcb)) return 0; pr_err("%s UVC failed (rc: 0x%x, rrc: 0x%x), possible hypervisor bug.\n", uvcb.header.cmd == UVC_CMD_SET_SHARED_ACCESS ? "Share" : "Unshare", uvcb.header.rc, uvcb.header.rrc); panic("System security cannot be guaranteed unless the system panics now.\n"); } /* * Guest 2 request to the Ultravisor to make a page shared with the * hypervisor for IO. * * @addr: Real or absolute address of the page to be shared */ static inline int uv_set_shared(unsigned long addr) { return share(addr, UVC_CMD_SET_SHARED_ACCESS); } /* * Guest 2 request to the Ultravisor to make a page unshared. * * @addr: Real or absolute address of the page to be unshared */ static inline int uv_remove_shared(unsigned long addr) { return share(addr, UVC_CMD_REMOVE_SHARED_ACCESS); } #else #define is_prot_virt_guest() 0 static inline int uv_set_shared(unsigned long addr) { return 0; } static inline int uv_remove_shared(unsigned long addr) { return 0; } #endif #if IS_ENABLED(CONFIG_KVM) extern int prot_virt_host; static inline int is_prot_virt_host(void) { return prot_virt_host; } int gmap_make_secure(struct gmap *gmap, unsigned long gaddr, void *uvcb); int uv_destroy_page(unsigned long paddr); int uv_convert_from_secure(unsigned long paddr); int gmap_convert_to_secure(struct gmap *gmap, unsigned long gaddr); void setup_uv(void); #else #define is_prot_virt_host() 0 static inline void setup_uv(void) {} static inline int uv_destroy_page(unsigned long paddr) { return 0; } static inline int uv_convert_from_secure(unsigned long paddr) { return 0; } #endif #endif /* _ASM_S390_UV_H */
Save
cmd:
run