@@ -281,6 +281,12 @@ void sie_expect_validity(struct vm *vm);
uint16_t sie_get_validity(struct vm *vm);
void sie_check_validity(struct vm *vm, uint16_t vir_exp);
void sie_handle_validity(struct vm *vm);
+
+static inline bool sie_is_pv(struct vm *vm)
+{
+ return vm->sblk->sdf == 2;
+}
+
void sie_guest_sca_create(struct vm *vm);
void sie_guest_create(struct vm *vm, uint64_t guest_mem, uint64_t guest_mem_len);
void sie_guest_destroy(struct vm *vm);
@@ -59,7 +59,7 @@ void sie(struct vm *vm)
/* When a pgm int code is set, we'll never enter SIE below. */
assert(!read_pgm_int_code());
- if (vm->sblk->sdf == 2)
+ if (sie_is_pv(vm))
memcpy(vm->sblk->pv_grregs, vm->save_area.guest.grs,
sizeof(vm->save_area.guest.grs));
@@ -98,7 +98,7 @@ void sie(struct vm *vm)
/* restore the old CR 13 */
lctlg(13, old_cr13);
- if (vm->sblk->sdf == 2)
+ if (sie_is_pv(vm))
memcpy(vm->save_area.guest.grs, vm->sblk->pv_grregs,
sizeof(vm->save_area.guest.grs));
}