Commit ca7c2b1b9f984f622c7495004483016fee61e489
1 parent
7d600c80
Handle invalid accesses as SIGILL for mips/mipsel userland emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2235 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
12 additions
and
0 deletions
linux-user/main.c
target-mips/helper.c
... | ... | @@ -243,6 +243,12 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, |
243 | 243 | return ret; |
244 | 244 | } |
245 | 245 | |
246 | +#if defined(CONFIG_USER_ONLY) | |
247 | +void do_interrupt (CPUState *env) | |
248 | +{ | |
249 | + env->exception_index = EXCP_NONE; | |
250 | +} | |
251 | +#else | |
246 | 252 | void do_interrupt (CPUState *env) |
247 | 253 | { |
248 | 254 | target_ulong offset; |
... | ... | @@ -409,3 +415,4 @@ void do_interrupt (CPUState *env) |
409 | 415 | } |
410 | 416 | env->exception_index = EXCP_NONE; |
411 | 417 | } |
418 | +#endif /* !defined(CONFIG_USER_ONLY) */ | ... | ... |
target-mips/translate.c
... | ... | @@ -4072,6 +4072,7 @@ void cpu_reset (CPUMIPSState *env) |
4072 | 4072 | tlb_flush(env, 1); |
4073 | 4073 | |
4074 | 4074 | /* Minimal init */ |
4075 | +#if !defined(CONFIG_USER_ONLY) | |
4075 | 4076 | if (env->hflags & MIPS_HFLAG_BMASK) { |
4076 | 4077 | /* If the exception was raised from a delay slot, |
4077 | 4078 | * come back to the jump. */ |
... | ... | @@ -4098,9 +4099,11 @@ void cpu_reset (CPUMIPSState *env) |
4098 | 4099 | /* Count register increments in debug mode, EJTAG version 1 */ |
4099 | 4100 | env->CP0_Debug = (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); |
4100 | 4101 | env->CP0_PRid = MIPS_CPU; |
4102 | +#endif | |
4101 | 4103 | env->exception_index = EXCP_NONE; |
4102 | 4104 | #if defined(CONFIG_USER_ONLY) |
4103 | 4105 | env->hflags |= MIPS_HFLAG_UM; |
4106 | + env->user_mode_only = 1; | |
4104 | 4107 | #endif |
4105 | 4108 | #ifdef MIPS_USES_FPU |
4106 | 4109 | env->fcr0 = MIPS_FCR0; | ... | ... |