Lines Matching +full:address +full:- +full:bits

1 /* SPDX-License-Identifier: GPL-2.0 */
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
24 * Returns the guest absolute address that corresponds to the passed guest real
25 * address @gra of by applying the given prefix.
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
41 * Returns the guest absolute address that corresponds to the passed guest real
42 * address @gra of a virtual guest cpu by applying its prefix.
51 * _kvm_s390_logical_to_effective - convert guest logical to effective address
53 * @ga: guest logical address
55 * Convert a guest logical address to an effective address by applying the
56 * rules of the addressing mode defined by bits 31 and 32 of the given PSW
59 * Depending on the addressing mode, the upper 40 bits (24 bit addressing
60 * mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing
61 * mode) of @ga will be zeroed and the remaining bits will be returned.
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
76 * @ga: guest logical address
78 * Convert a guest vcpu logical address to a guest vcpu effective address by
79 * applying the rules of the vcpu's addressing mode defined by PSW bits 31
82 * Depending on the vcpu's addressing mode the upper 40 bits (24 bit addressing
83 * mode), 33 bits (31 bit addressing mode) or no bits (64 bit addressing mode)
84 * of @ga will be zeroed and the remaining bits will be returned.
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
107 * @gra: vcpu's destination guest real address
113 * Returns zero on success or -EFAULT on error.
128 kvm_write_guest(__vcpu->kvm, __gpa, &__x, sizeof(__x)); \
132 * write_guest_lc - copy data from kernel space to guest vcpu's lowcore
134 * @gra: vcpu's source guest real address
135 * @data: source address in kernel space
141 * Returns zero on success or -EFAULT on error.
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
160 * @gra: vcpu's source guest real address
161 * @data: destination address in kernel space
167 * Returns zero on success or -EFAULT on error.
180 return kvm_read_guest(vcpu->kvm, gpa, data, len); in read_guest_lc()
213 * write_guest_with_key - copy data from kernel space to guest space
215 * @ga: guest address
217 * @data: source address in kernel space
221 * Copy @len bytes from @data (kernel space) to @ga (guest address).
224 * If DAT is on data will be copied to the address space as specified by
225 * the address space bits of the PSW:
227 * The addressing mode of the PSW is also inspected, so that address wrap
228 * around is taken into account for 24-, 31- and 64-bit addressing mode,
229 * if the to be copied data crosses page boundaries in guest address space.
230 * In addition low address, DAT and key protection checks are performed before
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
267 * write_guest - copy data from kernel space to guest space
269 * @ga: guest address
271 * @data: source address in kernel space
281 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in write_guest()
287 * read_guest_with_key - copy data from guest space to kernel space
289 * @ga: guest address
291 * @data: destination address in kernel space
295 * Copy @len bytes from @ga (guest address) to @data (kernel space).
309 * read_guest - copy data from guest space to kernel space
311 * @ga: guest address
313 * @data: destination address in kernel space
316 * Copy @len bytes from @ga (guest address) to @data (kernel space).
325 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in read_guest()
331 * read_guest_instr - copy instruction data from guest space to kernel space
333 * @ga: guest address
334 * @data: destination address in kernel space
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.
348 u8 access_key = psw_bits(vcpu->arch.sie_block->gpsw).key; in read_guest_instr()
355 * write_guest_abs - copy data from kernel space to guest space absolute
357 * @gpa: guest physical (absolute) address
358 * @data: source address in kernel space
361 * Copy @len bytes from @data (kernel space) to @gpa (guest absolute address).
364 * Guest low address and key protection are not checked.
366 * Returns zero on success or -EFAULT on error.
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
380 * @gpa: guest physical (absolute) address
381 * @data: destination address in kernel space
384 * Copy @len bytes from @gpa (guest absolute address) to @data (kernel space).
389 * Returns zero on success or -EFAULT on error.
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
403 * @gra: guest real address
404 * @data: source address in kernel space
407 * Copy @len bytes from @data (kernel space) to @gra (guest real address).
408 * Guest low address and key protection are not checked.
410 * Returns zero on success, -EFAULT when copying from @data failed, or
425 * read_guest_real - copy data from guest space real to kernel space
427 * @gra: guest real address
428 * @data: destination address in kernel space
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
453 /* MVPG PEI indication bits */