linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/21] KVM: Cleanup and unify kvm_mmu_memory_cache usage
@ 2020-06-05 21:38 Sean Christopherson
  2020-06-05 21:38 ` [PATCH 01/21] KVM: x86/mmu: Track the associated kmem_cache in the MMU caches Sean Christopherson
                   ` (21 more replies)
  0 siblings, 22 replies; 54+ messages in thread
From: Sean Christopherson @ 2020-06-05 21:38 UTC (permalink / raw)
  To: Marc Zyngier, Paul Mackerras, Christian Borntraeger,
	Janosch Frank, Paolo Bonzini
  Cc: James Morse, Julien Thierry, Suzuki K Poulose, David Hildenbrand,
	Cornelia Huck, Claudio Imbrenda, Sean Christopherson,
	Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
	linux-arm-kernel, kvmarm, linux-mips, kvm, kvm-ppc, linux-kernel,
	Peter Feiner, Peter Shier, Junaid Shahid, Ben Gardon,
	Christoffer Dall

This series resurrects Christoffer Dall's series[1] to provide a common
MMU memory cache implementation that can be shared by x86, arm64 and MIPS.

It also picks up a suggested change from Ben Gardon[2] to clear shadow
page tables during initial allocation so as to avoid clearing entire
pages while holding mmu_lock.

The front half of the patches do house cleaning on x86's memory cache
implementation in preparation for moving it to common code, along with a
fair bit of cleanup on the usage.  The middle chunk moves the patches to
common KVM, and the last two chunks convert arm64 and MIPS to the common
implementation.

Cleanup aside, the notable difference from Christoffer and Ben's proposed
patches is to make __GFP_ZERO optional, e.g. to allow x86 to skip zeroing
for its gfns array and to provide line of sight for my
cannot-yet-be-discussed-in-detail use case for non-zero initialized shadow
page tables[3].

Tested on x86 only, no testing whatsoever on arm64 or MIPS.

[1] https://lkml.kernel.org/r/20191105110357.8607-1-christoffer.dall@arm.com
[2] https://lkml.kernel.org/r/20190926231824.149014-4-bgardon@google.com
[3] https://lkml.kernel.org/r/20191127180731.GC16845@linux.intel.com

Sean Christopherson (21):
  KVM: x86/mmu: Track the associated kmem_cache in the MMU caches
  KVM: x86/mmu: Consolidate "page" variant of memory cache helpers
  KVM: x86/mmu: Use consistent "mc" name for kvm_mmu_memory_cache locals
  KVM: x86/mmu: Remove superfluous gotos from mmu_topup_memory_caches()
  KVM: x86/mmu: Try to avoid crashing KVM if a MMU memory cache is empty
  KVM: x86/mmu: Move fast_page_fault() call above
    mmu_topup_memory_caches()
  KVM: x86/mmu: Topup memory caches after walking GVA->GPA
  KVM: x86/mmu: Clean up the gorilla math in mmu_topup_memory_caches()
  KVM: x86/mmu: Separate the memory caches for shadow pages and gfn
    arrays
  KVM: x86/mmu: Make __GFP_ZERO a property of the memory cache
  KVM: x86/mmu: Zero allocate shadow pages (outside of mmu_lock)
  KVM: x86/mmu: Skip filling the gfn cache for guaranteed direct MMU
    topups
  KVM: x86/mmu: Prepend "kvm_" to memory cache helpers that will be
    global
  KVM: Move x86's version of struct kvm_mmu_memory_cache to common code
  KVM: Move x86's MMU memory cache helpers to common KVM code
  KVM: arm64: Drop @max param from mmu_topup_memory_cache()
  KVM: arm64: Use common code's approach for __GFP_ZERO with memory
    caches
  KVM: arm64: Use common KVM implementation of MMU memory caches
  KVM: MIPS: Drop @max param from mmu_topup_memory_cache()
  KVM: MIPS: Account pages used for GPA page tables
  KVM: MIPS: Use common KVM implementation of MMU memory caches

 arch/arm64/include/asm/kvm_host.h    |  11 ---
 arch/arm64/include/asm/kvm_types.h   |   8 ++
 arch/arm64/kvm/arm.c                 |   2 +
 arch/arm64/kvm/mmu.c                 |  54 +++--------
 arch/mips/include/asm/kvm_host.h     |  11 ---
 arch/mips/include/asm/kvm_types.h    |   7 ++
 arch/mips/kvm/mmu.c                  |  44 ++-------
 arch/powerpc/include/asm/kvm_types.h |   5 ++
 arch/s390/include/asm/kvm_types.h    |   5 ++
 arch/x86/include/asm/kvm_host.h      |  14 +--
 arch/x86/include/asm/kvm_types.h     |   7 ++
 arch/x86/kvm/mmu/mmu.c               | 129 +++++++++------------------
 arch/x86/kvm/mmu/paging_tmpl.h       |  10 +--
 include/linux/kvm_host.h             |   7 ++
 include/linux/kvm_types.h            |  19 ++++
 virt/kvm/kvm_main.c                  |  55 ++++++++++++
 16 files changed, 178 insertions(+), 210 deletions(-)
 create mode 100644 arch/arm64/include/asm/kvm_types.h
 create mode 100644 arch/mips/include/asm/kvm_types.h
 create mode 100644 arch/powerpc/include/asm/kvm_types.h
 create mode 100644 arch/s390/include/asm/kvm_types.h
 create mode 100644 arch/x86/include/asm/kvm_types.h

-- 
2.26.0


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

end of thread, other threads:[~2020-06-22 19:41 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 21:38 [PATCH 00/21] KVM: Cleanup and unify kvm_mmu_memory_cache usage Sean Christopherson
2020-06-05 21:38 ` [PATCH 01/21] KVM: x86/mmu: Track the associated kmem_cache in the MMU caches Sean Christopherson
2020-06-09 21:07   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 02/21] KVM: x86/mmu: Consolidate "page" variant of memory cache helpers Sean Christopherson
2020-06-09 22:54   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 03/21] KVM: x86/mmu: Use consistent "mc" name for kvm_mmu_memory_cache locals Sean Christopherson
2020-06-10 22:03   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 04/21] KVM: x86/mmu: Remove superfluous gotos from mmu_topup_memory_caches() Sean Christopherson
2020-06-09 22:57   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 05/21] KVM: x86/mmu: Try to avoid crashing KVM if a MMU memory cache is empty Sean Christopherson
2020-06-10 22:12   ` Ben Gardon
2020-06-17  0:53     ` Sean Christopherson
2020-06-17 16:36       ` Ben Gardon
2020-06-05 21:38 ` [PATCH 06/21] KVM: x86/mmu: Move fast_page_fault() call above mmu_topup_memory_caches() Sean Christopherson
2020-06-09 23:03   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 07/21] KVM: x86/mmu: Topup memory caches after walking GVA->GPA Sean Christopherson
2020-06-10 22:34   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 08/21] KVM: x86/mmu: Clean up the gorilla math in mmu_topup_memory_caches() Sean Christopherson
2020-06-10 22:20   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 09/21] KVM: x86/mmu: Separate the memory caches for shadow pages and gfn arrays Sean Christopherson
2020-06-09 23:56   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 10/21] KVM: x86/mmu: Make __GFP_ZERO a property of the memory cache Sean Christopherson
2020-06-10 18:57   ` Ben Gardon
2020-06-22 19:40     ` Sean Christopherson
2020-06-05 21:38 ` [PATCH 11/21] KVM: x86/mmu: Zero allocate shadow pages (outside of mmu_lock) Sean Christopherson
2020-06-10 18:49   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 12/21] KVM: x86/mmu: Skip filling the gfn cache for guaranteed direct MMU topups Sean Christopherson
2020-06-10 18:52   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 13/21] KVM: x86/mmu: Prepend "kvm_" to memory cache helpers that will be global Sean Christopherson
2020-06-10 18:56   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 14/21] KVM: Move x86's version of struct kvm_mmu_memory_cache to common code Sean Christopherson
2020-06-10 19:01   ` Ben Gardon
2020-06-10 21:58     ` Ben Gardon
2020-06-22 16:57       ` Sean Christopherson
2020-06-11  7:42   ` Marc Zyngier
2020-06-05 21:38 ` [PATCH 15/21] KVM: Move x86's MMU memory cache helpers to common KVM code Sean Christopherson
2020-06-10 20:24   ` Ben Gardon
2020-06-05 21:38 ` [PATCH 16/21] KVM: arm64: Drop @max param from mmu_topup_memory_cache() Sean Christopherson
2020-06-10 22:00   ` Ben Gardon
2020-06-11 15:59     ` Sean Christopherson
2020-06-05 21:38 ` [PATCH 17/21] KVM: arm64: Use common code's approach for __GFP_ZERO with memory caches Sean Christopherson
2020-06-11  7:59   ` Marc Zyngier
2020-06-11 15:43     ` Sean Christopherson
2020-06-11 15:51       ` Marc Zyngier
2020-06-05 21:38 ` [PATCH 18/21] KVM: arm64: Use common KVM implementation of MMU " Sean Christopherson
2020-06-11  8:01   ` Marc Zyngier
2020-06-11 15:46     ` Sean Christopherson
2020-06-05 21:38 ` [PATCH 19/21] KVM: MIPS: Drop @max param from mmu_topup_memory_cache() Sean Christopherson
2020-06-08  8:56   ` Huacai Chen
2020-06-05 21:38 ` [PATCH 20/21] KVM: MIPS: Account pages used for GPA page tables Sean Christopherson
2020-06-08  8:56   ` Huacai Chen
2020-06-05 21:38 ` [PATCH 21/21] KVM: MIPS: Use common KVM implementation of MMU memory caches Sean Christopherson
2020-06-08  8:57   ` Huacai Chen
2020-06-11  8:06 ` [PATCH 00/21] KVM: Cleanup and unify kvm_mmu_memory_cache usage Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).