Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307880
b: refs/heads/master
c: 8c3f61e
h: refs/heads/master
v: v3
  • Loading branch information
Cornelia Huck authored and Marcelo Tosatti committed May 1, 2012
1 parent 68e0847 commit 4377e53
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8733ac36fc37fe055a7d7daadf5451b4231f0214
refs/heads/master: 8c3f61e2ddb6c1845704fd8ef1b999ecd2e4725c
1 change: 1 addition & 0 deletions trunk/arch/s390/kvm/intercept.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)
}

static intercept_handler_t instruction_handlers[256] = {
[0x01] = kvm_s390_handle_01,
[0x83] = kvm_s390_handle_diag,
[0xae] = kvm_s390_handle_sigp,
[0xb2] = kvm_s390_handle_b2,
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/s390/kvm/kvm-s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ int kvm_s390_inject_sigp_stop(struct kvm_vcpu *vcpu, int action);
/* implemented in priv.c */
int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
int kvm_s390_handle_e5(struct kvm_vcpu *vcpu);
int kvm_s390_handle_01(struct kvm_vcpu *vcpu);

/* implemented in sigp.c */
int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
Expand Down
31 changes: 31 additions & 0 deletions trunk/arch/s390/kvm/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,34 @@ int kvm_s390_handle_e5(struct kvm_vcpu *vcpu)
return -EOPNOTSUPP;
}

static int handle_sckpf(struct kvm_vcpu *vcpu)
{
u32 value;

if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
return kvm_s390_inject_program_int(vcpu,
PGM_PRIVILEGED_OPERATION);

if (vcpu->run->s.regs.gprs[0] & 0x00000000ffff0000)
return kvm_s390_inject_program_int(vcpu,
PGM_SPECIFICATION);

value = vcpu->run->s.regs.gprs[0] & 0x000000000000ffff;
vcpu->arch.sie_block->todpr = value;

return 0;
}

static intercept_handler_t x01_handlers[256] = {
[0x07] = handle_sckpf,
};

int kvm_s390_handle_01(struct kvm_vcpu *vcpu)
{
intercept_handler_t handler;

handler = x01_handlers[vcpu->arch.sie_block->ipa & 0x00ff];
if (handler)
return handler(vcpu);
return -EOPNOTSUPP;
}

0 comments on commit 4377e53

Please sign in to comment.