KVM: s390: abstract adapter interruption word generation from ISC

"Linux Kernel Mailing List" <[email protected]> Sat, 10 Feb 2018 22:00:22 +0000 (UTC)
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/2496c8e7fe9270bde5e125729c193120e7fa8c67
Commit:     2496c8e7fe9270bde5e125729c193120e7fa8c67
Parent:     d7c5cb0105ddeff56694f4c6222ee7221824bad3
Refname:    refs/heads/master
Author:     Michael Mueller <[email protected]>
AuthorDate: Thu Aug 31 11:10:28 2017 +0200
Committer:  Christian Borntraeger <[email protected]>
CommitDate: Fri Jan 26 11:12:09 2018 +0100

    KVM: s390: abstract adapter interruption word generation from ISC
    
    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]>
---
 arch/s390/kvm/interrupt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index f293c956e6db..a0ded3a23a5e 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -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;
@@ -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),
@@ -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;
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html