Lines Matching +full:len +full:- +full:or +full:- +full:define

1 /* SPDX-License-Identifier: GPL-2.0 */
11 #define __KVM_S390_GACCESS_H
17 #include "kvm-s390.h"
20 * kvm_s390_real_to_abs - convert guest real address to guest absolute address
21 * @prefix - guest prefix
22 * @gra - guest real address
32 gra -= prefix; in _kvm_s390_real_to_abs()
37 * kvm_s390_real_to_abs - convert guest real address to guest absolute address
38 * @vcpu - guest virtual cpu
39 * @gra - guest real address
51 * _kvm_s390_logical_to_effective - convert guest logical to effective address
60 * mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing
69 return ga & ((1UL << 31) - 1); in _kvm_s390_logical_to_effective()
70 return ga & ((1UL << 24) - 1); in _kvm_s390_logical_to_effective()
74 * kvm_s390_logical_to_effective - convert guest logical to effective address
83 * mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing mode)
89 return _kvm_s390_logical_to_effective(&vcpu->arch.sie_block->gpsw, ga); in kvm_s390_logical_to_effective()
96 * guest memory access protection facilities, like key or low address
104 * put_guest_lc - write a simple variable to a guest vcpu's lowcore
110 * The size of the variable may be 1, 2, 4 or 8 bytes. The destination
113 * Returns zero on success or -EFAULT on error.
115 * Note: an error indicates that either the kernel is out of memory or
120 #define put_guest_lc(vcpu, x, gra) \
128 kvm_write_guest(__vcpu->kvm, __gpa, &__x, sizeof(__x)); \
132 * write_guest_lc - copy data from kernel space to guest vcpu's lowcore
136 * @len: number of bytes to copy
141 * Returns zero on success or -EFAULT on error.
143 * Note: an error indicates that either the kernel is out of memory or
150 unsigned long len) in write_guest_lc() argument
154 return kvm_write_guest(vcpu->kvm, gpa, data, len); in write_guest_lc()
158 * read_guest_lc - copy data from guest vcpu's lowcore to kernel space
162 * @len: number of bytes to copy
167 * Returns zero on success or -EFAULT on error.
169 * Note: an error indicates that either the kernel is out of memory or
176 unsigned long len) in read_guest_lc() argument
180 return kvm_read_guest(vcpu->kvm, gpa, data, len); in read_guest_lc()
200 unsigned long len, enum gacc_mode mode, u8 access_key);
203 void *data, unsigned long len, enum gacc_mode mode,
207 void *data, unsigned long len, enum gacc_mode mode);
209 int cmpxchg_guest_abs_with_key(struct kvm *kvm, gpa_t gpa, int len, __uint128_t *old,
213 * write_guest_with_key - copy data from kernel space to guest space
218 * @len: number of bytes to copy
221 * Copy @len bytes from @data (kernel space) to @ga (guest address).
223 * If DAT is off data will be copied to guest real or absolute memory.
226 * Primary, secondary, home space or access register mode.
228 * around is taken into account for 24-, 31- and 64-bit addressing mode,
240 * Returns: - zero on success
241 * - a negative value if e.g. the guest mapping is broken or in
242 * case of out-of-memory. In this case the contents of pgm are
245 * - a positive value if an access exception happened. In this case
252 * one or more page boundaries in guest space).
260 void *data, unsigned long len, u8 access_key) in write_guest_with_key() argument
262 return access_guest_with_key(vcpu, ga, ar, data, len, GACC_STORE, in write_guest_with_key()
267 * write_guest - copy data from kernel space to guest space
272 * @len: number of bytes to copy
279 unsigned long len) in write_guest() argument
281 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in write_guest()
283 return write_guest_with_key(vcpu, ga, ar, data, len, access_key); in write_guest()
287 * read_guest_with_key - copy data from guest space to kernel space
292 * @len: number of bytes to copy
295 * Copy @len bytes from @ga (guest address) to @data (kernel space).
302 void *data, unsigned long len, u8 access_key) in read_guest_with_key() argument
304 return access_guest_with_key(vcpu, ga, ar, data, len, GACC_FETCH, in read_guest_with_key()
309 * read_guest - copy data from guest space to kernel space
314 * @len: number of bytes to copy
316 * Copy @len bytes from @ga (guest address) to @data (kernel space).
323 unsigned long len) in read_guest() argument
325 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in read_guest()
327 return read_guest_with_key(vcpu, ga, ar, data, len, access_key); in read_guest()
331 * read_guest_instr - copy instruction data from guest space to kernel space
335 * @len: number of bytes to copy
337 * Copy @len bytes from the given address (guest space) to @data (kernel
341 * instruction data will be read from primary space when in home-space or
342 * address-space mode.
346 unsigned long len) in read_guest_instr() argument
348 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in read_guest_instr()
350 return access_guest_with_key(vcpu, ga, 0, data, len, GACC_IFETCH, in read_guest_instr()
355 * write_guest_abs - copy data from kernel space to guest space absolute
359 * @len: number of bytes to copy
361 * Copy @len bytes from @data (kernel space) to @gpa (guest absolute address).
366 * Returns zero on success or -EFAULT on error.
372 unsigned long len) in write_guest_abs() argument
374 return kvm_write_guest(vcpu->kvm, gpa, data, len); in write_guest_abs()
378 * read_guest_abs - copy data from guest space absolute to kernel space
382 * @len: number of bytes to copy
384 * Copy @len bytes from @gpa (guest absolute address) to @data (kernel space).
389 * Returns zero on success or -EFAULT on error.
395 unsigned long len) in read_guest_abs() argument
397 return kvm_read_guest(vcpu->kvm, gpa, data, len); in read_guest_abs()
401 * write_guest_real - copy data from kernel space to guest space real
405 * @len: number of bytes to copy
407 * Copy @len bytes from @data (kernel space) to @gra (guest real address).
410 * Returns zero on success, -EFAULT when copying from @data failed, or
419 unsigned long len) in write_guest_real() argument
421 return access_guest_real(vcpu, gra, data, len, 1); in write_guest_real()
425 * read_guest_real - copy data from guest space real to kernel space
429 * @len: number of bytes to copy
431 * Copy @len bytes from @gra (guest real address) to @data (kernel space).
434 * Returns zero on success, -EFAULT when copying to @data failed, or
443 unsigned long len) in read_guest_real() argument
445 return access_guest_real(vcpu, gra, data, len, 0); in read_guest_real()
454 #define PEI_DAT_PROT 2
455 #define PEI_NOT_PTE 4