blob: 002d51764143b7a8b0275ae0b3590a5d82932385 [file] [log] [blame]
Hollis Blanchardbc8080c2009-01-03 16:23:10 -06001/*
Scott Wood5ce941e2011-04-27 17:24:21 -05002 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
Hollis Blanchardbc8080c2009-01-03 16:23:10 -06003 *
4 * Author: Yu Liu, <yu.liu@freescale.com>
5 *
6 * Description:
7 * This file is derived from arch/powerpc/kvm/44x_emulate.c,
8 * by Hollis Blanchard <hollisb@us.ibm.com>.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License, version 2, as
12 * published by the Free Software Foundation.
13 */
14
15#include <asm/kvm_ppc.h>
16#include <asm/disassemble.h>
Alexander Graf4ab96912012-02-15 13:28:48 +000017#include <asm/dbell.h>
Hollis Blanchardbc8080c2009-01-03 16:23:10 -060018
19#include "booke.h"
Scott Wood29a5a6f2011-12-20 15:34:29 +000020#include "e500.h"
Hollis Blanchardbc8080c2009-01-03 16:23:10 -060021
Alexander Graf8f20a3a2014-04-17 13:25:33 +020022#define XOP_DCBTLS 166
Alexander Graf4ab96912012-02-15 13:28:48 +000023#define XOP_MSGSND 206
24#define XOP_MSGCLR 238
Hollis Blanchardbc8080c2009-01-03 16:23:10 -060025#define XOP_TLBIVAX 786
26#define XOP_TLBSX 914
27#define XOP_TLBRE 946
28#define XOP_TLBWE 978
Scott Woodab9fc402011-12-20 15:34:39 +000029#define XOP_TLBILX 18
Bharat Bhushanb12c7842013-07-04 12:27:45 +053030#define XOP_EHPRIV 270
Hollis Blanchardbc8080c2009-01-03 16:23:10 -060031
Alexander Graf4ab96912012-02-15 13:28:48 +000032#ifdef CONFIG_KVM_E500MC
33static int dbell2prio(ulong param)
34{
35 int msg = param & PPC_DBELL_TYPE_MASK;
36 int prio = -1;
37
38 switch (msg) {
39 case PPC_DBELL_TYPE(PPC_DBELL):
40 prio = BOOKE_IRQPRIO_DBELL;
41 break;
42 case PPC_DBELL_TYPE(PPC_DBELL_CRIT):
43 prio = BOOKE_IRQPRIO_DBELL_CRIT;
44 break;
45 default:
46 break;
47 }
48
49 return prio;
50}
51
52static int kvmppc_e500_emul_msgclr(struct kvm_vcpu *vcpu, int rb)
53{
54 ulong param = vcpu->arch.gpr[rb];
55 int prio = dbell2prio(param);
56
57 if (prio < 0)
58 return EMULATE_FAIL;
59
60 clear_bit(prio, &vcpu->arch.pending_exceptions);
61 return EMULATE_DONE;
62}
63
64static int kvmppc_e500_emul_msgsnd(struct kvm_vcpu *vcpu, int rb)
65{
66 ulong param = vcpu->arch.gpr[rb];
67 int prio = dbell2prio(rb);
68 int pir = param & PPC_DBELL_PIR_MASK;
69 int i;
70 struct kvm_vcpu *cvcpu;
71
72 if (prio < 0)
73 return EMULATE_FAIL;
74
75 kvm_for_each_vcpu(i, cvcpu, vcpu->kvm) {
76 int cpir = cvcpu->arch.shared->pir;
77 if ((param & PPC_DBELL_MSG_BRDCAST) || (cpir == pir)) {
78 set_bit(prio, &cvcpu->arch.pending_exceptions);
79 kvm_vcpu_kick(cvcpu);
80 }
81 }
82
83 return EMULATE_DONE;
84}
85#endif
86
Bharat Bhushanb12c7842013-07-04 12:27:45 +053087static int kvmppc_e500_emul_ehpriv(struct kvm_run *run, struct kvm_vcpu *vcpu,
88 unsigned int inst, int *advance)
89{
90 int emulated = EMULATE_DONE;
91
92 switch (get_oc(inst)) {
93 case EHPRIV_OC_DEBUG:
94 run->exit_reason = KVM_EXIT_DEBUG;
95 run->debug.arch.address = vcpu->arch.pc;
96 run->debug.arch.status = 0;
97 kvmppc_account_exit(vcpu, DEBUG_EXITS);
98 emulated = EMULATE_EXIT_USER;
99 *advance = 0;
100 break;
101 default:
102 emulated = EMULATE_FAIL;
103 }
104 return emulated;
105}
106
Alexander Graf8f20a3a2014-04-17 13:25:33 +0200107static int kvmppc_e500_emul_dcbtls(struct kvm_vcpu *vcpu)
108{
109 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
110
111 /* Always fail to lock the cache */
112 vcpu_e500->l1csr0 |= L1CSR0_CUL;
113 return EMULATE_DONE;
114}
115
Aneesh Kumar K.V3a167bea2013-10-07 22:17:53 +0530116int kvmppc_core_emulate_op_e500(struct kvm_run *run, struct kvm_vcpu *vcpu,
117 unsigned int inst, int *advance)
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600118{
119 int emulated = EMULATE_DONE;
Alexander Grafc46dc9a2012-05-04 14:01:33 +0200120 int ra = get_ra(inst);
121 int rb = get_rb(inst);
122 int rt = get_rt(inst);
Mihai Caraman7cdd7a92012-10-11 06:13:22 +0000123 gva_t ea;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600124
125 switch (get_op(inst)) {
126 case 31:
127 switch (get_xop(inst)) {
128
Alexander Graf8f20a3a2014-04-17 13:25:33 +0200129 case XOP_DCBTLS:
130 emulated = kvmppc_e500_emul_dcbtls(vcpu);
131 break;
132
Alexander Graf4ab96912012-02-15 13:28:48 +0000133#ifdef CONFIG_KVM_E500MC
134 case XOP_MSGSND:
Alexander Grafc46dc9a2012-05-04 14:01:33 +0200135 emulated = kvmppc_e500_emul_msgsnd(vcpu, rb);
Alexander Graf4ab96912012-02-15 13:28:48 +0000136 break;
137
138 case XOP_MSGCLR:
Alexander Grafc46dc9a2012-05-04 14:01:33 +0200139 emulated = kvmppc_e500_emul_msgclr(vcpu, rb);
Alexander Graf4ab96912012-02-15 13:28:48 +0000140 break;
141#endif
142
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600143 case XOP_TLBRE:
144 emulated = kvmppc_e500_emul_tlbre(vcpu);
145 break;
146
147 case XOP_TLBWE:
148 emulated = kvmppc_e500_emul_tlbwe(vcpu);
149 break;
150
151 case XOP_TLBSX:
Mihai Caraman7cdd7a92012-10-11 06:13:22 +0000152 ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
153 emulated = kvmppc_e500_emul_tlbsx(vcpu, ea);
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600154 break;
155
Mihai Caraman7cdd7a92012-10-11 06:13:22 +0000156 case XOP_TLBILX: {
157 int type = rt & 0x3;
158 ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
159 emulated = kvmppc_e500_emul_tlbilx(vcpu, type, ea);
Scott Woodab9fc402011-12-20 15:34:39 +0000160 break;
Mihai Caraman7cdd7a92012-10-11 06:13:22 +0000161 }
Scott Woodab9fc402011-12-20 15:34:39 +0000162
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600163 case XOP_TLBIVAX:
Mihai Caraman7cdd7a92012-10-11 06:13:22 +0000164 ea = kvmppc_get_ea_indexed(vcpu, ra, rb);
165 emulated = kvmppc_e500_emul_tlbivax(vcpu, ea);
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600166 break;
167
Bharat Bhushanb12c7842013-07-04 12:27:45 +0530168 case XOP_EHPRIV:
169 emulated = kvmppc_e500_emul_ehpriv(run, vcpu, inst,
170 advance);
171 break;
172
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600173 default:
174 emulated = EMULATE_FAIL;
175 }
176
177 break;
178
179 default:
180 emulated = EMULATE_FAIL;
181 }
182
183 if (emulated == EMULATE_FAIL)
184 emulated = kvmppc_booke_emulate_op(run, vcpu, inst, advance);
185
186 return emulated;
187}
188
Aneesh Kumar K.V3a167bea2013-10-07 22:17:53 +0530189int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600190{
191 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
192 int emulated = EMULATE_DONE;
193
194 switch (sprn) {
Scott Wood73196cd32011-12-20 15:34:47 +0000195#ifndef CONFIG_KVM_BOOKE_HV
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600196 case SPRN_PID:
Scott Wood5ce941e2011-04-27 17:24:21 -0500197 kvmppc_set_pid(vcpu, spr_val);
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600198 break;
199 case SPRN_PID1:
Liu Yudd9ebf1f2011-06-14 18:35:14 -0500200 if (spr_val != 0)
201 return EMULATE_FAIL;
Alexander Graf54771e62012-05-04 14:55:12 +0200202 vcpu_e500->pid[1] = spr_val;
203 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600204 case SPRN_PID2:
Liu Yudd9ebf1f2011-06-14 18:35:14 -0500205 if (spr_val != 0)
206 return EMULATE_FAIL;
Alexander Graf54771e62012-05-04 14:55:12 +0200207 vcpu_e500->pid[2] = spr_val;
208 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600209 case SPRN_MAS0:
Alexander Graf54771e62012-05-04 14:55:12 +0200210 vcpu->arch.shared->mas0 = spr_val;
211 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600212 case SPRN_MAS1:
Alexander Graf54771e62012-05-04 14:55:12 +0200213 vcpu->arch.shared->mas1 = spr_val;
214 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600215 case SPRN_MAS2:
Alexander Graf54771e62012-05-04 14:55:12 +0200216 vcpu->arch.shared->mas2 = spr_val;
217 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600218 case SPRN_MAS3:
Scott Woodb5904972011-11-08 18:23:30 -0600219 vcpu->arch.shared->mas7_3 &= ~(u64)0xffffffff;
220 vcpu->arch.shared->mas7_3 |= spr_val;
Scott Wooddc83b8b2011-08-18 15:25:21 -0500221 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600222 case SPRN_MAS4:
Alexander Graf54771e62012-05-04 14:55:12 +0200223 vcpu->arch.shared->mas4 = spr_val;
224 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600225 case SPRN_MAS6:
Alexander Graf54771e62012-05-04 14:55:12 +0200226 vcpu->arch.shared->mas6 = spr_val;
227 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600228 case SPRN_MAS7:
Scott Woodb5904972011-11-08 18:23:30 -0600229 vcpu->arch.shared->mas7_3 &= (u64)0xffffffff;
230 vcpu->arch.shared->mas7_3 |= (u64)spr_val << 32;
Scott Wooddc83b8b2011-08-18 15:25:21 -0500231 break;
Scott Wood73196cd32011-12-20 15:34:47 +0000232#endif
Liu Yud86be072010-01-22 18:50:29 +0800233 case SPRN_L1CSR0:
234 vcpu_e500->l1csr0 = spr_val;
235 vcpu_e500->l1csr0 &= ~(L1CSR0_DCFI | L1CSR0_CLFC);
236 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600237 case SPRN_L1CSR1:
Alexander Graf54771e62012-05-04 14:55:12 +0200238 vcpu_e500->l1csr1 = spr_val;
Alexander Graf07fec1c2014-04-17 12:53:13 +0200239 vcpu_e500->l1csr1 &= ~(L1CSR1_ICFI | L1CSR1_ICLFR);
Alexander Graf54771e62012-05-04 14:55:12 +0200240 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600241 case SPRN_HID0:
Alexander Graf54771e62012-05-04 14:55:12 +0200242 vcpu_e500->hid0 = spr_val;
243 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600244 case SPRN_HID1:
Alexander Graf54771e62012-05-04 14:55:12 +0200245 vcpu_e500->hid1 = spr_val;
246 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600247
Liu Yub0a18352009-02-17 16:52:08 +0800248 case SPRN_MMUCSR0:
249 emulated = kvmppc_e500_emul_mt_mmucsr0(vcpu_e500,
Alexander Graf8e5b26b2010-01-08 02:58:01 +0100250 spr_val);
Liu Yub0a18352009-02-17 16:52:08 +0800251 break;
252
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600253 /* extra exceptions */
254 case SPRN_IVOR32:
Alexander Graf8e5b26b2010-01-08 02:58:01 +0100255 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = spr_val;
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600256 break;
257 case SPRN_IVOR33:
Alexander Graf8e5b26b2010-01-08 02:58:01 +0100258 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA] = spr_val;
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600259 break;
260 case SPRN_IVOR34:
Alexander Graf8e5b26b2010-01-08 02:58:01 +0100261 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND] = spr_val;
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600262 break;
263 case SPRN_IVOR35:
Alexander Graf8e5b26b2010-01-08 02:58:01 +0100264 vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] = spr_val;
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600265 break;
Scott Wood73196cd32011-12-20 15:34:47 +0000266#ifdef CONFIG_KVM_BOOKE_HV
267 case SPRN_IVOR36:
268 vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL] = spr_val;
269 break;
270 case SPRN_IVOR37:
271 vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL_CRIT] = spr_val;
272 break;
273#endif
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600274 default:
Alexander Graf54771e62012-05-04 14:55:12 +0200275 emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, spr_val);
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600276 }
277
278 return emulated;
279}
280
Aneesh Kumar K.V3a167bea2013-10-07 22:17:53 +0530281int kvmppc_core_emulate_mfspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600282{
283 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
284 int emulated = EMULATE_DONE;
285
286 switch (sprn) {
Scott Wood73196cd32011-12-20 15:34:47 +0000287#ifndef CONFIG_KVM_BOOKE_HV
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600288 case SPRN_PID:
Alexander Graf54771e62012-05-04 14:55:12 +0200289 *spr_val = vcpu_e500->pid[0];
290 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600291 case SPRN_PID1:
Alexander Graf54771e62012-05-04 14:55:12 +0200292 *spr_val = vcpu_e500->pid[1];
293 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600294 case SPRN_PID2:
Alexander Graf54771e62012-05-04 14:55:12 +0200295 *spr_val = vcpu_e500->pid[2];
296 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600297 case SPRN_MAS0:
Alexander Graf54771e62012-05-04 14:55:12 +0200298 *spr_val = vcpu->arch.shared->mas0;
299 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600300 case SPRN_MAS1:
Alexander Graf54771e62012-05-04 14:55:12 +0200301 *spr_val = vcpu->arch.shared->mas1;
302 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600303 case SPRN_MAS2:
Alexander Graf54771e62012-05-04 14:55:12 +0200304 *spr_val = vcpu->arch.shared->mas2;
305 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600306 case SPRN_MAS3:
Alexander Graf54771e62012-05-04 14:55:12 +0200307 *spr_val = (u32)vcpu->arch.shared->mas7_3;
Scott Woodb5904972011-11-08 18:23:30 -0600308 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600309 case SPRN_MAS4:
Alexander Graf54771e62012-05-04 14:55:12 +0200310 *spr_val = vcpu->arch.shared->mas4;
311 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600312 case SPRN_MAS6:
Alexander Graf54771e62012-05-04 14:55:12 +0200313 *spr_val = vcpu->arch.shared->mas6;
314 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600315 case SPRN_MAS7:
Alexander Graf54771e62012-05-04 14:55:12 +0200316 *spr_val = vcpu->arch.shared->mas7_3 >> 32;
Scott Woodb5904972011-11-08 18:23:30 -0600317 break;
Scott Wood73196cd32011-12-20 15:34:47 +0000318#endif
Bharat Bhushan21bd0002012-05-20 23:21:23 +0000319 case SPRN_DECAR:
320 *spr_val = vcpu->arch.decar;
321 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600322 case SPRN_TLB0CFG:
Alexander Graf54771e62012-05-04 14:55:12 +0200323 *spr_val = vcpu->arch.tlbcfg[0];
324 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600325 case SPRN_TLB1CFG:
Alexander Graf54771e62012-05-04 14:55:12 +0200326 *spr_val = vcpu->arch.tlbcfg[1];
327 break;
Mihai Caraman307d9002013-04-11 00:03:10 +0000328 case SPRN_TLB0PS:
329 if (!has_feature(vcpu, VCPU_FTR_MMU_V2))
330 return EMULATE_FAIL;
331 *spr_val = vcpu->arch.tlbps[0];
332 break;
333 case SPRN_TLB1PS:
334 if (!has_feature(vcpu, VCPU_FTR_MMU_V2))
335 return EMULATE_FAIL;
336 *spr_val = vcpu->arch.tlbps[1];
337 break;
Liu Yud86be072010-01-22 18:50:29 +0800338 case SPRN_L1CSR0:
Alexander Graf54771e62012-05-04 14:55:12 +0200339 *spr_val = vcpu_e500->l1csr0;
340 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600341 case SPRN_L1CSR1:
Alexander Graf54771e62012-05-04 14:55:12 +0200342 *spr_val = vcpu_e500->l1csr1;
343 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600344 case SPRN_HID0:
Alexander Graf54771e62012-05-04 14:55:12 +0200345 *spr_val = vcpu_e500->hid0;
346 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600347 case SPRN_HID1:
Alexander Graf54771e62012-05-04 14:55:12 +0200348 *spr_val = vcpu_e500->hid1;
349 break;
Scott Wood90d34b02011-03-29 16:49:10 -0500350 case SPRN_SVR:
Alexander Graf54771e62012-05-04 14:55:12 +0200351 *spr_val = vcpu_e500->svr;
352 break;
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600353
Liu Yub0a18352009-02-17 16:52:08 +0800354 case SPRN_MMUCSR0:
Alexander Graf54771e62012-05-04 14:55:12 +0200355 *spr_val = 0;
356 break;
Liu Yub0a18352009-02-17 16:52:08 +0800357
Liu Yu06579dd2009-06-05 14:54:31 +0800358 case SPRN_MMUCFG:
Alexander Graf54771e62012-05-04 14:55:12 +0200359 *spr_val = vcpu->arch.mmucfg;
360 break;
Mihai Caraman9a6061d2013-04-11 00:03:11 +0000361 case SPRN_EPTCFG:
362 if (!has_feature(vcpu, VCPU_FTR_MMU_V2))
363 return EMULATE_FAIL;
364 /*
365 * Legacy Linux guests access EPTCFG register even if the E.PT
366 * category is disabled in the VM. Give them a chance to live.
367 */
368 *spr_val = vcpu->arch.eptcfg;
369 break;
Liu Yu06579dd2009-06-05 14:54:31 +0800370
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600371 /* extra exceptions */
372 case SPRN_IVOR32:
Alexander Graf54771e62012-05-04 14:55:12 +0200373 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600374 break;
375 case SPRN_IVOR33:
Alexander Graf54771e62012-05-04 14:55:12 +0200376 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA];
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600377 break;
378 case SPRN_IVOR34:
Alexander Graf54771e62012-05-04 14:55:12 +0200379 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND];
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600380 break;
381 case SPRN_IVOR35:
Alexander Graf54771e62012-05-04 14:55:12 +0200382 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR];
Hollis Blanchardbb3a8a12009-01-03 16:23:13 -0600383 break;
Scott Wood73196cd32011-12-20 15:34:47 +0000384#ifdef CONFIG_KVM_BOOKE_HV
385 case SPRN_IVOR36:
Alexander Graf54771e62012-05-04 14:55:12 +0200386 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL];
Scott Wood73196cd32011-12-20 15:34:47 +0000387 break;
388 case SPRN_IVOR37:
Alexander Graf54771e62012-05-04 14:55:12 +0200389 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL_CRIT];
Scott Wood73196cd32011-12-20 15:34:47 +0000390 break;
391#endif
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600392 default:
Alexander Graf54771e62012-05-04 14:55:12 +0200393 emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, spr_val);
Hollis Blanchardbc8080c2009-01-03 16:23:10 -0600394 }
395
396 return emulated;
397}
398