From patchwork Wed Oct 6 19:44:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Load primitive in linux-user/signal.c X-Patchwork-Submitter: =?utf-8?Q?Llu=C3=ADs?= X-Patchwork-Id: 66964 Message-Id: <87fwwj14ye.fsf@ginnungagap.bsc.es> To: qemu-devel@nongnu.org Date: Wed, 06 Oct 2010 21:44:41 +0200 From: xscript@gmx.net (=?utf-8?Q?Llu=C3=ADs?=) List-Id: qemu-devel.nongnu.org I'm still not very tuned-in into the code, but I think this piece should use _raw access primitives: I triggered it while capturing "lduw" and the like in both softmmu and linux-user to intercept memory access information coming from non-generated code (I'm not capturing neither _raw nor _code, as they do not seem to relate to "real" memory access events on the guest). What I've found is that this is the only place where a ld* primitive is not being passed a "target_ulong" as argument. Thanks, Lluis diff --git a/linux-user/signal.c b/linux-user/signal.c index 77683f7..097da9d 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -982,8 +982,8 @@ restore_sigcontext(CPUX86State *env, struct target_sigcontext *sc, int *peax) env->regs[R_ECX] = tswapl(sc->ecx); env->eip = tswapl(sc->eip); - cpu_x86_load_seg(env, R_CS, lduw(&sc->cs) | 3); - cpu_x86_load_seg(env, R_SS, lduw(&sc->ss) | 3); + cpu_x86_load_seg(env, R_CS, lduw_raw(&sc->cs) | 3); + cpu_x86_load_seg(env, R_SS, lduw_raw(&sc->ss) | 3); tmpflags = tswapl(sc->eflags); env->eflags = (env->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);