s390x/s390-virtio-hcall: remove hypercall registration mechanism

Nowadays, we only have a single machine type in QEMU, everything is based
on virtio-ccw and the traditional virtio machine does no longer exist. No
need to dynamically register diag500 handlers. Move the two existing
handlers into s390-virtio-hcall.c.

Message-ID: <20241219144115.2820241-3-david@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
David Hildenbrand 2024-12-19 15:41:03 +01:00
parent 14e568ab48
commit 4be0fce498
6 changed files with 61 additions and 80 deletions

View file

@ -51,6 +51,7 @@
#include "hw/s390x/s390-virtio-ccw.h"
#include "hw/s390x/s390-virtio-hcall.h"
#include "target/s390x/kvm/pv.h"
#include CONFIG_DEVICES
#define kvm_vm_check_mem_attr(s, attr) \
kvm_vm_check_attr(s, KVM_S390_VM_MEM_CTRL, attr)
@ -1494,9 +1495,11 @@ static int handle_e3(S390CPU *cpu, struct kvm_run *run, uint8_t ipbl)
static int handle_hypercall(S390CPU *cpu, struct kvm_run *run)
{
CPUS390XState *env = &cpu->env;
int ret;
int ret = -EINVAL;
#ifdef CONFIG_S390_CCW_VIRTIO
ret = s390_virtio_hypercall(env);
#endif /* CONFIG_S390_CCW_VIRTIO */
if (ret == -EINVAL) {
kvm_s390_program_interrupt(cpu, PGM_SPECIFICATION);
return 0;

View file

@ -43,6 +43,7 @@
#include "hw/s390x/s390-pci-inst.h"
#include "hw/boards.h"
#include "hw/s390x/tod.h"
#include CONFIG_DEVICES
#endif
/* #define DEBUG_HELPER */
@ -116,12 +117,14 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
uint64_t r;
switch (num) {
#ifdef CONFIG_S390_CCW_VIRTIO
case 0x500:
/* KVM hypercall */
bql_lock();
r = s390_virtio_hypercall(env);
bql_unlock();
break;
#endif /* CONFIG_S390_CCW_VIRTIO */
case 0x44:
/* yield */
r = 0;