kvm-s390.c (659773227506f7b971cfd52e1aa146c896405187) | kvm-s390.c (5631792053f094a8e2f01d5ddcc2550ad4da22f0) |
---|---|
1/* 2 * hosting zSeries kernel virtual machines 3 * 4 * Copyright IBM Corp. 2008, 2009 5 * 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) 8 * as published by the Free Software Foundation. --- 2149 unchanged lines hidden (view full) --- 2158 VCPU_EVENT(vcpu, 6, "entering sie flags %x", cpuflags); 2159 trace_kvm_s390_sie_enter(vcpu, cpuflags); 2160 2161 return 0; 2162} 2163 2164static int vcpu_post_run_fault_in_sie(struct kvm_vcpu *vcpu) 2165{ | 1/* 2 * hosting zSeries kernel virtual machines 3 * 4 * Copyright IBM Corp. 2008, 2009 5 * 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) 8 * as published by the Free Software Foundation. --- 2149 unchanged lines hidden (view full) --- 2158 VCPU_EVENT(vcpu, 6, "entering sie flags %x", cpuflags); 2159 trace_kvm_s390_sie_enter(vcpu, cpuflags); 2160 2161 return 0; 2162} 2163 2164static int vcpu_post_run_fault_in_sie(struct kvm_vcpu *vcpu) 2165{ |
2166 u8 opcode; | 2166 struct kvm_s390_pgm_info pgm_info = { 2167 .code = PGM_ADDRESSING, 2168 }; 2169 u8 opcode, ilen; |
2167 int rc; 2168 2169 VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction"); 2170 trace_kvm_s390_sie_fault(vcpu); 2171 2172 /* 2173 * We want to inject an addressing exception, which is defined as a 2174 * suppressing or terminating exception. However, since we came here 2175 * by a DAT access exception, the PSW still points to the faulting 2176 * instruction since DAT exceptions are nullifying. So we've got 2177 * to look up the current opcode to get the length of the instruction 2178 * to be able to forward the PSW. 2179 */ 2180 rc = read_guest_instr(vcpu, &opcode, 1); 2181 if (rc) 2182 return kvm_s390_inject_prog_cond(vcpu, rc); | 2170 int rc; 2171 2172 VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction"); 2173 trace_kvm_s390_sie_fault(vcpu); 2174 2175 /* 2176 * We want to inject an addressing exception, which is defined as a 2177 * suppressing or terminating exception. However, since we came here 2178 * by a DAT access exception, the PSW still points to the faulting 2179 * instruction since DAT exceptions are nullifying. So we've got 2180 * to look up the current opcode to get the length of the instruction 2181 * to be able to forward the PSW. 2182 */ 2183 rc = read_guest_instr(vcpu, &opcode, 1); 2184 if (rc) 2185 return kvm_s390_inject_prog_cond(vcpu, rc); |
2183 kvm_s390_forward_psw(vcpu, insn_length(opcode)); 2184 2185 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); | 2186 ilen = insn_length(opcode); 2187 pgm_info.flags = ilen | KVM_S390_PGM_FLAGS_ILC_VALID; 2188 kvm_s390_forward_psw(vcpu, ilen); 2189 return kvm_s390_inject_prog_irq(vcpu, &pgm_info); |
2186} 2187 2188static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason) 2189{ 2190 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", 2191 vcpu->arch.sie_block->icptcode); 2192 trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode); 2193 --- 702 unchanged lines hidden --- | 2190} 2191 2192static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason) 2193{ 2194 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", 2195 vcpu->arch.sie_block->icptcode); 2196 trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode); 2197 --- 702 unchanged lines hidden --- |