From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSYDe-0006Jt-2r for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:54:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSYDZ-0006F2-BM for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:54:45 -0500 Received: from [199.232.76.173] (port=54457 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSYDY-0006EX-Ps for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:54:40 -0500 Received: from mail-px0-f189.google.com ([209.85.216.189]:57336) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSYDY-0006ua-C4 for qemu-devel@nongnu.org; Wed, 06 Jan 2010 10:54:40 -0500 Received: by pxi27 with SMTP id 27so10985327pxi.4 for ; Wed, 06 Jan 2010 07:54:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20100105231923.6526.22283.stgit@skyserv> References: <20100105231558.6526.44483.stgit@skyserv> <20100105231923.6526.22283.stgit@skyserv> From: Blue Swirl Date: Wed, 6 Jan 2010 15:54:19 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 4/9] sparc64: check for pending irq when pil, pstate or softint is changed Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Igor V. Kovalenko" Cc: qemu-devel@nongnu.org On Tue, Jan 5, 2010 at 11:19 PM, Igor V. Kovalenko wrote: > From: Igor V. Kovalenko > > Signed-off-by: Igor V. Kovalenko > --- > =C2=A0target-sparc/op_helper.c | =C2=A0 39 ++++++++++++++++++++++++++++++= ++++++--- > =C2=A01 files changed, 36 insertions(+), 3 deletions(-) > > diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c > index a7da0e4..b1978cb 100644 > --- a/target-sparc/op_helper.c > +++ b/target-sparc/op_helper.c > @@ -3301,6 +3301,12 @@ static inline void change_pstate(uint64_t new_psta= te) > =C2=A0void helper_wrpstate(target_ulong new_state) > =C2=A0{ > =C2=A0 =C2=A0 change_pstate(new_state & 0xf3f); > + > +#if !defined(CONFIG_USER_ONLY) > + =C2=A0 =C2=A0if (env->pstate & PS_IE) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_check_irqs(env); > + =C2=A0 =C2=A0} > +#endif > =C2=A0} > > =C2=A0void helper_wrpil(target_ulong new_pil) > @@ -3328,6 +3334,14 @@ void helper_done(void) > =C2=A0 =C2=A0 change_pstate((tsptr->tstate >> 8) & 0xf3f); > =C2=A0 =C2=A0 PUT_CWP64(env, tsptr->tstate & 0xff); > =C2=A0 =C2=A0 env->tl--; > + > + =C2=A0 =C2=A0DPRINTF_PSTATE("... helper_done tl=3D%d\n", env->tl); > + > +#if !defined(CONFIG_USER_ONLY) > + =C2=A0 =C2=A0if (env->pstate & PS_IE) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_check_irqs(env); > + =C2=A0 =C2=A0} > +#endif > =C2=A0} > > =C2=A0void helper_retry(void) > @@ -3341,21 +3355,40 @@ void helper_retry(void) > =C2=A0 =C2=A0 change_pstate((tsptr->tstate >> 8) & 0xf3f); > =C2=A0 =C2=A0 PUT_CWP64(env, tsptr->tstate & 0xff); > =C2=A0 =C2=A0 env->tl--; > + > + =C2=A0 =C2=A0DPRINTF_PSTATE("... helper_retry tl=3D%d\n", env->tl); > + > +#if !defined(CONFIG_USER_ONLY) > + =C2=A0 =C2=A0if (env->pstate & PS_IE) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0cpu_check_irqs(env); > + =C2=A0 =C2=A0} > +#endif > +} > + > +static void do_modify_softint(const char* operation, uint32_t value) > +{ > + =C2=A0 =C2=A0if (env->softint !=3D value) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0env->softint =3D value; > + =C2=A0 =C2=A0 =C2=A0 =C2=A0DPRINTF_PSTATE(": %s new %08X\n", operation,= env->softint); Uppercase hex again. Otherwise the patch looks OK. Maybe the #if CONFIG_USER_ONLY/#endif could be avoided if cpu_check_irqs would be #defined as a dummy macro for CONFIG_USER_ONLY in cpu.h.