public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: Tie MWAIT/HLT/PAUSE interception to initially disabled capabilities
@ 2017-11-25 13:09 Jan H. Schönherr
  2017-11-25 13:09 ` [PATCH 1/3] KVM: Don't enable MWAIT in guest by default Jan H. Schönherr
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Jan H. Schönherr @ 2017-11-25 13:09 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Jan H. Schönherr, Joerg Roedel, Michael S. Tsirkin,
	KarimAllah Ahmed, kvm

KVM no longer intercepts MWAIT instructions since Linux 4.12 commit 668fffa3f838
("kvm: better MWAIT emulation for guests") for improved latency in some
workloads.

This series takes the idea further and makes the interception of HLT (patch 2)
and PAUSE (patch 3) optional as well for similar reasons. Both interceptions
can be turned off for an individual VM by enabling the corresponding capability.

It also converts KVM_CAP_X86_GUEST_MWAIT into an initially disabled capability
that has to be enabled explicitly for a VM. This restores pre Linux 4.12
behavior in the default case, so that a guest cannot put CPUs into low power
states, which may exceed the host's latency requirements (patch 1).

Jan H. Schönherr (3):
  KVM: Don't enable MWAIT in guest by default
  KVM: Add capability to not exit on HLT
  KVM: Add capability to not exit on PAUSE

 Documentation/virtual/kvm/api.txt | 38 +++++++++++++++++++------
 arch/x86/include/asm/kvm_host.h   |  4 +++
 arch/x86/kvm/svm.c                |  8 ++++--
 arch/x86/kvm/vmx.c                | 59 +++++++++++++++++++++++++++++----------
 arch/x86/kvm/x86.c                | 54 ++++++++++++++++++++++++++++++++++-
 arch/x86/kvm/x86.h                | 41 +++++++--------------------
 include/uapi/linux/kvm.h          |  2 ++
 7 files changed, 148 insertions(+), 58 deletions(-)

-- 
2.3.1.dirty

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2017-11-29 16:58 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-25 13:09 [PATCH 0/3] KVM: Tie MWAIT/HLT/PAUSE interception to initially disabled capabilities Jan H. Schönherr
2017-11-25 13:09 ` [PATCH 1/3] KVM: Don't enable MWAIT in guest by default Jan H. Schönherr
2017-11-27 18:13   ` Jim Mattson
     [not found]     ` <82e1f7c8-fdd6-835e-319a-bec72d771ef9@redhat.com>
2017-11-27 18:32       ` Jim Mattson
2017-11-28 23:58     ` Jan H. Schönherr
2017-11-29 16:58       ` Radim Krčmář
2017-11-27 20:46   ` Michael S. Tsirkin
2017-11-27 22:36     ` Jan H. Schönherr
2017-11-28 14:00       ` Michael S. Tsirkin
2017-11-27 20:50   ` Michael S. Tsirkin
     [not found]     ` <90f7f081-95d7-f573-8b57-5c6e86fd2a8d@redhat.com>
2017-11-27 20:57       ` Michael S. Tsirkin
2017-11-25 13:09 ` [PATCH 2/3] KVM: Add capability to not exit on HLT Jan H. Schönherr
2017-11-27  1:32   ` Wanpeng Li
2017-11-27  1:47     ` Wanpeng Li
     [not found]       ` <a2f4cf7f-5d7b-a1cc-30d5-d18df4d49173@redhat.com>
2017-11-27 12:29         ` Jan H. Schönherr
     [not found]     ` <421c71fd-6dff-c01e-9e78-42f114711ea9@redhat.com>
2017-11-27 15:27       ` Jan H. Schönherr
     [not found]   ` <e17ea420-c141-18b6-2622-e33a3f540c61@redhat.com>
2017-11-27 16:12     ` Jan H. Schönherr
2017-11-27 20:45   ` Michael S. Tsirkin
     [not found]     ` <8ce45bad-b43c-4e97-aa69-74d7fc9cecb5@redhat.com>
2017-11-27 20:55       ` Michael S. Tsirkin
2017-11-28  1:34         ` Longpeng (Mike)
2017-11-28 14:04           ` Michael S. Tsirkin
2017-11-25 13:09 ` [PATCH 3/3] KVM: Add capability to not exit on PAUSE Jan H. Schönherr
2017-11-27 20:48   ` Michael S. Tsirkin
2017-11-28  3:37   ` Longpeng (Mike)
2017-11-29  0:09     ` Jan H. Schönherr
2017-11-29  4:34       ` Longpeng (Mike)
2017-11-29 12:20         ` Jan H. Schönherr
     [not found] ` <a3c80a22-ff69-fa51-ea90-48f039eb449a@redhat.com>
2017-11-28  0:15   ` [PATCH 0/3] KVM: Tie MWAIT/HLT/PAUSE interception to initially disabled capabilities Jan H. Schönherr
     [not found]     ` <8971d9e0-388c-9934-1ab2-33508cbbeb8f@redhat.com>
2017-11-28 10:42       ` Jan H. Schönherr
2017-11-28 14:08       ` Michael S. Tsirkin
     [not found]         ` <e61d93f0-17d9-d182-83ae-b7165ae3dcb0@redhat.com>
2017-11-29  0:20           ` Michael S. Tsirkin
2017-11-29  0:24             ` Michael S. Tsirkin
     [not found]             ` <8e559062-e459-5a85-a4a3-72a4baf7764c@redhat.com>
2017-11-29 15:13               ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox