summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2017-03-19 23:10:23 +0000
committermlarkin <mlarkin@openbsd.org>2017-03-19 23:10:23 +0000
commitbfcb38280a290208c1369e14d40ad0dc7c6ecbb1 (patch)
treeb9a5901718dfcaf102cfd57a10b1d0eb5d2e5593
parentEmulated i8253 should not start out in TIMER_RATEGEN mode on boot (diff)
downloadwireguard-openbsd-bfcb38280a290208c1369e14d40ad0dc7c6ecbb1.tar.xz
wireguard-openbsd-bfcb38280a290208c1369e14d40ad0dc7c6ecbb1.zip
Don't identify the MC146818 RTC as operating in binary mode when we are really
operating in BCD mode. Linux assumes the RTC will be in BCD mode by default and if not, it does a WARN_ON warning about this, and misinterprets the RTC TOD registers. Tested with existing vmd/vmm guests with what's in tree.
-rw-r--r--usr.sbin/vmd/mc146818.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/vmd/mc146818.c b/usr.sbin/vmd/mc146818.c
index e6c868900ca..cb3c74439c5 100644
--- a/usr.sbin/vmd/mc146818.c
+++ b/usr.sbin/vmd/mc146818.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mc146818.c,v 1.5 2017/01/17 21:51:01 krw Exp $ */
+/* $OpenBSD: mc146818.c,v 1.6 2017/03/19 23:10:23 mlarkin Exp $ */
/*
* Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org>
*
@@ -132,7 +132,7 @@ mc146818_init(uint32_t vm_id)
memset(&rtc, 0, sizeof(rtc));
time(&rtc.now);
- rtc.regs[MC_REGB] = MC_REGB_24HR | MC_REGB_BINARY;
+ rtc.regs[MC_REGB] = MC_REGB_24HR;
rtc_updateregs();
rtc.vm_id = vm_id;