From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X72x8-0006CP-KA for qemu-devel@nongnu.org; Tue, 15 Jul 2014 09:39:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X72x2-0002MO-Nu for qemu-devel@nongnu.org; Tue, 15 Jul 2014 09:39:30 -0400 Received: from afflict.kos.to ([92.243.29.197]:37163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X72x2-0002M7-I6 for qemu-devel@nongnu.org; Tue, 15 Jul 2014 09:39:24 -0400 Date: Tue, 15 Jul 2014 16:39:23 +0300 From: Riku Voipio Message-ID: <20140715133923.GE607@afflict.kos.to> References: <1405007407-23549-1-git-send-email-alex.bennee@linaro.org> <1405007407-23549-7-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1405007407-23549-7-git-send-email-alex.bennee@linaro.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 06/10] linux-user/main.c: __kernel_cmpxchg set env->CF directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex =?utf-8?Q?Benn=C3=A9e?= Cc: Riku Voipio , qemu-devel@nongnu.org On Thu, Jul 10, 2014 at 04:50:03PM +0100, Alex Benn=C3=A9e wrote: > As we only need to manipulate the single flag do it directly though env= . Acked-by: Riku Voipio > Signed-off-by: Alex Benn=C3=A9e >=20 > --- >=20 > v2: > - remove unused cpsr > - the direct flag setting seems a little hacky? >=20 > diff --git a/linux-user/main.c b/linux-user/main.c > index 8848e15..9101541 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -468,7 +468,7 @@ void cpu_loop(CPUX86State *env) > static void arm_kernel_cmpxchg64_helper(CPUARMState *env) > { > uint64_t oldval, newval, val; > - uint32_t addr, cpsr; > + uint32_t addr; > target_siginfo_t info; > =20 > /* Based on the 32 bit code in do_kernel_trap */ > @@ -478,7 +478,6 @@ static void arm_kernel_cmpxchg64_helper(CPUARMState= *env) > operations. However things like ldrex/strex are much harder so > there's not much point trying. */ > start_exclusive(); > - cpsr =3D cpsr_read(env); > addr =3D env->regs[2]; > =20 > if (get_user_u64(oldval, env->regs[0])) { > @@ -505,12 +504,11 @@ static void arm_kernel_cmpxchg64_helper(CPUARMSta= te *env) > }; > =20 > env->regs[0] =3D 0; > - cpsr |=3D CPSR_C; > + env->CF =3D 1; > } else { > env->regs[0] =3D -1; > - cpsr &=3D ~CPSR_C; > + env->CF =3D 0; > } > - cpsr_write(env, cpsr, CPSR_C); > end_exclusive(); > return; > =20 > @@ -533,7 +531,6 @@ static int > do_kernel_trap(CPUARMState *env) > { > uint32_t addr; > - uint32_t cpsr; > uint32_t val; > =20 > switch (env->regs[15]) { > @@ -546,7 +543,6 @@ do_kernel_trap(CPUARMState *env) > operations. However things like ldrex/strex are much harde= r so > there's not much point trying. */ > start_exclusive(); > - cpsr =3D save_state_to_spsr(env); > addr =3D env->regs[2]; > /* FIXME: This should SEGV if the access fails. */ > if (get_user_u32(val, addr)) > @@ -556,12 +552,11 @@ do_kernel_trap(CPUARMState *env) > /* FIXME: Check for segfaults. */ > put_user_u32(val, addr); > env->regs[0] =3D 0; > - cpsr |=3D CPSR_C; > + env->CF =3D 1; > } else { > env->regs[0] =3D -1; > - cpsr &=3D ~CPSR_C; > + env->CF =3D 0; > } > - cpsr_write(env, cpsr, CPSR_C); > end_exclusive(); > break; > case 0xffff0fe0: /* __kernel_get_tls */ > --=20 > 2.0.1 >=20