aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2015-02-11 04:38:46 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-03-06 07:40:48 -0500
commit33b412acd32d403a8de9511f236f9b4f31551868 (patch)
tree6fd29a61e3b0d3b93e648e2b9723132b4c1e5484 /arch/s390/kvm
parent492d8642eaefbd47f6fb0e8265f058c02720e5c8 (diff)
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: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/interrupt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 98a313138f83..9561e1dea3e2 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * handling kvm guest interrupts 2 * handling kvm guest interrupts
3 * 3 *
4 * Copyright IBM Corp. 2008,2014 4 * Copyright IBM Corp. 2008, 2015
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only) 7 * it under the terms of the GNU General Public License (version 2 only)
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/bitmap.h> 19#include <linux/bitmap.h>
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/dis.h>
21#include <asm/uaccess.h> 22#include <asm/uaccess.h>
22#include <asm/sclp.h> 23#include <asm/sclp.h>
23#include "kvm-s390.h" 24#include "kvm-s390.h"
@@ -265,8 +266,6 @@ static void __set_intercept_indicator(struct kvm_vcpu *vcpu,
265 266
266static u16 get_ilc(struct kvm_vcpu *vcpu) 267static u16 get_ilc(struct kvm_vcpu *vcpu)
267{ 268{
268 const unsigned short table[] = { 2, 4, 4, 6 };
269
270 switch (vcpu->arch.sie_block->icptcode) { 269 switch (vcpu->arch.sie_block->icptcode) {
271 case ICPT_INST: 270 case ICPT_INST:
272 case ICPT_INSTPROGI: 271 case ICPT_INSTPROGI:
@@ -274,7 +273,7 @@ static u16 get_ilc(struct kvm_vcpu *vcpu)
274 case ICPT_PARTEXEC: 273 case ICPT_PARTEXEC:
275 case ICPT_IOINST: 274 case ICPT_IOINST:
276 /* last instruction only stored for these icptcodes */ 275 /* last instruction only stored for these icptcodes */
277 return table[vcpu->arch.sie_block->ipa >> 14]; 276 return insn_length(vcpu->arch.sie_block->ipa >> 8);
278 case ICPT_PROGI: 277 case ICPT_PROGI:
279 return vcpu->arch.sie_block->pgmilc; 278 return vcpu->arch.sie_block->pgmilc;
280 default: 279 default: