* [Qemu-devel] [PATCH] Check if we really are in userspace
@ 2006-02-16 16:41 Thiemo Seufer
2006-03-11 16:07 ` Paul Brook
0 siblings, 1 reply; 2+ messages in thread
From: Thiemo Seufer @ 2006-02-16 16:41 UTC (permalink / raw)
To: qemu-devel
Hello All,
this tests for MIPS if we are in userspace when handling a TLB fault.
For some of the other architectures this may also be a bug, only
ppc and x86 handle this so far.
Thiemo
Index: cpu-exec.c
===================================================================
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.73
diff -u -p -r1.73 cpu-exec.c
--- cpu-exec.c 8 Feb 2006 22:43:39 -0000 1.73
+++ cpu-exec.c 16 Feb 2006 15:21:03 -0000
@@ -1089,7 +1089,9 @@ static inline int handle_cpu_signal(unsi
}
/* see if it is an MMU fault */
- ret = cpu_mips_handle_mmu_fault(env, address, is_write, 1, 0);
+ ret = cpu_mips_handle_mmu_fault(env, address, is_write,
+ ((env->hflags & MIPS_HFLAG_MODE)
+ == MIPS_HFLAG_UM), 0);
if (ret < 0)
return 0; /* not an MMU fault */
if (ret == 0)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Check if we really are in userspace
2006-02-16 16:41 [Qemu-devel] [PATCH] Check if we really are in userspace Thiemo Seufer
@ 2006-03-11 16:07 ` Paul Brook
0 siblings, 0 replies; 2+ messages in thread
From: Paul Brook @ 2006-03-11 16:07 UTC (permalink / raw)
To: qemu-devel
> Index: cpu-exec.c
> ===================================================================
> RCS file: /sources/qemu/qemu/cpu-exec.c,v
> retrieving revision 1.73
> diff -u -p -r1.73 cpu-exec.c
> --- cpu-exec.c 8 Feb 2006 22:43:39 -0000 1.73
> +++ cpu-exec.c 16 Feb 2006 15:21:03 -0000
> @@ -1089,7 +1089,9 @@ static inline int handle_cpu_signal(unsi
> }
>
> /* see if it is an MMU fault */
> - ret = cpu_mips_handle_mmu_fault(env, address, is_write, 1, 0);
> + ret = cpu_mips_handle_mmu_fault(env, address, is_write,
> + ((env->hflags & MIPS_HFLAG_MODE)
> + == MIPS_HFLAG_UM), 0);
> if (ret < 0)
> return 0; /* not an MMU fault */
> if (ret == 0)
This code is only used when !defined(CONFIG_SOFTMMU), ie. usermode emulation.
The i386 code is a leftover of the now-dead qemu-fast. Presumably the ppc code
was just copied from these.
Paul
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-11 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16 16:41 [Qemu-devel] [PATCH] Check if we really are in userspace Thiemo Seufer
2006-03-11 16:07 ` Paul Brook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).