Commit 33b412ac authored by Thomas Huth's avatar Thomas Huth Committed by Christian Borntraeger

KVM: s390: Use insn_length() to calculate length of instruction

The common s390 function insn_length() results in slightly smaller
(and thus hopefully faster) code than the calculation of the
instruction length via a lookup-table. So let's use that function
in the interrupt delivery code, too.
Signed-off-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: default avatarJens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 492d8642
/* /*
* handling kvm guest interrupts * handling kvm guest interrupts
* *
* Copyright IBM Corp. 2008,2014 * Copyright IBM Corp. 2008, 2015
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2 only) * it under the terms of the GNU General Public License (version 2 only)
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/dis.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/sclp.h> #include <asm/sclp.h>
#include "kvm-s390.h" #include "kvm-s390.h"
...@@ -265,8 +266,6 @@ static void __set_intercept_indicator(struct kvm_vcpu *vcpu, ...@@ -265,8 +266,6 @@ static void __set_intercept_indicator(struct kvm_vcpu *vcpu,
static u16 get_ilc(struct kvm_vcpu *vcpu) static u16 get_ilc(struct kvm_vcpu *vcpu)
{ {
const unsigned short table[] = { 2, 4, 4, 6 };
switch (vcpu->arch.sie_block->icptcode) { switch (vcpu->arch.sie_block->icptcode) {
case ICPT_INST: case ICPT_INST:
case ICPT_INSTPROGI: case ICPT_INSTPROGI:
...@@ -274,7 +273,7 @@ static u16 get_ilc(struct kvm_vcpu *vcpu) ...@@ -274,7 +273,7 @@ static u16 get_ilc(struct kvm_vcpu *vcpu)
case ICPT_PARTEXEC: case ICPT_PARTEXEC:
case ICPT_IOINST: case ICPT_IOINST:
/* last instruction only stored for these icptcodes */ /* last instruction only stored for these icptcodes */
return table[vcpu->arch.sie_block->ipa >> 14]; return insn_length(vcpu->arch.sie_block->ipa >> 8);
case ICPT_PROGI: case ICPT_PROGI:
return vcpu->arch.sie_block->pgmilc; return vcpu->arch.sie_block->pgmilc;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment