mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Fred Griffoul <fgriffo@amazon.co.uk>
Cc: Sean Christopherson <seanjc@google.com>,
	kvm@vger.kernel.org,  pbonzini@redhat.com, vkuznets@redhat.com,
	shuah@kernel.org,  linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 00/10] KVM: nVMX: Improve performance for unmanaged guest memory
Date: Thu, 20 Aug 2026 23:45:29 +0100	[thread overview]
Message-ID: <cb2abea3ef93f4240dfd61e69afc2ec2061359a4.camel@infradead.org> (raw)
In-Reply-To: <9a349470088e5f71a136b00dfada97fdb2528d98.camel@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

On Mon, 2026-08-17 at 22:55 +0100, David Woodhouse wrote:
> I've reworked the first half of this on top of the GPC SRCU
> conversion, with the guest-mode pinning done as Sean prescribed:
> 
>   https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/nvmx-gpc

I did the nested SVM equivalent too, now on top of the same tree:

  https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/nsvm-gpc

(Those kvm_nested_gpc_lock() helpers have nothing to do with nesting
and can be renamed and hoisted to somewhere more generic when I go back
and clean it all up, but I'm keeping it incremental for now.)

SVM doesn't use L1 pages directly from the guest VMCB02 (the merged
MSRPM and the IOPM are kernel pages). It's only ever direct access from
the kernel to gpc->khva.

But that covers the VMCB12 page which is mapped and unmapped twice per
L1←→L2 round trip today, and L1's MSR/IO permission bitmaps
(kvm_vcpu_read_guest() on each trapped access).

So unlike nVMX, we can even see the win on boring non-PFNMAP memory.

From a cpuid ping-pong between L1 and L2 on EPYC Milan
(10k iterations, cycles, measured from L1):

                    baseline                nsvm-gpc
  reflected exit:   p50 47.6k  p99 90.2k    p50 38.6k  p99 81.4k
  MSR intercept:    p50 49.1k  p99 90.9k    p50 39.9k  p99 81.8k

About 9k cycles (~20%) off every emulated vmexit/vmentry. This is a
kernel with KASAN+lockdep for correctness torture testing, so the
measurement might not be indicative of production performance. I'll do
another run on something more representative now it's actually passed
the soak tests without catching fire.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 6179 bytes --]

      reply	other threads:[~2026-08-20 22:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 14:24 Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 01/10] KVM: nVMX: Implement cache for L1 MSR bitmap Fred Griffoul
2026-05-11 23:08   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 02/10] KVM: pfncache: Restore guest-uses-pfn support Fred Griffoul
2026-06-01 15:09   ` David Woodhouse
2026-06-11 15:55     ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 03/10] KVM: x86: Add nested state validation for pfncache support Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 04/10] KVM: nVMX: Implement cache for L1 APIC pages Fred Griffoul
2026-05-11 23:35   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 05/10] KVM: selftests: Add nested VMX APIC cache invalidation test Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 06/10] KVM: nVMX: Cache evmcs fields to ensure consistency during VM-entry Fred Griffoul
2026-01-02 15:40   ` Vitaly Kuznetsov
2026-01-02 14:24 ` [PATCH v4 07/10] KVM: nVMX: Replace evmcs kvm_host_map with pfncache Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 08/10] KVM: x86: Add nested context management Fred Griffoul
2026-05-12  0:13   ` Sean Christopherson
2026-01-02 14:24 ` [PATCH v4 09/10] KVM: nVMX: Use nested context for pfncache persistence Fred Griffoul
2026-01-02 14:24 ` [PATCH v4 10/10] KVM: selftests: Add L2 vcpu context switch test Fred Griffoul
2026-05-11 23:56 ` [PATCH v4 00/10] KVM: nVMX: Improve performance for unmanaged guest memory Sean Christopherson
2026-08-17 21:55 ` David Woodhouse
2026-08-20 22:45   ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb2abea3ef93f4240dfd61e69afc2ec2061359a4.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=fgriffo@amazon.co.uk \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®