diff options
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/Kconfig | 3 | ||||
-rw-r--r-- | arch/s390/kvm/intercept.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/interrupt.c | 7 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 10 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 2 | ||||
-rw-r--r-- | arch/s390/kvm/priv.c | 18 | ||||
-rw-r--r-- | arch/s390/kvm/sigp.c | 2 |
7 files changed, 30 insertions, 14 deletions
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig index e051cad1f1e0..3e260b7e37b2 100644 --- a/arch/s390/kvm/Kconfig +++ b/arch/s390/kvm/Kconfig | |||
@@ -4,6 +4,9 @@ | |||
4 | config HAVE_KVM | 4 | config HAVE_KVM |
5 | bool | 5 | bool |
6 | 6 | ||
7 | config HAVE_KVM_IRQCHIP | ||
8 | bool | ||
9 | |||
7 | menuconfig VIRTUALIZATION | 10 | menuconfig VIRTUALIZATION |
8 | bool "Virtualization" | 11 | bool "Virtualization" |
9 | default y | 12 | default y |
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 61236102203e..9d19803111ba 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c | |||
@@ -103,7 +103,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu) | |||
103 | static intercept_handler_t instruction_handlers[256] = { | 103 | static intercept_handler_t instruction_handlers[256] = { |
104 | [0x83] = kvm_s390_handle_diag, | 104 | [0x83] = kvm_s390_handle_diag, |
105 | [0xae] = kvm_s390_handle_sigp, | 105 | [0xae] = kvm_s390_handle_sigp, |
106 | [0xb2] = kvm_s390_handle_priv, | 106 | [0xb2] = kvm_s390_handle_b2, |
107 | [0xb7] = handle_lctl, | 107 | [0xb7] = handle_lctl, |
108 | [0xeb] = handle_lctlg, | 108 | [0xeb] = handle_lctlg, |
109 | }; | 109 | }; |
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index f4fe28a2521a..0189356fe209 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -555,9 +555,14 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | |||
555 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)", | 555 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)", |
556 | s390int->parm); | 556 | s390int->parm); |
557 | break; | 557 | break; |
558 | case KVM_S390_SIGP_SET_PREFIX: | ||
559 | inti->prefix.address = s390int->parm; | ||
560 | inti->type = s390int->type; | ||
561 | VCPU_EVENT(vcpu, 3, "inject: set prefix to %x (from user)", | ||
562 | s390int->parm); | ||
563 | break; | ||
558 | case KVM_S390_SIGP_STOP: | 564 | case KVM_S390_SIGP_STOP: |
559 | case KVM_S390_RESTART: | 565 | case KVM_S390_RESTART: |
560 | case KVM_S390_SIGP_SET_PREFIX: | ||
561 | case KVM_S390_INT_EMERGENCY: | 566 | case KVM_S390_INT_EMERGENCY: |
562 | VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type); | 567 | VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type); |
563 | inti->type = s390int->type; | 568 | inti->type = s390int->type; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 0d33893e1e89..f4d56e9939c9 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/timer.h> | 23 | #include <linux/timer.h> |
24 | #include <asm/lowcore.h> | 24 | #include <asm/lowcore.h> |
25 | #include <asm/pgtable.h> | 25 | #include <asm/pgtable.h> |
26 | 26 | #include <asm/nmi.h> | |
27 | #include "kvm-s390.h" | 27 | #include "kvm-s390.h" |
28 | #include "gaccess.h" | 28 | #include "gaccess.h" |
29 | 29 | ||
@@ -286,7 +286,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
286 | setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, | 286 | setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, |
287 | (unsigned long) vcpu); | 287 | (unsigned long) vcpu); |
288 | get_cpu_id(&vcpu->arch.cpu_id); | 288 | get_cpu_id(&vcpu->arch.cpu_id); |
289 | vcpu->arch.cpu_id.version = 0xfe; | 289 | vcpu->arch.cpu_id.version = 0xff; |
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
@@ -422,8 +422,8 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, | |||
422 | return -EINVAL; /* not implemented yet */ | 422 | return -EINVAL; /* not implemented yet */ |
423 | } | 423 | } |
424 | 424 | ||
425 | int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, | 425 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, |
426 | struct kvm_debug_guest *dbg) | 426 | struct kvm_guest_debug *dbg) |
427 | { | 427 | { |
428 | return -EINVAL; /* not implemented yet */ | 428 | return -EINVAL; /* not implemented yet */ |
429 | } | 429 | } |
@@ -440,8 +440,6 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
440 | return -EINVAL; /* not implemented yet */ | 440 | return -EINVAL; /* not implemented yet */ |
441 | } | 441 | } |
442 | 442 | ||
443 | extern void s390_handle_mcck(void); | ||
444 | |||
445 | static void __vcpu_run(struct kvm_vcpu *vcpu) | 443 | static void __vcpu_run(struct kvm_vcpu *vcpu) |
446 | { | 444 | { |
447 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); | 445 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 3893cf12eacf..00bbe69b78da 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -50,7 +50,7 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | |||
50 | int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); | 50 | int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); |
51 | 51 | ||
52 | /* implemented in priv.c */ | 52 | /* implemented in priv.c */ |
53 | int kvm_s390_handle_priv(struct kvm_vcpu *vcpu); | 53 | int kvm_s390_handle_b2(struct kvm_vcpu *vcpu); |
54 | 54 | ||
55 | /* implemented in sigp.c */ | 55 | /* implemented in sigp.c */ |
56 | int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu); | 56 | int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu); |
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 3605df45dd41..4b88834b8dd8 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -304,12 +304,24 @@ static intercept_handler_t priv_handlers[256] = { | |||
304 | [0xb1] = handle_stfl, | 304 | [0xb1] = handle_stfl, |
305 | }; | 305 | }; |
306 | 306 | ||
307 | int kvm_s390_handle_priv(struct kvm_vcpu *vcpu) | 307 | int kvm_s390_handle_b2(struct kvm_vcpu *vcpu) |
308 | { | 308 | { |
309 | intercept_handler_t handler; | 309 | intercept_handler_t handler; |
310 | 310 | ||
311 | /* | ||
312 | * a lot of B2 instructions are priviledged. We first check for | ||
313 | * the priviledges ones, that we can handle in the kernel. If the | ||
314 | * kernel can handle this instruction, we check for the problem | ||
315 | * state bit and (a) handle the instruction or (b) send a code 2 | ||
316 | * program check. | ||
317 | * Anything else goes to userspace.*/ | ||
311 | handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; | 318 | handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; |
312 | if (handler) | 319 | if (handler) { |
313 | return handler(vcpu); | 320 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) |
321 | return kvm_s390_inject_program_int(vcpu, | ||
322 | PGM_PRIVILEGED_OPERATION); | ||
323 | else | ||
324 | return handler(vcpu); | ||
325 | } | ||
314 | return -ENOTSUPP; | 326 | return -ENOTSUPP; |
315 | } | 327 | } |
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 2a01b9e02801..f27dbedf0866 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -153,8 +153,6 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter) | |||
153 | 153 | ||
154 | switch (parameter & 0xff) { | 154 | switch (parameter & 0xff) { |
155 | case 0: | 155 | case 0: |
156 | printk(KERN_WARNING "kvm: request to switch to ESA/390 mode" | ||
157 | " not supported"); | ||
158 | rc = 3; /* not operational */ | 156 | rc = 3; /* not operational */ |
159 | break; | 157 | break; |
160 | case 1: | 158 | case 1: |