public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: x86: Fastpath cleanup, fix, and enhancement
@ 2024-08-02 19:51 Sean Christopherson
  2024-08-02 19:51 ` [PATCH 1/5] KVM: x86: Re-enter guest if WRMSR(X2APIC_ICR) fastpath is successful Sean Christopherson
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Sean Christopherson @ 2024-08-02 19:51 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel

This series was prompted by observations of HLT-exiting when debugging
a throughput issue related to posted interrupts.  When KVM is running in
a nested scenario, a rather surprising number of HLT exits occur with an
unmasked interrupt already pending.  I didn't debug too deeply into the
guest side of things, but I suspect what is happening is that it's fairly
easy for L2 to be interrupted (by L1 or L0) between checking if it (the
CPU) should enter an idle state and actually executing STI;HLT.

AFAICT, a non-nested setup doesn't benefit much, if at all.  But, I don't
see any downside to checking for a wake event in the fastpath, e.g. it's
basically a "zero" time halt-polling mechanism.

The other patches fix flaws found by inspection when adding HLT-exiting
to the faspath.

Note, the userspace-exit logic is basically untested, i.e. I probably
need to write a selftest...

Sean Christopherson (5):
  KVM: x86: Re-enter guest if WRMSR(X2APIC_ICR) fastpath is successful
  KVM: x86: Dedup fastpath MSR post-handling logic
  KVM: x86: Exit to userspace if fastpath triggers one on instruction
    skip
  KVM: x86: Reorganize code in x86.c to co-locate vCPU blocking/running
    helpers
  KVM: x86: Add fastpath handling of HLT VM-Exits

 arch/x86/include/asm/kvm_host.h |   1 +
 arch/x86/kvm/svm/svm.c          |  13 +-
 arch/x86/kvm/vmx/vmx.c          |   2 +
 arch/x86/kvm/x86.c              | 319 +++++++++++++++++---------------
 arch/x86/kvm/x86.h              |   1 +
 5 files changed, 188 insertions(+), 148 deletions(-)


base-commit: 332d2c1d713e232e163386c35a3ba0c1b90df83f
-- 
2.46.0.rc2.264.g509ed76dc8-goog


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

end of thread, other threads:[~2024-10-08 17:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02 19:51 [PATCH 0/5] KVM: x86: Fastpath cleanup, fix, and enhancement Sean Christopherson
2024-08-02 19:51 ` [PATCH 1/5] KVM: x86: Re-enter guest if WRMSR(X2APIC_ICR) fastpath is successful Sean Christopherson
2024-09-02  9:58   ` Paolo Bonzini
2024-09-03 15:09     ` Sean Christopherson
2024-09-03 16:49       ` Paolo Bonzini
2024-09-03 16:58         ` Sean Christopherson
2024-08-02 19:51 ` [PATCH 2/5] KVM: x86: Dedup fastpath MSR post-handling logic Sean Christopherson
2024-08-02 19:51 ` [PATCH 3/5] KVM: x86: Exit to userspace if fastpath triggers one on instruction skip Sean Christopherson
2024-08-02 19:51 ` [PATCH 4/5] KVM: x86: Reorganize code in x86.c to co-locate vCPU blocking/running helpers Sean Christopherson
2024-08-02 19:51 ` [PATCH 5/5] KVM: x86: Add fastpath handling of HLT VM-Exits Sean Christopherson
2024-10-08  5:22   ` Manali Shukla
2024-10-08 17:39     ` Sean Christopherson
2024-08-31  0:20 ` [PATCH 0/5] KVM: x86: Fastpath cleanup, fix, and enhancement Sean Christopherson
2024-09-02 10:00   ` Paolo Bonzini

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