Skip to content

KVM: x86: skip gfn_track allocation when possible

David Stevens kvm 2 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v13 patches 1 replySuperseded

Changes in v2 from the cover letter

- lazily allocate gfn_track when shadow MMU is initialized, instead of looking at cpuid

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: x86: add config for non-kvm users of page trackingarch/x86/kvm/Kconfig drivers/gpu/drm/i915/Kconfig+4 -00 replies
2/2KVM: x86: only allocate gfn_track when necessaryarch/x86/include/asm/kvm_host.h arch/x86/include/asm/kvm_page_track.h arch/x86/kvm/mmu/mmu.c +2 more+87 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] KVM: x86: skip gfn_track allocation when possible

From: David Stevens <[email protected]>

Skip allocating gfn_track arrays when tracking of guest write access to pages is not required. For VMs where the allocation can be avoided, this saves 2 bytes per 4KB of guest memory.

Write tracking is used to manage shadow page tables in three cases - when tdp is not supported, when nested virtualization is used, and for GVT-g. If tdp_enable is set and the kernel is compiled without GVT-g, then the gfn_track arrays can be allocated lazily when the shadow MMU is initialized.

v1 -> v2:
- lazily allocate gfn_track when shadow MMU is initialized, instead of looking at cpuid

David Stevens (2):
KVM: x86: add config for non-kvm users of page tracking
KVM: x86: only allocate gfn_track when necessary

 arch/x86/include/asm/kvm_host.h       |  8 ++++
 arch/x86/include/asm/kvm_page_track.h |  5 +-
 arch/x86/kvm/Kconfig                  |  3 ++
 arch/x86/kvm/mmu/mmu.c                |  7 +++
 arch/x86/kvm/mmu/page_track.c         | 69 ++++++++++++++++++++++++++-
 arch/x86/kvm/x86.c                    |  2 +-
 drivers/gpu/drm/i915/Kconfig          |  1 +
 7 files changed, 91 insertions(+), 4 deletions(-)
Signature · 1 line
2.33.0.464.g1972c5931b-goog