summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2018-05-23 02:19:35 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2018-05-23 02:19:35 +0000
commit757c13b8c2b93f1fbf31dac57ef0bd26a4bb6ffc (patch)
tree8a766c92d437dbd602222598c998a0a8672a0cd2
parent2bb346dac746105ce5ebd11e131491498bb0ef23 (diff)
vmd(8): revert r1.23 (unlatched PIT reads), this made time go too fast on
some machines. Will investigate and commit a proper fix later.
-rw-r--r--usr.sbin/vmd/i8253.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/usr.sbin/vmd/i8253.c b/usr.sbin/vmd/i8253.c
index ef24a31277d..c669fb16867 100644
--- a/usr.sbin/vmd/i8253.c
+++ b/usr.sbin/vmd/i8253.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i8253.c,v 1.24 2018/04/27 08:57:13 mlarkin Exp $ */
+/* $OpenBSD: i8253.c,v 1.25 2018/05/23 02:19:34 mlarkin Exp $ */
/*
* Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org>
*
@@ -194,7 +194,6 @@ uint8_t
vcpu_exit_i8253(struct vm_run_params *vrp)
{
uint32_t out_data;
- uint16_t ul;
uint8_t sel, rw, data;
uint64_t ns, ticks;
struct timespec now, delta;
@@ -283,23 +282,12 @@ vcpu_exit_i8253(struct vm_run_params *vrp)
goto ret;
}
- /* Unlatched read mode */
- clock_gettime(CLOCK_MONOTONIC, &now);
- timespecsub(&now, &i8253_channel[sel].ts, &delta);
- ns = delta.tv_sec * 1000000000 + delta.tv_nsec;
- ticks = ns / NS_PER_TICK;
- if (i8253_channel[sel].start) {
- ul = i8253_channel[sel].start -
- ticks % i8253_channel[sel].start;
- } else
- ul = 0;
-
if (i8253_channel[sel].last_r == 0) {
- data = ul >> 8;
+ data = i8253_channel[sel].olatch >> 8;
set_return_data(vei, data);
i8253_channel[sel].last_r = 1;
} else {
- data = ul & 0xFF;
+ data = i8253_channel[sel].olatch & 0xFF;
set_return_data(vei, data);
i8253_channel[sel].last_r = 0;
}