Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133733
b: refs/heads/master
c: 70455a3
h: refs/heads/master
i:
  133731: b278a76
v: v3
  • Loading branch information
Christian Borntraeger authored and Avi Kivity committed Mar 24, 2009
1 parent fb7197e commit a690654
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c411b48af3e3c534b9cfb6a79be1df384d1ca1a
refs/heads/master: 70455a36a073cbb83ca17f92d135a6128c73cb3c
2 changes: 1 addition & 1 deletion trunk/arch/s390/kvm/intercept.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)
static intercept_handler_t instruction_handlers[256] = {
[0x83] = kvm_s390_handle_diag,
[0xae] = kvm_s390_handle_sigp,
[0xb2] = kvm_s390_handle_priv,
[0xb2] = kvm_s390_handle_b2,
[0xb7] = handle_lctl,
[0xeb] = handle_lctlg,
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kvm/kvm-s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code);

/* implemented in priv.c */
int kvm_s390_handle_priv(struct kvm_vcpu *vcpu);
int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);

/* implemented in sigp.c */
int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
Expand Down
18 changes: 15 additions & 3 deletions trunk/arch/s390/kvm/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,24 @@ static intercept_handler_t priv_handlers[256] = {
[0xb1] = handle_stfl,
};

int kvm_s390_handle_priv(struct kvm_vcpu *vcpu)
int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
{
intercept_handler_t handler;

/*
* a lot of B2 instructions are priviledged. We first check for
* the priviledges ones, that we can handle in the kernel. If the
* kernel can handle this instruction, we check for the problem
* state bit and (a) handle the instruction or (b) send a code 2
* program check.
* Anything else goes to userspace.*/
handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff];
if (handler)
return handler(vcpu);
if (handler) {
if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
return kvm_s390_inject_program_int(vcpu,
PGM_PRIVILEGED_OPERATION);
else
return handler(vcpu);
}
return -ENOTSUPP;
}

0 comments on commit a690654

Please sign in to comment.