Paolo Bonzini
ea26e4ec08
KVM: x86: drop TSC offsetting kvm_x86_ops to fix KVM_GET/SET_CLOCK
...
Since commit a545ab6a0085 ("kvm: x86: add tsc_offset field to struct
kvm_vcpu_arch", 2016-09-07) the offset between host and L1 TSC is
cached and need not be fished out of the VMCS or VMCB. This means
that we can implement adjust_tsc_offset_guest and read_l1_tsc
entirely in generic code. The simplification is particularly
significant for VMX code, where vmx->nested.vmcs01_tsc_offset
was duplicating what is now in vcpu->arch.tsc_offset. Therefore
the vmcs01_tsc_offset can be dropped completely.
More importantly, this fixes KVM_GET_CLOCK/KVM_SET_CLOCK
which, after commit 108b249c453d ("KVM: x86: introduce get_kvmclock_ns",
2016-09-01) called read_l1_tsc while the VMCS was not loaded.
It thus returned bogus values on Intel CPUs.
Fixes: 108b249c453dd7132599ab6dc7e435a7036c193f
Reported-by: Roman Kagan <rkagan@virtuozzo.com>
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-11-02 20:03:07 +01:00
..
2015-05-19 15:47:30 +02:00
2016-10-08 12:26:44 +02:00
2015-09-22 22:25:33 +02:00
2016-06-08 13:33:33 +02:00
2016-09-22 11:16:15 +02:00
2016-09-30 11:44:34 +01:00
2014-07-23 01:10:44 +02:00
2016-07-25 13:41:01 +02:00
2015-05-06 11:25:31 +02:00
2016-09-24 09:30:03 +02:00
2016-03-08 11:48:15 +01:00
2011-12-05 17:17:07 +01:00
2016-09-20 00:31:19 +02:00
2012-05-18 09:46:07 +02:00
2016-06-08 12:41:20 -07:00
2016-06-08 15:01:02 +02:00
2016-06-08 12:41:20 -07:00
2016-06-08 12:41:20 -07:00
2016-06-16 10:48:31 +02:00
2016-07-25 15:34:18 -07:00
2016-07-25 15:34:18 -07:00
2016-01-29 09:40:10 +01:00
2016-07-21 10:11:57 +02:00
2016-06-08 12:41:20 -07:00
2016-05-07 07:38:39 +02:00
2013-08-09 15:29:48 -07:00
2014-04-07 16:36:10 -07:00
2016-05-20 09:07:40 +02:00
2016-09-27 21:15:22 -04:00
2015-11-29 08:50:58 +01:00
2016-07-15 10:26:30 +02:00
2016-03-13 23:55:13 -04:00
2012-10-02 18:01:25 +01:00
2016-04-13 10:28:34 +02:00
2014-05-20 20:21:24 -07:00
2015-12-19 11:49:55 +01:00
2015-12-19 11:49:55 +01:00
2016-09-30 10:56:01 +02:00
2016-09-14 21:28:10 +02:00
2012-01-26 16:44:41 -08:00
2016-07-27 11:35:37 -07:00
2016-06-30 09:11:32 +02:00
2016-10-19 17:37:13 +02:00
2014-08-08 15:57:33 -07:00
2012-05-14 14:15:31 -07:00
2014-12-03 15:14:26 +01:00
2015-08-22 14:52:16 +02:00
2016-02-17 08:32:11 +01:00
2016-08-10 14:55:05 +02:00
2016-01-15 13:54:55 -06:00
2016-06-30 09:11:32 +02:00
2011-12-05 18:16:11 +01:00
2016-08-04 08:50:07 -04:00
2014-12-11 11:35:02 +01:00
2016-02-09 14:36:43 +01:00
2015-10-14 16:56:28 +02:00
2016-09-21 15:02:12 +02:00
2015-05-28 15:31:53 +02:00
2016-09-09 16:08:57 +01:00
2016-08-04 08:50:07 -04:00
2013-07-09 10:33:29 -07:00
2015-06-07 15:35:27 +02:00
2015-07-06 15:00:33 +02:00
2012-03-28 18:11:12 +01:00
2016-08-07 23:47:15 -04:00
2016-09-27 21:15:23 -04:00
2014-11-16 11:04:24 +01:00
2016-01-20 11:39:14 +01:00
2014-03-04 21:47:51 +01:00
2016-01-19 12:59:07 +01:00
2016-08-24 12:15:15 +02:00
2013-12-16 09:08:13 -08:00
2016-08-11 11:14:59 +02:00
2015-11-09 15:11:24 -08:00
2015-10-21 11:17:32 +02:00
2016-04-22 10:13:53 +02:00
2014-12-03 15:14:26 +01:00
2016-03-18 14:51:06 +01:00
2016-09-05 13:52:38 +02:00
2015-11-07 10:37:37 +01:00
2011-11-17 13:35:37 -08:00
2015-09-08 10:06:05 +02:00
2012-03-26 03:16:07 +02:00
2016-02-23 07:37:23 +01:00
2016-07-21 09:37:11 -03:00
2016-08-08 22:04:30 +02:00
2016-07-21 09:37:11 -03:00
2013-05-30 16:36:23 -07:00
2013-10-17 16:40:36 -07:00
2015-07-09 11:23:15 -07:00
2015-11-23 09:58:26 +01:00
2016-01-19 15:49:36 -08:00
2016-09-08 08:03:58 +02:00
2016-05-05 13:58:55 -07:00
2016-10-17 10:45:08 +02:00
2016-09-08 08:03:58 +02:00
2015-04-24 15:36:55 +02:00
2015-09-08 14:35:59 -07:00
2015-04-09 10:56:31 +02:00
2012-06-25 13:48:30 +02:00
2016-01-07 14:11:32 +01:00
2016-03-08 12:26:41 +01:00
2012-05-14 14:15:31 -07:00
2015-10-01 15:06:42 +02:00
2015-07-31 13:31:10 +02:00
2016-04-13 11:37:41 +02:00
2016-10-07 18:46:30 -07:00
2015-04-24 15:36:55 +02:00
2016-10-07 18:46:30 -07:00
2012-12-14 22:37:13 +00:00
2015-11-24 09:56:44 +01:00
2015-08-22 14:54:55 +02:00
2016-08-10 16:10:06 +02:00
2012-05-08 14:19:41 -07:00
2016-07-07 15:58:44 +02:00
2016-08-18 18:41:27 +02:00
2014-08-08 15:57:33 -07:00
2016-10-11 15:06:32 -07:00
2016-04-29 11:56:40 +02:00
2016-06-24 16:55:53 -07:00
2015-11-04 16:24:31 +01:00
2012-11-27 23:29:10 -02:00
2016-11-02 20:03:07 +01:00
2016-03-03 14:36:22 +01:00
2016-02-22 08:51:38 +01:00
2015-02-11 16:47:46 +10:30
2016-01-12 12:17:28 +01:00
2016-05-05 08:37:31 +02:00
2016-07-14 15:07:00 +02:00
2016-06-08 12:41:20 -07:00
2011-11-21 19:00:57 -08:00
2011-11-10 16:21:01 +01:00
2015-07-31 13:31:10 +02:00
2016-06-04 00:20:00 +02:00
2016-09-13 15:23:10 +02:00
2016-06-08 11:04:20 +02:00
2016-06-08 11:04:20 +02:00
2016-06-08 11:04:19 +02:00
2013-09-28 10:10:26 +02:00
2013-07-14 19:36:56 -04:00
2016-09-09 13:02:27 +02:00
2016-09-09 13:02:27 +02:00
2014-02-27 08:07:39 -08:00
2012-10-02 18:01:25 +01:00
2012-11-29 13:23:01 -08:00
2012-05-17 19:06:13 -04:00
2016-09-21 21:18:38 +02:00
2015-06-09 12:24:34 +02:00
2015-08-04 22:30:44 -07:00
2015-12-20 12:40:49 +01:00
2016-10-14 14:14:20 +02:00
2015-12-06 12:56:10 +01:00
2016-06-06 15:33:39 +02:00
2016-03-29 12:23:26 +02:00
2016-06-08 15:17:01 +02:00
2016-06-08 15:17:01 +02:00
2012-10-02 18:01:25 +01:00
2016-07-20 09:48:40 +02:00
2014-02-09 13:17:22 +01:00
2012-04-19 15:07:42 -07:00
2014-09-16 08:55:10 +02:00
2012-07-31 23:27:30 -04:00
2016-07-27 14:59:59 +02:00
2013-11-19 14:24:50 +01:00
2016-07-08 17:35:15 +02:00
2014-11-03 21:44:57 +01:00
2015-12-19 11:53:40 +01:00
2016-05-07 07:38:39 +02:00
2016-10-03 16:13:28 -07:00
2016-10-03 16:13:28 -07:00
2013-01-03 15:57:04 -08:00
2016-03-29 12:23:27 +02:00
2016-02-27 08:52:20 -06:00
2016-09-23 08:41:08 -05:00
2016-09-22 12:14:29 -04:00
2014-08-28 08:58:57 -04:00
2016-04-28 10:32:42 +02:00
2016-07-26 16:19:19 -07:00
2014-11-03 13:40:44 +01:00
2014-09-01 10:15:31 +02:00
2016-08-10 16:10:06 +02:00
2016-08-11 11:04:10 +02:00
2016-10-07 18:46:29 -07:00
2015-04-14 16:49:02 -07:00
2015-02-10 14:30:33 -08:00
2015-04-14 16:49:02 -07:00
2015-02-10 14:30:33 -08:00
2016-07-25 17:32:28 -07:00
2016-09-09 13:02:28 +02:00
2015-12-19 11:49:56 +00:00
2015-03-18 15:54:27 +01:00
2015-07-06 18:39:38 +02:00
2016-05-27 11:47:56 -07:00
2016-09-05 11:47:31 +02:00
2012-12-14 22:37:13 +00:00
2016-06-08 12:41:20 -07:00
2012-12-14 22:37:13 +00:00
2016-09-15 08:25:12 +02:00
2014-06-21 23:05:43 +02:00
2016-03-10 09:48:13 +01:00
2016-06-14 10:54:39 -07:00
2015-09-28 13:06:37 +02:00
2016-09-20 09:26:15 +02:00
2015-08-12 11:59:05 +02:00
2016-02-24 08:35:44 +01:00
2015-09-11 07:50:12 +02:00
2016-08-18 18:41:29 +02:00
2015-12-19 11:07:01 +01:00
2016-06-30 09:11:32 +02:00
2016-06-08 12:41:20 -07:00
2016-10-18 12:21:16 +02:00
2015-04-17 09:04:10 -04:00
2016-09-27 21:15:23 -04:00
2016-04-29 11:56:41 +02:00
2015-05-06 22:27:00 +02:00
2016-04-29 11:56:40 +02:00
2015-09-08 10:06:05 +02:00
2015-09-08 10:06:05 +02:00
2016-02-17 08:32:11 +01:00
2016-09-14 21:28:11 +02:00
2015-05-19 15:47:30 +02:00
2016-01-30 11:22:17 +01:00
2016-10-11 15:06:32 -07:00
2016-09-30 12:40:12 +02:00
2016-09-30 10:56:00 +02:00
2016-09-30 10:56:00 +02:00
2012-05-09 15:34:28 +02:00
2015-07-06 15:23:28 +02:00
2016-09-20 08:29:34 +02:00
2016-09-05 11:47:31 +02:00
2012-10-02 18:01:25 +01:00
2015-11-26 10:04:53 +01:00
2015-11-26 10:04:53 +01:00
2012-10-02 18:01:25 +01:00
2016-06-16 00:04:31 +02:00
2016-08-04 08:50:07 -04:00
2016-08-24 12:31:50 +02:00
2016-06-08 12:41:20 -07:00
2013-05-09 13:46:38 -04:00
2016-09-15 08:25:12 +02:00
2015-07-31 13:31:10 +02:00
2013-08-02 16:17:47 -07:00
2016-04-29 11:56:40 +02:00
2016-10-20 13:27:47 +02:00
2014-01-20 12:03:57 -08:00
2013-04-12 16:56:47 -07:00
2016-09-30 12:40:12 +02:00
2016-08-01 14:23:42 -04:00
2012-11-13 15:48:40 -05:00
2016-09-08 08:47:20 +02:00
2016-07-15 10:35:08 +02:00
2016-07-26 14:41:48 -07:00
2016-07-26 14:41:48 -07:00
2016-09-27 21:15:23 -04:00
2016-07-15 10:30:26 +02:00
2016-10-06 09:52:20 +02:00
2014-06-05 16:21:57 +02:00
2015-05-19 15:47:35 +02:00
2016-09-14 21:28:09 +02:00
2014-07-10 16:48:48 -06:00
2016-01-12 11:59:35 +01:00
2016-06-16 00:04:31 +02:00
2015-07-31 13:31:11 +02:00
2016-07-23 11:04:23 -07:00
2014-11-03 21:44:57 +01:00
2014-11-03 13:41:53 +01:00
2012-05-26 11:33:40 -07:00
2012-06-06 10:22:17 +02:00
2016-07-25 19:41:35 -07:00
2016-04-13 11:37:40 +02:00
2013-01-25 09:23:50 +01:00
2016-04-13 11:37:40 +02:00
2015-05-19 15:47:30 +02:00