From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr9fr-0000JM-H8 for qemu-devel@nongnu.org; Fri, 04 Jan 2013 10:59:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tr9fo-00024S-Tb for qemu-devel@nongnu.org; Fri, 04 Jan 2013 10:59:11 -0500 Date: Fri, 4 Jan 2013 09:58:52 -0600 From: Scott Wood References: <1356671812-7634-1-git-send-email-bharat.bhushan@freescale.com> <1356671812-7634-3-git-send-email-bharat.bhushan@freescale.com> <1357244451.22404.8@snotra> <6A3DF150A5B70D4F9B66A25E3F7C888D06542853@039-SN2MPN1-022.039d.mgd.msft.net> In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D06542853@039-SN2MPN1-022.039d.mgd.msft.net> (from R65777@freescale.com on Thu Jan 3 19:28:49 2013) Message-ID: <1357315132.666.3@snotra> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/3 v2] Reset qemu timers when guest reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bhushan Bharat-R65777 Cc: Wood Scott-B07421 , "qemu-ppc@nongnu.org" , "qemu-devel@nongnu.org" , "agraf@suse.de" On 01/03/2013 07:28:49 PM, Bhushan Bharat-R65777 wrote: >=20 >=20 > > -----Original Message----- > > From: Wood Scott-B07421 > > Sent: Friday, January 04, 2013 1:51 AM > > To: Bhushan Bharat-R65777 > > Cc: qemu-devel@nongnu.org; qemu-ppc@nongnu.org; agraf@suse.de; =20 > Bhushan Bharat- > > R65777 > > Subject: Re: [Qemu-ppc] [PATCH 2/3 v2] Reset qemu timers when guest =20 > reset > > > > On 12/27/2012 11:16:51 PM, Bharat Bhushan wrote: > > > This patch install the timer reset handler. This will be called =20 > when > > > the guest is reset. > > > > > > Signed-off-by: Bharat Bhushan > > > --- > > > v2: same as v1 > > > > > > hw/ppc_booke.c | 12 ++++++++++++ > > > 1 files changed, 12 insertions(+), 0 deletions(-) > > > > > > diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c index =20 > d51e7fa..837a5b6 > > > 100644 > > > --- a/hw/ppc_booke.c > > > +++ b/hw/ppc_booke.c > > > @@ -231,6 +231,16 @@ void store_booke_tcr(CPUPPCState *env, > > > target_ulong val) > > > > > > } > > > > > > +static void ppc_booke_timer_reset_handle(void *opaque) { > > > + CPUPPCState *env =3D opaque; > > > + > > > + env->spr[SPR_BOOKE_TSR] =3D 0; > > > + env->spr[SPR_BOOKE_TCR] =3D 0; > > > + > > > + booke_update_irq(env); > > > +} > > > > When does KVM_SET_SREGS get called? >=20 > This is part of reset processing and is not cpu_synchronize_state() =20 > called before all reset handlers are called and after that =20 > post_synchronize will do the KVM_SET_SREGS in kvm_put_registers(). cpu_synchronize_state() does not do KVM_SET_SREGS. I don't see =20 "post_synchronize" anywhere in the QEMU sources. As Alex said, there needs to be a way for this function to set a flag =20 that TCR and TSR have been dirtied. -Scott=