2 * This file contains the s390 specific implementation for the
3 * architecture dependent functions defined in kvm-common.h and
6 * Copyright (C) 2006 Qumranet
7 * Copyright IBM Corp. 2008
10 * Carsten Otte <cotte@de.ibm.com>
11 * Christian Borntraeger <borntraeger@de.ibm.com>
13 * This work is licensed under the GNU LGPL license, version 2.
16 #include <sys/ioctl.h>
17 #include <asm/ptrace.h>
20 #include "kvm-common.h"
25 int kvm_alloc_kernel_memory(kvm_context_t kvm
, unsigned long memory
,
28 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
32 void *kvm_create_kernel_phys_mem(kvm_context_t kvm
, unsigned long phys_start
,
33 unsigned long len
, int log
, int writable
)
35 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
39 void kvm_show_code(kvm_context_t kvm
, int vcpu
)
41 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
44 void kvm_show_regs(kvm_context_t kvm
, int vcpu
)
47 struct kvm_sregs sregs
;
50 if (kvm_get_regs(kvm
, vcpu
, ®s
))
53 if (kvm_get_sregs(kvm
, vcpu
, &sregs
))
56 fprintf(stderr
, "guest vcpu #%d\n", vcpu
);
57 fprintf(stderr
, "PSW:\t%16.16lx %16.16lx\n",
58 kvm
->run
[vcpu
]->s390_sieic
.mask
,
59 kvm
->run
[vcpu
]->s390_sieic
.addr
);
60 fprintf(stderr
,"GPRS:");
62 fprintf(stderr
, "\t%16.16lx %16.16lx %16.16lx %16.16lx\n",
67 fprintf(stderr
,"ACRS:");
69 fprintf(stderr
, "\t%8.8x %8.8x %8.8x %8.8x\n",
75 fprintf(stderr
,"CRS:");
77 fprintf(stderr
, "\t%16.16lx %16.16lx %16.16lx %16.16lx\n",
84 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
90 int kvm_arch_create_default_phys_mem(kvm_context_t kvm
,
91 unsigned long phys_mem_bytes
,
97 int kvm_arch_run(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
)
101 switch (run
->exit_reason
){
109 int kvm_s390_initial_reset(kvm_context_t kvm
, int slot
)
111 return ioctl(kvm
->vcpu_fd
[slot
], KVM_S390_INITIAL_RESET
, NULL
);
114 int kvm_s390_interrupt(kvm_context_t kvm
, int slot
,
115 struct kvm_s390_interrupt
*kvmint
)
118 return ioctl(kvm
->vcpu_fd
[slot
], KVM_S390_INTERRUPT
, kvmint
);
120 return ioctl(kvm
->vm_fd
, KVM_S390_INTERRUPT
, kvmint
);
123 int kvm_s390_set_initial_psw(kvm_context_t kvm
, int slot
, psw_t psw
)
125 return ioctl(kvm
->vcpu_fd
[slot
], KVM_S390_SET_INITIAL_PSW
, &psw
);
128 int kvm_s390_store_status(kvm_context_t kvm
, int slot
, unsigned long addr
)
130 return ioctl(kvm
->vcpu_fd
[slot
], KVM_S390_STORE_STATUS
, addr
);