x86: Convert x86_platform_ops to timespec64
The x86 platform operations are fairly isolated, so it's easy to change them from using timespec to timespec64. It has been checked that all the users and callers are safe, and there is only one critical function that is broken beyond 2106: pvclock_read_wallclock() uses a 32-bit number of seconds since the epoch to communicate the boot time between host and guest in a virtual environment. This will work until 2106, but fixing this is outside the scope of this change, Add a comment at least. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Radim Krčmář <rkrcmar@redhat.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Juergen Gross <jgross@suse.com> Cc: jailhouse-dev@googlegroups.com Cc: Borislav Petkov <bp@suse.de> Cc: kvm@vger.kernel.org Cc: y2038@lists.linaro.org Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: xen-devel@lists.xenproject.org Cc: John Stultz <john.stultz@linaro.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Joao Martins <joao.m.martins@oracle.com> Link: https://lkml.kernel.org/r/20180427201435.3194219-1-arnd@arndb.de
This commit is contained in:

committed by
Thomas Gleixner

parent
06aa376903
commit
e27c49291a
@@ -39,7 +39,7 @@ EXPORT_SYMBOL(rtc_lock);
|
||||
* jump to the next second precisely 500 ms later. Check the Motorola
|
||||
* MC146818A or Dallas DS12887 data sheet for details.
|
||||
*/
|
||||
int mach_set_rtc_mmss(const struct timespec *now)
|
||||
int mach_set_rtc_mmss(const struct timespec64 *now)
|
||||
{
|
||||
unsigned long long nowtime = now->tv_sec;
|
||||
struct rtc_time tm;
|
||||
@@ -60,7 +60,7 @@ int mach_set_rtc_mmss(const struct timespec *now)
|
||||
return retval;
|
||||
}
|
||||
|
||||
void mach_get_cmos_time(struct timespec *now)
|
||||
void mach_get_cmos_time(struct timespec64 *now)
|
||||
{
|
||||
unsigned int status, year, mon, day, hour, min, sec, century = 0;
|
||||
unsigned long flags;
|
||||
@@ -118,7 +118,7 @@ void mach_get_cmos_time(struct timespec *now)
|
||||
} else
|
||||
year += CMOS_YEARS_OFFS;
|
||||
|
||||
now->tv_sec = mktime(year, mon, day, hour, min, sec);
|
||||
now->tv_sec = mktime64(year, mon, day, hour, min, sec);
|
||||
now->tv_nsec = 0;
|
||||
}
|
||||
|
||||
@@ -145,13 +145,13 @@ void rtc_cmos_write(unsigned char val, unsigned char addr)
|
||||
}
|
||||
EXPORT_SYMBOL(rtc_cmos_write);
|
||||
|
||||
int update_persistent_clock(struct timespec now)
|
||||
int update_persistent_clock64(struct timespec64 now)
|
||||
{
|
||||
return x86_platform.set_wallclock(&now);
|
||||
}
|
||||
|
||||
/* not static: needed by APM */
|
||||
void read_persistent_clock(struct timespec *ts)
|
||||
void read_persistent_clock64(struct timespec64 *ts)
|
||||
{
|
||||
x86_platform.get_wallclock(ts);
|
||||
}
|
||||
|
Reference in New Issue
Block a user