Skip to content

Commit

Permalink
KVM: s390: abstract adapter interruption word generation from ISC
Browse files Browse the repository at this point in the history
The function isc_to_int_word() allows the generation of interruption
words for adapter interrupts.

Signed-off-by: Michael Mueller <[email protected]>
Reviewed-by: Christian Borntraeger <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
  • Loading branch information
mimu001 authored and borntraeger committed Jan 26, 2018
1 parent d7c5cb0 commit 2496c8e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arch/s390/kvm/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ static uint64_t isc_to_isc_bits(int isc)
return (0x80 >> isc) << 24;
}

static inline u32 isc_to_int_word(u8 isc)
{
return ((u32)isc << 27) | 0x80000000;
}

static inline u8 int_word_to_isc(u32 int_word)
{
return (int_word & 0x38000000) >> 27;
Expand Down Expand Up @@ -992,7 +997,7 @@ static int __must_check __deliver_io(struct kvm_vcpu *vcpu,
*/
VCPU_EVENT(vcpu, 4, "%s isc %u", "deliver: I/O (AI/gisa)", isc);
memset(&io, 0, sizeof(io));
io.io_int_word = (isc << 27) | 0x80000000;
io.io_int_word = isc_to_int_word(isc);
vcpu->stat.deliver_io_int++;
trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id,
KVM_S390_INT_IO(1, 0, 0, 0),
Expand Down Expand Up @@ -2299,7 +2304,7 @@ static int kvm_s390_inject_airq(struct kvm *kvm,
struct kvm_s390_interrupt s390int = {
.type = KVM_S390_INT_IO(1, 0, 0, 0),
.parm = 0,
.parm64 = (adapter->isc << 27) | 0x80000000,
.parm64 = isc_to_int_word(adapter->isc),
};
int ret = 0;

Expand Down

0 comments on commit 2496c8e

Please sign in to comment.