[PATCH] KVM: tsc deadline timer works only when hrtimer high resol=
From: Liu , Jinsong
Date: Tue Sep 04 2012 - 15:18:15 EST
This is for 2 reasons:
1. it's pointless to enable tsc deadline timer to guest when kernel hrtimer
not configured as high resolution, since that would be un-precise based on =
wheel;
2. tsc deadline timer based on hrtimer, setting a leftmost node to rb tree
and then do hrtimer reprogram. If hrtimer not configured as high resolution=
,
hrtimer_enqueue_reprogram do nothing and would make tsc deadline timer fail=
.
Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---
arch/x86/kvm/x86.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 148ed66..0e64997 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2210,7 +2210,11 @@ int kvm_dev_ioctl_check_extension(long ext)
r =3D kvm_has_tsc_control;
break;
case KVM_CAP_TSC_DEADLINE_TIMER:
+#ifdef CONFIG_HIGH_RES_TIMERS
r =3D boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER);
+#else
+ r =3D 0;
+#endif
break;
default:
r =3D 0;
--=20
1.7.1
--_002_DE8DF0795D48FD4CA783C40EC829233531F0E4SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
name="0001-KVM-tsc-deadline-timer-works-only-when-hrtimer-high-.patch"
Content-Description: 0001-KVM-tsc-deadline-timer-works-only-when-hrtimer-high-.patch
Content-Disposition: attachment;
filename="0001-KVM-tsc-deadline-timer-works-only-when-hrtimer-high-.patch";
size=1218; creation-date="Tue, 04 Sep 2012 11:48:55 GMT";
modification-date="Tue, 04 Sep 2012 19:39:46 GMT"
Content-Transfer-Encoding: base64
RnJvbSA3MjhhMTdlMmRlNTkxYjU1N2MzYzhiYTMxMDc2YjRiZjJjYTVhYjQyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUsIEppbnNvbmcgPGppbnNvbmcubGl1QGludGV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YworKysgYi9hcmNo
L3g4Ni9rdm0veDg2LmMKQEAgLTIyMTAsNyArMjIxMCwxMSBAQCBpbnQga3ZtX2Rldl9pb2N0bF9j
aGVja19leHRlbnNpb24obG9uZyBleHQpCiAJCXIgPSBrdm1faGFzX3RzY19jb250cm9sOwogCQli
cmVhazsKIAljYXNlIEtWTV9DQVBfVFNDX0RFQURMSU5FX1RJTUVSOgorI2lmZGVmIENPTkZJR19I
SUdIX1JFU19USU1FUlMKIAkJciA9IGJvb3RfY3B1X2hhcyhYODZfRkVBVFVSRV9UU0NfREVBRExJ
TkVfVElNRVIpOworI2Vsc2UKKwkJciA9IDA7CisjZW5kaWYKIAkJYnJlYWs7CiAJZGVmYXVsdDoK
IAkJciA9IDA7Ci0tIAoxLjcuMQoK
--_002_DE8DF0795D48FD4CA783C40EC829233531F0E4SHSMSX101ccrcorpi_--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/