pseries: Make RTAS time of day functions respect -rtc options
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 6 Feb 2015 03:55:50 +0000 (14:55 +1100)
committerAlexander Graf <agraf@suse.de>
Mon, 9 Mar 2015 13:59:58 +0000 (14:59 +0100)
commitf01c5d84775cfc877dc0b537565a168d043394e9
tree58184898968401715a880eaea6c2e42052dd563d
parente5dad1d7d1618822dbadb1dd12efa1b5674b6c40
pseries: Make RTAS time of day functions respect -rtc options

In the 'pseries' machine the real time clock is provided by a
paravirtualized firmware interface rather than a device per se; the RTAS
get-time-of-day and set-time-of-day calls.

Out current implementations of those work directly off host time (with
an offset), not respecting options such as clock=vm which can be
specified in the -rtc command line option.

This patch reworks the RTAS RTC code to respect those options, primarily
by basing them on the qemu_clock_get_ns(rtc_clock) function instead of
directly on qemu_get_timedate() (which essentially handles host time, not
virtual rtc time).

As a bonus, this means our get-time-of-day function now also returns
nanoseconds.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr_rtc.c