Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 1 | /* |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Main entry point for the guest, exception handling. |
| 7 | * |
| 8 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
| 9 | * Authors: Sanjay Lal <sanjayl@kymasys.com> |
| 10 | */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 11 | |
| 12 | #include <asm/asm.h> |
| 13 | #include <asm/asmmacro.h> |
| 14 | #include <asm/regdef.h> |
| 15 | #include <asm/mipsregs.h> |
| 16 | #include <asm/stackframe.h> |
| 17 | #include <asm/asm-offsets.h> |
| 18 | |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 19 | #define _C_LABEL(x) x |
| 20 | #define MIPSX(name) mips32_ ## name |
| 21 | #define CALLFRAME_SIZ 32 |
| 22 | |
| 23 | /* |
| 24 | * VECTOR |
| 25 | * exception vector entrypoint |
| 26 | */ |
| 27 | #define VECTOR(x, regmask) \ |
| 28 | .ent _C_LABEL(x),0; \ |
| 29 | EXPORT(x); |
| 30 | |
| 31 | #define VECTOR_END(x) \ |
| 32 | EXPORT(x); |
| 33 | |
| 34 | /* Overload, Danger Will Robinson!! */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 35 | #define PT_HOST_USERLOCAL PT_EPC |
| 36 | |
| 37 | #define CP0_DDATA_LO $28,3 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 38 | |
| 39 | /* Resume Flags */ |
| 40 | #define RESUME_FLAG_HOST (1<<1) /* Resume host? */ |
| 41 | |
| 42 | #define RESUME_GUEST 0 |
| 43 | #define RESUME_HOST RESUME_FLAG_HOST |
| 44 | |
| 45 | /* |
| 46 | * __kvm_mips_vcpu_run: entry point to the guest |
| 47 | * a0: run |
| 48 | * a1: vcpu |
| 49 | */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 50 | .set noreorder |
| 51 | .set noat |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 52 | |
David Daney | bb48c2f | 2013-08-01 13:22:34 -0700 | [diff] [blame] | 53 | FEXPORT(__kvm_mips_vcpu_run) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 54 | /* k0/k1 not being used in host kernel context */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 55 | INT_ADDIU k1, sp, -PT_SIZE |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 56 | LONG_S $16, PT_R16(k1) |
| 57 | LONG_S $17, PT_R17(k1) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 58 | LONG_S $18, PT_R18(k1) |
| 59 | LONG_S $19, PT_R19(k1) |
| 60 | LONG_S $20, PT_R20(k1) |
| 61 | LONG_S $21, PT_R21(k1) |
| 62 | LONG_S $22, PT_R22(k1) |
| 63 | LONG_S $23, PT_R23(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 64 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 65 | LONG_S $28, PT_R28(k1) |
| 66 | LONG_S $29, PT_R29(k1) |
| 67 | LONG_S $30, PT_R30(k1) |
| 68 | LONG_S $31, PT_R31(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 69 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 70 | /* Save hi/lo */ |
| 71 | mflo v0 |
| 72 | LONG_S v0, PT_LO(k1) |
| 73 | mfhi v1 |
| 74 | LONG_S v1, PT_HI(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 75 | |
| 76 | /* Save host status */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 77 | mfc0 v0, CP0_STATUS |
| 78 | LONG_S v0, PT_STATUS(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 79 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 80 | /* Save DDATA_LO, will be used to store pointer to vcpu */ |
| 81 | mfc0 v1, CP0_DDATA_LO |
| 82 | LONG_S v1, PT_HOST_USERLOCAL(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 83 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 84 | /* DDATA_LO has pointer to vcpu */ |
| 85 | mtc0 a1, CP0_DDATA_LO |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 86 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 87 | /* Offset into vcpu->arch */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 88 | INT_ADDIU k1, a1, VCPU_HOST_ARCH |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 89 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 90 | /* |
| 91 | * Save the host stack to VCPU, used for exception processing |
| 92 | * when we exit from the Guest |
| 93 | */ |
| 94 | LONG_S sp, VCPU_HOST_STACK(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 95 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 96 | /* Save the kernel gp as well */ |
| 97 | LONG_S gp, VCPU_HOST_GP(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 98 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 99 | /* |
| 100 | * Setup status register for running the guest in UM, interrupts |
| 101 | * are disabled |
| 102 | */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 103 | li k0, (ST0_EXL | KSU_USER | ST0_BEV) |
| 104 | mtc0 k0, CP0_STATUS |
| 105 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 106 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 107 | /* load up the new EBASE */ |
| 108 | LONG_L k0, VCPU_GUEST_EBASE(k1) |
| 109 | mtc0 k0, CP0_EBASE |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 110 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 111 | /* |
| 112 | * Now that the new EBASE has been loaded, unset BEV, set |
| 113 | * interrupt mask as it was but make sure that timer interrupts |
| 114 | * are enabled |
| 115 | */ |
| 116 | li k0, (ST0_EXL | KSU_USER | ST0_IE) |
| 117 | andi v0, v0, ST0_IM |
| 118 | or k0, k0, v0 |
| 119 | mtc0 k0, CP0_STATUS |
| 120 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 121 | |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 122 | /* Set Guest EPC */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 123 | LONG_L t0, VCPU_PC(k1) |
| 124 | mtc0 t0, CP0_EPC |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 125 | |
| 126 | FEXPORT(__kvm_mips_load_asid) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 127 | /* Set the ASID for the Guest Kernel */ |
James Hogan | 002374f | 2015-11-11 14:21:18 +0000 | [diff] [blame] | 128 | PTR_L t0, VCPU_COP0(k1) |
| 129 | LONG_L t0, COP0_STATUS(t0) |
| 130 | andi t0, KSU_USER | ST0_ERL | ST0_EXL |
| 131 | xori t0, KSU_USER |
| 132 | bnez t0, 1f /* If kernel */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 133 | INT_ADDIU t1, k1, VCPU_GUEST_KERNEL_ASID /* (BD) */ |
| 134 | INT_ADDIU t1, k1, VCPU_GUEST_USER_ASID /* else user */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 135 | 1: |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 136 | /* t1: contains the base of the ASID array, need to get the cpu id */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 137 | LONG_L t2, TI_CPU($28) /* smp_processor_id */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 138 | INT_SLL t2, t2, 2 /* x4 */ |
| 139 | REG_ADDU t3, t1, t2 |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 140 | LONG_L k0, (t3) |
James Hogan | 9b5c339 | 2016-05-06 14:36:19 +0100 | [diff] [blame] | 141 | andi k0, k0, MIPS_ENTRYHI_ASID |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 142 | mtc0 k0, CP0_ENTRYHI |
| 143 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 144 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 145 | /* Disable RDHWR access */ |
| 146 | mtc0 zero, CP0_HWRENA |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 147 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 148 | /* Now load up the Guest Context from VCPU */ |
| 149 | LONG_L $1, VCPU_R1(k1) |
| 150 | LONG_L $2, VCPU_R2(k1) |
| 151 | LONG_L $3, VCPU_R3(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 152 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 153 | LONG_L $4, VCPU_R4(k1) |
| 154 | LONG_L $5, VCPU_R5(k1) |
| 155 | LONG_L $6, VCPU_R6(k1) |
| 156 | LONG_L $7, VCPU_R7(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 157 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 158 | LONG_L $8, VCPU_R8(k1) |
| 159 | LONG_L $9, VCPU_R9(k1) |
| 160 | LONG_L $10, VCPU_R10(k1) |
| 161 | LONG_L $11, VCPU_R11(k1) |
| 162 | LONG_L $12, VCPU_R12(k1) |
| 163 | LONG_L $13, VCPU_R13(k1) |
| 164 | LONG_L $14, VCPU_R14(k1) |
| 165 | LONG_L $15, VCPU_R15(k1) |
| 166 | LONG_L $16, VCPU_R16(k1) |
| 167 | LONG_L $17, VCPU_R17(k1) |
| 168 | LONG_L $18, VCPU_R18(k1) |
| 169 | LONG_L $19, VCPU_R19(k1) |
| 170 | LONG_L $20, VCPU_R20(k1) |
| 171 | LONG_L $21, VCPU_R21(k1) |
| 172 | LONG_L $22, VCPU_R22(k1) |
| 173 | LONG_L $23, VCPU_R23(k1) |
| 174 | LONG_L $24, VCPU_R24(k1) |
| 175 | LONG_L $25, VCPU_R25(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 176 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 177 | /* k0/k1 loaded up later */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 178 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 179 | LONG_L $28, VCPU_R28(k1) |
| 180 | LONG_L $29, VCPU_R29(k1) |
| 181 | LONG_L $30, VCPU_R30(k1) |
| 182 | LONG_L $31, VCPU_R31(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 183 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 184 | /* Restore hi/lo */ |
| 185 | LONG_L k0, VCPU_LO(k1) |
| 186 | mtlo k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 187 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 188 | LONG_L k0, VCPU_HI(k1) |
| 189 | mthi k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 190 | |
| 191 | FEXPORT(__kvm_mips_load_k0k1) |
| 192 | /* Restore the guest's k0/k1 registers */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 193 | LONG_L k0, VCPU_R26(k1) |
| 194 | LONG_L k1, VCPU_R27(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 195 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 196 | /* Jump to guest */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 197 | eret |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 198 | |
| 199 | VECTOR(MIPSX(exception), unknown) |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 200 | /* Find out what mode we came from and jump to the proper handler. */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 201 | mtc0 k0, CP0_ERROREPC #01: Save guest k0 |
| 202 | ehb #02: |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 203 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 204 | mfc0 k0, CP0_EBASE #02: Get EBASE |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 205 | INT_SRL k0, k0, 10 #03: Get rid of CPUNum |
| 206 | INT_SLL k0, k0, 10 #04 |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 207 | LONG_S k1, 0x3000(k0) #05: Save k1 @ offset 0x3000 |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 208 | INT_ADDIU k0, k0, 0x2000 #06: Exception handler is |
| 209 | # installed @ offset 0x2000 |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 210 | j k0 #07: jump to the function |
| 211 | nop #08: branch delay slot |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 212 | VECTOR_END(MIPSX(exceptionEnd)) |
| 213 | .end MIPSX(exception) |
| 214 | |
| 215 | /* |
| 216 | * Generic Guest exception handler. We end up here when the guest |
| 217 | * does something that causes a trap to kernel mode. |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 218 | */ |
| 219 | NESTED (MIPSX(GuestException), CALLFRAME_SIZ, ra) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 220 | /* Get the VCPU pointer from DDTATA_LO */ |
| 221 | mfc0 k1, CP0_DDATA_LO |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 222 | INT_ADDIU k1, k1, VCPU_HOST_ARCH |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 223 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 224 | /* Start saving Guest context to VCPU */ |
| 225 | LONG_S $0, VCPU_R0(k1) |
| 226 | LONG_S $1, VCPU_R1(k1) |
| 227 | LONG_S $2, VCPU_R2(k1) |
| 228 | LONG_S $3, VCPU_R3(k1) |
| 229 | LONG_S $4, VCPU_R4(k1) |
| 230 | LONG_S $5, VCPU_R5(k1) |
| 231 | LONG_S $6, VCPU_R6(k1) |
| 232 | LONG_S $7, VCPU_R7(k1) |
| 233 | LONG_S $8, VCPU_R8(k1) |
| 234 | LONG_S $9, VCPU_R9(k1) |
| 235 | LONG_S $10, VCPU_R10(k1) |
| 236 | LONG_S $11, VCPU_R11(k1) |
| 237 | LONG_S $12, VCPU_R12(k1) |
| 238 | LONG_S $13, VCPU_R13(k1) |
| 239 | LONG_S $14, VCPU_R14(k1) |
| 240 | LONG_S $15, VCPU_R15(k1) |
| 241 | LONG_S $16, VCPU_R16(k1) |
| 242 | LONG_S $17, VCPU_R17(k1) |
| 243 | LONG_S $18, VCPU_R18(k1) |
| 244 | LONG_S $19, VCPU_R19(k1) |
| 245 | LONG_S $20, VCPU_R20(k1) |
| 246 | LONG_S $21, VCPU_R21(k1) |
| 247 | LONG_S $22, VCPU_R22(k1) |
| 248 | LONG_S $23, VCPU_R23(k1) |
| 249 | LONG_S $24, VCPU_R24(k1) |
| 250 | LONG_S $25, VCPU_R25(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 251 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 252 | /* Guest k0/k1 saved later */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 253 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 254 | LONG_S $28, VCPU_R28(k1) |
| 255 | LONG_S $29, VCPU_R29(k1) |
| 256 | LONG_S $30, VCPU_R30(k1) |
| 257 | LONG_S $31, VCPU_R31(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 258 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 259 | /* We need to save hi/lo and restore them on the way out */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 260 | mfhi t0 |
| 261 | LONG_S t0, VCPU_HI(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 262 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 263 | mflo t0 |
| 264 | LONG_S t0, VCPU_LO(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 265 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 266 | /* Finally save guest k0/k1 to VCPU */ |
| 267 | mfc0 t0, CP0_ERROREPC |
| 268 | LONG_S t0, VCPU_R26(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 269 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 270 | /* Get GUEST k1 and save it in VCPU */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 271 | PTR_LI t1, ~0x2ff |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 272 | mfc0 t0, CP0_EBASE |
| 273 | and t0, t0, t1 |
| 274 | LONG_L t0, 0x3000(t0) |
| 275 | LONG_S t0, VCPU_R27(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 276 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 277 | /* Now that context has been saved, we can use other registers */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 278 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 279 | /* Restore vcpu */ |
| 280 | mfc0 a1, CP0_DDATA_LO |
| 281 | move s1, a1 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 282 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 283 | /* Restore run (vcpu->run) */ |
| 284 | LONG_L a0, VCPU_RUN(a1) |
| 285 | /* Save pointer to run in s0, will be saved by the compiler */ |
| 286 | move s0, a0 |
| 287 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 288 | /* |
| 289 | * Save Host level EPC, BadVaddr and Cause to VCPU, useful to |
| 290 | * process the exception |
| 291 | */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 292 | mfc0 k0,CP0_EPC |
| 293 | LONG_S k0, VCPU_PC(k1) |
| 294 | |
| 295 | mfc0 k0, CP0_BADVADDR |
| 296 | LONG_S k0, VCPU_HOST_CP0_BADVADDR(k1) |
| 297 | |
| 298 | mfc0 k0, CP0_CAUSE |
| 299 | LONG_S k0, VCPU_HOST_CP0_CAUSE(k1) |
| 300 | |
| 301 | mfc0 k0, CP0_ENTRYHI |
| 302 | LONG_S k0, VCPU_HOST_ENTRYHI(k1) |
| 303 | |
| 304 | /* Now restore the host state just enough to run the handlers */ |
| 305 | |
James Hogan | caa1faa | 2015-12-16 23:49:26 +0000 | [diff] [blame] | 306 | /* Switch EBASE to the one used by Linux */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 307 | /* load up the host EBASE */ |
| 308 | mfc0 v0, CP0_STATUS |
| 309 | |
| 310 | .set at |
| 311 | or k0, v0, ST0_BEV |
| 312 | .set noat |
| 313 | |
| 314 | mtc0 k0, CP0_STATUS |
| 315 | ehb |
| 316 | |
| 317 | LONG_L k0, VCPU_HOST_EBASE(k1) |
| 318 | mtc0 k0,CP0_EBASE |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 319 | |
James Hogan | 98e91b8 | 2014-11-18 14:09:12 +0000 | [diff] [blame] | 320 | /* |
| 321 | * If FPU is enabled, save FCR31 and clear it so that later ctc1's don't |
| 322 | * trigger FPE for pending exceptions. |
| 323 | */ |
| 324 | .set at |
| 325 | and v1, v0, ST0_CU1 |
| 326 | beqz v1, 1f |
| 327 | nop |
| 328 | .set push |
| 329 | SET_HARDFLOAT |
| 330 | cfc1 t0, fcr31 |
| 331 | sw t0, VCPU_FCR31(k1) |
| 332 | ctc1 zero,fcr31 |
| 333 | .set pop |
| 334 | .set noat |
| 335 | 1: |
| 336 | |
James Hogan | 539cb89fb | 2015-03-05 11:43:36 +0000 | [diff] [blame] | 337 | #ifdef CONFIG_CPU_HAS_MSA |
| 338 | /* |
| 339 | * If MSA is enabled, save MSACSR and clear it so that later |
| 340 | * instructions don't trigger MSAFPE for pending exceptions. |
| 341 | */ |
| 342 | mfc0 t0, CP0_CONFIG3 |
| 343 | ext t0, t0, 28, 1 /* MIPS_CONF3_MSAP */ |
| 344 | beqz t0, 1f |
| 345 | nop |
| 346 | mfc0 t0, CP0_CONFIG5 |
| 347 | ext t0, t0, 27, 1 /* MIPS_CONF5_MSAEN */ |
| 348 | beqz t0, 1f |
| 349 | nop |
| 350 | _cfcmsa t0, MSA_CSR |
| 351 | sw t0, VCPU_MSA_CSR(k1) |
| 352 | _ctcmsa MSA_CSR, zero |
| 353 | 1: |
| 354 | #endif |
| 355 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 356 | /* Now that the new EBASE has been loaded, unset BEV and KSU_USER */ |
| 357 | .set at |
| 358 | and v0, v0, ~(ST0_EXL | KSU_USER | ST0_IE) |
| 359 | or v0, v0, ST0_CU0 |
| 360 | .set noat |
| 361 | mtc0 v0, CP0_STATUS |
| 362 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 363 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 364 | /* Load up host GP */ |
| 365 | LONG_L gp, VCPU_HOST_GP(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 366 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 367 | /* Need a stack before we can jump to "C" */ |
| 368 | LONG_L sp, VCPU_HOST_STACK(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 369 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 370 | /* Saved host state */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 371 | INT_ADDIU sp, sp, -PT_SIZE |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 372 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 373 | /* |
| 374 | * XXXKYMA do we need to load the host ASID, maybe not because the |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 375 | * kernel entries are marked GLOBAL, need to verify |
| 376 | */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 377 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 378 | /* Restore host DDATA_LO */ |
| 379 | LONG_L k0, PT_HOST_USERLOCAL(sp) |
| 380 | mtc0 k0, CP0_DDATA_LO |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 381 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 382 | /* Restore RDHWR access */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 383 | PTR_LI k0, 0x2000000F |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 384 | mtc0 k0, CP0_HWRENA |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 385 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 386 | /* Jump to handler */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 387 | FEXPORT(__kvm_mips_jump_to_handler) |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 388 | /* |
| 389 | * XXXKYMA: not sure if this is safe, how large is the stack?? |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 390 | * Now jump to the kvm_mips_handle_exit() to see if we can deal |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 391 | * with this in the kernel |
| 392 | */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 393 | PTR_LA t9, kvm_mips_handle_exit |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 394 | jalr.hb t9 |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 395 | INT_ADDIU sp, sp, -CALLFRAME_SIZ /* BD Slot */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 396 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 397 | /* Return from handler Make sure interrupts are disabled */ |
| 398 | di |
| 399 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 400 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 401 | /* |
| 402 | * XXXKYMA: k0/k1 could have been blown away if we processed |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 403 | * an exception while we were handling the exception from the |
| 404 | * guest, reload k1 |
| 405 | */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 406 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 407 | move k1, s1 |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 408 | INT_ADDIU k1, k1, VCPU_HOST_ARCH |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 409 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 410 | /* |
| 411 | * Check return value, should tell us if we are returning to the |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 412 | * host (handle I/O etc)or resuming the guest |
| 413 | */ |
| 414 | andi t0, v0, RESUME_HOST |
| 415 | bnez t0, __kvm_mips_return_to_host |
| 416 | nop |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 417 | |
| 418 | __kvm_mips_return_to_guest: |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 419 | /* Put the saved pointer to vcpu (s1) back into the DDATA_LO Register */ |
| 420 | mtc0 s1, CP0_DDATA_LO |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 421 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 422 | /* Load up the Guest EBASE to minimize the window where BEV is set */ |
| 423 | LONG_L t0, VCPU_GUEST_EBASE(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 424 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 425 | /* Switch EBASE back to the one used by KVM */ |
| 426 | mfc0 v1, CP0_STATUS |
| 427 | .set at |
| 428 | or k0, v1, ST0_BEV |
| 429 | .set noat |
| 430 | mtc0 k0, CP0_STATUS |
| 431 | ehb |
| 432 | mtc0 t0, CP0_EBASE |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 433 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 434 | /* Setup status register for running guest in UM */ |
| 435 | .set at |
| 436 | or v1, v1, (ST0_EXL | KSU_USER | ST0_IE) |
James Hogan | f798217 | 2015-02-04 17:06:37 +0000 | [diff] [blame] | 437 | and v1, v1, ~(ST0_CU0 | ST0_MX) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 438 | .set noat |
| 439 | mtc0 v1, CP0_STATUS |
| 440 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 441 | |
| 442 | /* Set Guest EPC */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 443 | LONG_L t0, VCPU_PC(k1) |
| 444 | mtc0 t0, CP0_EPC |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 445 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 446 | /* Set the ASID for the Guest Kernel */ |
James Hogan | 002374f | 2015-11-11 14:21:18 +0000 | [diff] [blame] | 447 | PTR_L t0, VCPU_COP0(k1) |
| 448 | LONG_L t0, COP0_STATUS(t0) |
| 449 | andi t0, KSU_USER | ST0_ERL | ST0_EXL |
| 450 | xori t0, KSU_USER |
| 451 | bnez t0, 1f /* If kernel */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 452 | INT_ADDIU t1, k1, VCPU_GUEST_KERNEL_ASID /* (BD) */ |
| 453 | INT_ADDIU t1, k1, VCPU_GUEST_USER_ASID /* else user */ |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 454 | 1: |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 455 | /* t1: contains the base of the ASID array, need to get the cpu id */ |
| 456 | LONG_L t2, TI_CPU($28) /* smp_processor_id */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 457 | INT_SLL t2, t2, 2 /* x4 */ |
| 458 | REG_ADDU t3, t1, t2 |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 459 | LONG_L k0, (t3) |
James Hogan | 9b5c339 | 2016-05-06 14:36:19 +0100 | [diff] [blame] | 460 | andi k0, k0, MIPS_ENTRYHI_ASID |
James Hogan | caa1faa | 2015-12-16 23:49:26 +0000 | [diff] [blame] | 461 | mtc0 k0, CP0_ENTRYHI |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 462 | ehb |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 463 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 464 | /* Disable RDHWR access */ |
James Hogan | caa1faa | 2015-12-16 23:49:26 +0000 | [diff] [blame] | 465 | mtc0 zero, CP0_HWRENA |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 466 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 467 | /* load the guest context from VCPU and return */ |
| 468 | LONG_L $0, VCPU_R0(k1) |
| 469 | LONG_L $1, VCPU_R1(k1) |
| 470 | LONG_L $2, VCPU_R2(k1) |
| 471 | LONG_L $3, VCPU_R3(k1) |
| 472 | LONG_L $4, VCPU_R4(k1) |
| 473 | LONG_L $5, VCPU_R5(k1) |
| 474 | LONG_L $6, VCPU_R6(k1) |
| 475 | LONG_L $7, VCPU_R7(k1) |
| 476 | LONG_L $8, VCPU_R8(k1) |
| 477 | LONG_L $9, VCPU_R9(k1) |
| 478 | LONG_L $10, VCPU_R10(k1) |
| 479 | LONG_L $11, VCPU_R11(k1) |
| 480 | LONG_L $12, VCPU_R12(k1) |
| 481 | LONG_L $13, VCPU_R13(k1) |
| 482 | LONG_L $14, VCPU_R14(k1) |
| 483 | LONG_L $15, VCPU_R15(k1) |
| 484 | LONG_L $16, VCPU_R16(k1) |
| 485 | LONG_L $17, VCPU_R17(k1) |
| 486 | LONG_L $18, VCPU_R18(k1) |
| 487 | LONG_L $19, VCPU_R19(k1) |
| 488 | LONG_L $20, VCPU_R20(k1) |
| 489 | LONG_L $21, VCPU_R21(k1) |
| 490 | LONG_L $22, VCPU_R22(k1) |
| 491 | LONG_L $23, VCPU_R23(k1) |
| 492 | LONG_L $24, VCPU_R24(k1) |
| 493 | LONG_L $25, VCPU_R25(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 494 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 495 | /* $/k1 loaded later */ |
| 496 | LONG_L $28, VCPU_R28(k1) |
| 497 | LONG_L $29, VCPU_R29(k1) |
| 498 | LONG_L $30, VCPU_R30(k1) |
| 499 | LONG_L $31, VCPU_R31(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 500 | |
| 501 | FEXPORT(__kvm_mips_skip_guest_restore) |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 502 | LONG_L k0, VCPU_HI(k1) |
| 503 | mthi k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 504 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 505 | LONG_L k0, VCPU_LO(k1) |
| 506 | mtlo k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 507 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 508 | LONG_L k0, VCPU_R26(k1) |
| 509 | LONG_L k1, VCPU_R27(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 510 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 511 | eret |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 512 | |
| 513 | __kvm_mips_return_to_host: |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 514 | /* EBASE is already pointing to Linux */ |
| 515 | LONG_L k1, VCPU_HOST_STACK(k1) |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 516 | INT_ADDIU k1,k1, -PT_SIZE |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 517 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 518 | /* Restore host DDATA_LO */ |
| 519 | LONG_L k0, PT_HOST_USERLOCAL(k1) |
| 520 | mtc0 k0, CP0_DDATA_LO |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 521 | |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 522 | /* |
| 523 | * r2/v0 is the return code, shift it down by 2 (arithmetic) |
| 524 | * to recover the err code |
| 525 | */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 526 | INT_SRA k0, v0, 2 |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 527 | move $2, k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 528 | |
James Hogan | 1300fcd | 2016-05-06 14:36:21 +0100 | [diff] [blame^] | 529 | /* Load context saved on the host stack */ |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 530 | LONG_L $16, PT_R16(k1) |
| 531 | LONG_L $17, PT_R17(k1) |
| 532 | LONG_L $18, PT_R18(k1) |
| 533 | LONG_L $19, PT_R19(k1) |
| 534 | LONG_L $20, PT_R20(k1) |
| 535 | LONG_L $21, PT_R21(k1) |
| 536 | LONG_L $22, PT_R22(k1) |
| 537 | LONG_L $23, PT_R23(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 538 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 539 | LONG_L $28, PT_R28(k1) |
| 540 | LONG_L $29, PT_R29(k1) |
| 541 | LONG_L $30, PT_R30(k1) |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 542 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 543 | LONG_L k0, PT_HI(k1) |
| 544 | mthi k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 545 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 546 | LONG_L k0, PT_LO(k1) |
| 547 | mtlo k0 |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 548 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 549 | /* Restore RDHWR access */ |
David Daney | ea69f28 | 2013-08-01 13:22:35 -0700 | [diff] [blame] | 550 | PTR_LI k0, 0x2000000F |
James Hogan | caa1faa | 2015-12-16 23:49:26 +0000 | [diff] [blame] | 551 | mtc0 k0, CP0_HWRENA |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 552 | |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 553 | /* Restore RA, which is the address we will return to */ |
James Hogan | caa1faa | 2015-12-16 23:49:26 +0000 | [diff] [blame] | 554 | LONG_L ra, PT_R31(k1) |
| 555 | j ra |
David Daney | 2c07ebb | 2013-08-01 13:22:33 -0700 | [diff] [blame] | 556 | nop |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 557 | |
Sanjay Lal | b680f70 | 2012-11-21 18:34:01 -0800 | [diff] [blame] | 558 | VECTOR_END(MIPSX(GuestExceptionEnd)) |
| 559 | .end MIPSX(GuestException) |
| 560 | |
| 561 | MIPSX(exceptions): |
| 562 | #### |
| 563 | ##### The exception handlers. |
| 564 | ##### |
| 565 | .word _C_LABEL(MIPSX(GuestException)) # 0 |
| 566 | .word _C_LABEL(MIPSX(GuestException)) # 1 |
| 567 | .word _C_LABEL(MIPSX(GuestException)) # 2 |
| 568 | .word _C_LABEL(MIPSX(GuestException)) # 3 |
| 569 | .word _C_LABEL(MIPSX(GuestException)) # 4 |
| 570 | .word _C_LABEL(MIPSX(GuestException)) # 5 |
| 571 | .word _C_LABEL(MIPSX(GuestException)) # 6 |
| 572 | .word _C_LABEL(MIPSX(GuestException)) # 7 |
| 573 | .word _C_LABEL(MIPSX(GuestException)) # 8 |
| 574 | .word _C_LABEL(MIPSX(GuestException)) # 9 |
| 575 | .word _C_LABEL(MIPSX(GuestException)) # 10 |
| 576 | .word _C_LABEL(MIPSX(GuestException)) # 11 |
| 577 | .word _C_LABEL(MIPSX(GuestException)) # 12 |
| 578 | .word _C_LABEL(MIPSX(GuestException)) # 13 |
| 579 | .word _C_LABEL(MIPSX(GuestException)) # 14 |
| 580 | .word _C_LABEL(MIPSX(GuestException)) # 15 |
| 581 | .word _C_LABEL(MIPSX(GuestException)) # 16 |
| 582 | .word _C_LABEL(MIPSX(GuestException)) # 17 |
| 583 | .word _C_LABEL(MIPSX(GuestException)) # 18 |
| 584 | .word _C_LABEL(MIPSX(GuestException)) # 19 |
| 585 | .word _C_LABEL(MIPSX(GuestException)) # 20 |
| 586 | .word _C_LABEL(MIPSX(GuestException)) # 21 |
| 587 | .word _C_LABEL(MIPSX(GuestException)) # 22 |
| 588 | .word _C_LABEL(MIPSX(GuestException)) # 23 |
| 589 | .word _C_LABEL(MIPSX(GuestException)) # 24 |
| 590 | .word _C_LABEL(MIPSX(GuestException)) # 25 |
| 591 | .word _C_LABEL(MIPSX(GuestException)) # 26 |
| 592 | .word _C_LABEL(MIPSX(GuestException)) # 27 |
| 593 | .word _C_LABEL(MIPSX(GuestException)) # 28 |
| 594 | .word _C_LABEL(MIPSX(GuestException)) # 29 |
| 595 | .word _C_LABEL(MIPSX(GuestException)) # 30 |
| 596 | .word _C_LABEL(MIPSX(GuestException)) # 31 |