summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2019-05-22 16:11:21 +0000
committercheloha <cheloha@openbsd.org>2019-05-22 16:11:21 +0000
commit6c9a3b19ed29a5a54034982071898d5fb98f583b (patch)
tree272de0b7f2df3bdfdb69c662dfacd1626b11812b
parentAllow loading of bigger ucode. This implementation uses the UEFI memory (diff)
downloadwireguard-openbsd-6c9a3b19ed29a5a54034982071898d5fb98f583b.tar.xz
wireguard-openbsd-6c9a3b19ed29a5a54034982071898d5fb98f583b.zip
i386/amd64 apm(4): Ignore APM_UPDATE_TIME events.
The APM spec defines an APM_UPDATE_TIME event that is meant to cause the driver to rebase the system's wallclock against the RTC. The event itself is apparently caused by occasional blackout periods where interrupts cannot be delivered, which might cause the system to miss a tick. The problem is that on systems where these events are frequent this constantly erodes the system wallclock. The RTC is not the greatest clock in the world so these systems are always playing catch-up. ntpd(8) is a far better clock corrector than rebasing against the RTC, so it should be safe to simply ignore the event. We continue to record the event for userspace listeners, but we do not call inittodr(9) on receipt of the event. Linux has ignored the event since v2.6.21: https://github.com/torvalds/linux/commit/c1d370e167d66b10bca3b602d3740405469383de#diff-d85b9a44da8e5dfb2fb1bcbd304c2a6c Discovered by jcs@. Discussed a bit with jcs@, tedu@, deraadt@. Fix tested by jcs@. "I think we should ignore the event" deraadt@
-rw-r--r--sys/arch/i386/i386/apm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index ed9ff70e9a2..342c793b3d2 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.118 2018/07/30 14:19:12 kettenis Exp $ */
+/* $OpenBSD: apm.c,v 1.119 2019/05/22 16:11:21 cheloha Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -395,7 +395,6 @@ apm_handle_event(struct apm_softc *sc, struct apmregs *regs)
break;
case APM_UPDATE_TIME:
DPRINTF(("update time, please\n"));
- inittodr(time_second);
apm_record_event(sc, regs->bx);
break;
case APM_CRIT_SUSPEND_REQ: