23 lines
551 B
C
Raw Normal View History

2026-01-21 18:59:54 +08:00
// SPDX-License-Identifier: GPL-2.0
/*
* ucall support. A ucall is a "hypercall to userspace".
*
* Copyright (C) 2019 Red Hat, Inc.
*/
#include "kvm_util.h"
2026-01-29 22:25:33 +08:00
void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
2026-01-21 18:59:54 +08:00
{
2026-01-29 22:25:33 +08:00
struct kvm_run *run = vcpu->run;
2026-01-21 18:59:54 +08:00
if (run->exit_reason == KVM_EXIT_S390_SIEIC &&
run->s390_sieic.icptcode == 4 &&
(run->s390_sieic.ipa >> 8) == 0x83 && /* 0x83 means DIAGNOSE */
(run->s390_sieic.ipb >> 16) == 0x501) {
int reg = run->s390_sieic.ipa & 0xf;
2026-01-29 22:25:33 +08:00
return (void *)run->s.regs.gprs[reg];
2026-01-21 18:59:54 +08:00
}
2026-01-29 22:25:33 +08:00
return NULL;
2026-01-21 18:59:54 +08:00
}