mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
KVM: s390: Handle sckpf instruction
Handle the mandatory intercept SET CLOCK PROGRAMMABLE FIELD instruction. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
8733ac36fc
commit
8c3f61e2dd
3 changed files with 33 additions and 0 deletions
|
@ -101,6 +101,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)
|
||||||
}
|
}
|
||||||
|
|
||||||
static intercept_handler_t instruction_handlers[256] = {
|
static intercept_handler_t instruction_handlers[256] = {
|
||||||
|
[0x01] = kvm_s390_handle_01,
|
||||||
[0x83] = kvm_s390_handle_diag,
|
[0x83] = kvm_s390_handle_diag,
|
||||||
[0xae] = kvm_s390_handle_sigp,
|
[0xae] = kvm_s390_handle_sigp,
|
||||||
[0xb2] = kvm_s390_handle_b2,
|
[0xb2] = kvm_s390_handle_b2,
|
||||||
|
|
|
@ -79,6 +79,7 @@ int kvm_s390_inject_sigp_stop(struct kvm_vcpu *vcpu, int action);
|
||||||
/* implemented in priv.c */
|
/* implemented in priv.c */
|
||||||
int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
|
int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
|
||||||
int kvm_s390_handle_e5(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 */
|
/* implemented in sigp.c */
|
||||||
int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
|
int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
|
||||||
|
|
|
@ -380,3 +380,34 @@ int kvm_s390_handle_e5(struct kvm_vcpu *vcpu)
|
||||||
return -EOPNOTSUPP;
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue