diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2013-07-26 15:04:06 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-29 09:03:45 +0200 |
commit | ea828ebf59f5b56e7261bfaeb94393c9dcb86260 (patch) | |
tree | 2ec8e5669191cedccefd5ec1a435ba865e392595 /arch/s390/kvm/kvm-s390.h | |
parent | 843200e7cc5de5f482ebe8acbf81e35a1c8e4a3d (diff) | |
download | talos-obmc-linux-ea828ebf59f5b56e7261bfaeb94393c9dcb86260.tar.gz talos-obmc-linux-ea828ebf59f5b56e7261bfaeb94393c9dcb86260.zip |
KVM: s390: Add helper function for setting condition code
Introduced a helper function for setting the CC in the
guest PSW to improve the readability of the code.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.h')
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index faa4df633474..dc99f1ca4267 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h @@ -115,6 +115,13 @@ static inline u64 kvm_s390_get_base_disp_rs(struct kvm_vcpu *vcpu) return (base2 ? vcpu->run->s.regs.gprs[base2] : 0) + disp2; } +/* Set the condition code in the guest program status word */ +static inline void kvm_s390_set_psw_cc(struct kvm_vcpu *vcpu, unsigned long cc) +{ + vcpu->arch.sie_block->gpsw.mask &= ~(3UL << 44); + vcpu->arch.sie_block->gpsw.mask |= cc << 44; +} + int kvm_s390_handle_wait(struct kvm_vcpu *vcpu); enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer); void kvm_s390_tasklet(unsigned long parm); |