aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-03-25 13:47:20 -0400
committerAvi Kivity <avi@qumranet.com>2008-04-27 05:00:42 -0400
commitb0c632db637d68ad39d9f97f452ce176253f5f4e (patch)
tree770d68c17cbcabc1543d1e9125669130fcf4fee4 /include/linux/kvm.h
parent8a88ac6183975c73c65b45f365f6f3b875c1348b (diff)
KVM: s390: arch backend for the kvm kernel module
This patch contains the port of Qumranet's kvm kernel module to IBM zSeries (aka s390x, mainframe) architecture. It uses the mainframe's virtualization instruction SIE to run virtual machines with up to 64 virtual CPUs each. This port is only usable on 64bit host kernels, and can only run 64bit guest kernels. However, running 31bit applications in guest userspace is possible. The following source files are introduced by this patch arch/s390/kvm/kvm-s390.c similar to arch/x86/kvm/x86.c, this implements all arch callbacks for kvm. __vcpu_run calls back into sie64a to enter the guest machine context arch/s390/kvm/sie64a.S assembler function sie64a, which enters guest context via SIE, and switches world before and after that include/asm-s390/kvm_host.h contains all vital data structures needed to run virtual machines on the mainframe include/asm-s390/kvm.h defines kvm_regs and friends for user access to guest register content arch/s390/kvm/gaccess.h functions similar to uaccess to access guest memory arch/s390/kvm/kvm-s390.h header file for kvm-s390 internals, extended by later patches Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r--include/linux/kvm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 3bd38284bfe9..2367ff0c5dd0 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -205,6 +205,11 @@ struct kvm_vapic_addr {
205 __u64 vapic_addr; 205 __u64 vapic_addr;
206}; 206};
207 207
208struct kvm_s390_psw {
209 __u64 mask;
210 __u64 addr;
211};
212
208#define KVMIO 0xAE 213#define KVMIO 0xAE
209 214
210/* 215/*
@@ -213,6 +218,8 @@ struct kvm_vapic_addr {
213#define KVM_GET_API_VERSION _IO(KVMIO, 0x00) 218#define KVM_GET_API_VERSION _IO(KVMIO, 0x00)
214#define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */ 219#define KVM_CREATE_VM _IO(KVMIO, 0x01) /* returns a VM fd */
215#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list) 220#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 0x02, struct kvm_msr_list)
221
222#define KVM_S390_ENABLE_SIE _IO(KVMIO, 0x06)
216/* 223/*
217 * Check if a kvm extension is available. Argument is extension number, 224 * Check if a kvm extension is available. Argument is extension number,
218 * return is 1 (yes) or 0 (no, sorry). 225 * return is 1 (yes) or 0 (no, sorry).
@@ -291,5 +298,13 @@ struct kvm_vapic_addr {
291#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) 298#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl)
292/* Available with KVM_CAP_VAPIC */ 299/* Available with KVM_CAP_VAPIC */
293#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) 300#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr)
301/* store status for s390 */
302#define KVM_S390_STORE_STATUS_NOADDR (-1ul)
303#define KVM_S390_STORE_STATUS_PREFIXED (-2ul)
304#define KVM_S390_STORE_STATUS _IOW(KVMIO, 0x95, unsigned long)
305/* initial ipl psw for s390 */
306#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw)
307/* initial reset for s390 */
308#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
294 309
295#endif 310#endif