From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0hit-0006SY-JD for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0hio-00070s-Qo for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:51 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:57149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0hio-00070K-FO for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:46 -0500 Date: Tue, 16 Dec 2014 12:25:06 +1100 From: David Gibson Message-ID: <20141216012506.GI23547@voom.fritz.box> References: <1418690628-20652-1-git-send-email-david@gibson.dropbear.id.au> <1418690628-20652-3-git-send-email-david@gibson.dropbear.id.au> <548F8469.7020402@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Enx9fNJ0XV5HaWRu" Content-Disposition: inline In-Reply-To: <548F8469.7020402@suse.de> Subject: Re: [Qemu-devel] [PATCH 2/5] pseries: Add spapr_rtc_read() helper function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: aik@ozlabs.ru, paulus@samba.org, qemu-devel@nongnu.org, mdroth@us.ibm.com --Enx9fNJ0XV5HaWRu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 16, 2014 at 02:01:29AM +0100, Alexander Graf wrote: >=20 >=20 > On 16.12.14 01:43, David Gibson wrote: > > The virtual RTC time is used in two places in the pseries machine. Fir= st > > is in the RTAS get-time-of-day function which returns the RTC time to t= he > > guest. Second is in the spapr events code which is used to timestamp > > event messages from the hypervisor to the guest. > >=20 > > Currently both call qemu_get_timedate() directly, but we want to change > > that so we can properly handle the various -rtc options. In preparatio= n, > > create a helper function to return the virtual RTC time. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr_events.c | 2 +- > > hw/ppc/spapr_rtc.c | 12 ++++++++++-- > > include/hw/ppc/spapr.h | 1 + > > 3 files changed, 12 insertions(+), 3 deletions(-) > >=20 > > diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c > > index 1b6157d..80c0266 100644 > > --- a/hw/ppc/spapr_events.c > > +++ b/hw/ppc/spapr_events.c > > @@ -246,7 +246,7 @@ static void spapr_powerdown_req(Notifier *n, void *= opaque) > > maina->hdr.section_id =3D cpu_to_be16(RTAS_LOG_V6_SECTION_ID_MAINA= ); > > maina->hdr.section_length =3D cpu_to_be16(sizeof(*maina)); > > /* FIXME: section version, subtype and creator id? */ > > - qemu_get_timedate(&tm, spapr->rtc_offset); > > + spapr_rtc_read(spapr, &tm, NULL); > > year =3D tm.tm_year + 1900; > > maina->creation_date =3D cpu_to_be32((to_bcd(year / 100) << 24) > > | (to_bcd(year % 100) << 16) > > diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c > > index e290ac0..9ccefbc 100644 > > --- a/hw/ppc/spapr_rtc.c > > +++ b/hw/ppc/spapr_rtc.c > > @@ -29,19 +29,27 @@ > > #include "hw/ppc/spapr.h" > > #include "qapi-event.h" > > =20 > > +void spapr_rtc_read(sPAPREnvironment *spapr, struct tm *tm, uint32_t *= ns) > > +{ > > + qemu_get_timedate(tm, spapr->rtc_offset); > > + if (ns) >=20 > checkpatch? ;) Sod. It's been too long since I was doing much upstream work :). --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Enx9fNJ0XV5HaWRu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUj4nyAAoJEGw4ysog2bOSu+UQAJRftprvIcwkwAKtiv/ywGsQ ZkjU/pCRuxkZs9qiMFlEGAiZf88plTbU0sgBPOxd3mmdSU7pB9Picl0qWF2hHP63 IbbsayFYFkPEY1dhKFsEQVV7FULn+ZZbitE1Rl3p7X/jz+u+p6cQVCVgN7GL8rsf PppeO/NdbQzwfT5QTnRlMvqVBmFRLa1mYoygUdtxNIv20GapdOAjq2iVtXz/BhUr 3TQnaKFEKWTTPyKFKEDhoWPmUTKqKAJa2dN0sHYYIDJ9apD9oiKPlSw+f0I0LHZs QewhwGJue6f6SL1pooEn89TlWR4kd1x+inBGmyolaNNubaTZ17aVmfBV6fZO0KsL hMOUakYU6G4mbyBy06ZldF6ycHfq0UgjlFS+XmBGBx+gSenxzu3Jq9Oa0O9uZfCA 6Rveg+pYYdm4HdBx8obbfXX+BBBaK5p8K7+qQ1oK/uknjFpc2dO7OZeqqQuk+kyR Tyb6X4Aw0ZAyqF0I12sWCzQpQJBj0LRPH6cWCgX657HXc67PSW0IMAijAI/iAAOd 49OgSU/uCfcddCWoXL8KFM5rVYPYFve1KRkZl1pG9vAUDPR03jU6TeRPFWqA6T9/ lkQF2EA6d9MZ97wPvwWfBIA6uI1OMcsj6Km/MvIf29+ew3WhgKfOxVrXbGo9ioCj kR4iMrd6+KZcED1q3bnS =idjT -----END PGP SIGNATURE----- --Enx9fNJ0XV5HaWRu--