All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/11] KVM: multiple address spaces (for SMM)
@ 2015-05-18 13:48 Paolo Bonzini
  2015-05-18 13:48 ` [PATCH 01/11] KVM: introduce kvm_alloc/free_memslots Paolo Bonzini
                   ` (11 more replies)
  0 siblings, 12 replies; 24+ messages in thread
From: Paolo Bonzini @ 2015-05-18 13:48 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: Xiao Guangrong, rkrcmar, bdas

This implements Avi's suggestion of having two separate kvm_memslots for
regular and SMM operation, corresponding to different address spaces.

All in all, the surgery is limited even though there are a few preparatory
patches that touch all architectures.

The amount of added code for the vcpu-specific versions of kvm_read_guest
and kvm_write_guest is smaller, and duplication is limited to a couple of
functions.  Even the rmap parts, which scared me a lot when the first
version OOPSed on me, :) are actually very easy.

Patches 1-6 are preparatory cleanups that can be applied separately,
while the others will be posted in v2 of the SMM patches.

Patches 7-8 add the new functions (this time in virt/kvm/kvm_main.c).
Architectures can then define a function kvm_arch_vcpu_memslots_id that
returns the active address space id for a given VCPU.  The address space
ID must be passed to KVM_SET_USER_MEMORY_REGION and KVM_GET_DIRTY_LOG,
using the high 16 bits of the slot id.

Patch 9 then does VCPU-specific accesses in x86, and patch 10 loops
over the SMM slots as well on memslot iterations.

Patch 11 then introduces the SMRAM address space, which is very simple
after all the legwork.

Thanks for the reviews,

Paolo

Paolo Bonzini (11):
  KVM: introduce kvm_alloc/free_memslots
  KVM: use kvm_memslots whenever possible
  KVM: const-ify uses of struct kvm_userspace_memory_region
  KVM: add memslots argument to kvm_arch_memslots_updated
  KVM: add "new" argument to kvm_arch_commit_memory_region
  KVM: x86: pass kvm_mmu_page to gfn_to_rmap
  KVM: add vcpu-specific functions to read/write/translate GFNs
  KVM: implement multiple address spaces
  KVM: x86: use vcpu-specific functions to read/write/translate GFNs
  KVM: x86: work on all available address spaces
  KVM: x86: add SMM to the MMU role, support SMRAM address space

 Documentation/virtual/kvm/api.txt        |  12 ++
 arch/arm/kvm/mmu.c                       |  10 +-
 arch/mips/include/asm/kvm_host.h         |   2 +-
 arch/mips/kvm/mips.c                     |   9 +-
 arch/powerpc/include/asm/kvm_book3s_64.h |   2 +-
 arch/powerpc/include/asm/kvm_host.h      |   2 +-
 arch/powerpc/include/asm/kvm_ppc.h       |  10 +-
 arch/powerpc/kvm/book3s.c                |   9 +-
 arch/powerpc/kvm/book3s_64_mmu_hv.c      |   2 +-
 arch/powerpc/kvm/book3s_hv.c             |  15 +-
 arch/powerpc/kvm/book3s_pr.c             |  11 +-
 arch/powerpc/kvm/booke.c                 |   7 +-
 arch/powerpc/kvm/powerpc.c               |   7 +-
 arch/s390/include/asm/kvm_host.h         |   2 +-
 arch/s390/kvm/kvm-s390.c                 |   9 +-
 arch/x86/include/asm/kvm_host.h          |  29 +--
 arch/x86/kvm/mmu.c                       | 143 +++++++-------
 arch/x86/kvm/paging_tmpl.h               |  14 +-
 arch/x86/kvm/svm.c                       |  16 +-
 arch/x86/kvm/vmx.c                       |  34 ++--
 arch/x86/kvm/x86.c                       |  99 +++++++---
 include/linux/kvm_host.h                 |  54 +++++-
 include/linux/kvm_types.h                |   1 +
 include/uapi/linux/kvm.h                 |   1 +
 virt/kvm/kvm_main.c                      | 314 ++++++++++++++++++++++---------
 25 files changed, 548 insertions(+), 266 deletions(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2015-05-20 18:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 13:48 [RFC PATCH 00/11] KVM: multiple address spaces (for SMM) Paolo Bonzini
2015-05-18 13:48 ` [PATCH 01/11] KVM: introduce kvm_alloc/free_memslots Paolo Bonzini
2015-05-18 13:48 ` [PATCH 02/11] KVM: use kvm_memslots whenever possible Paolo Bonzini
2015-05-18 13:48 ` [PATCH 03/11] KVM: const-ify uses of struct kvm_userspace_memory_region Paolo Bonzini
2015-05-18 13:48 ` [PATCH 04/11] KVM: add memslots argument to kvm_arch_memslots_updated Paolo Bonzini
2015-05-18 13:48 ` [PATCH 05/11] KVM: add "new" argument to kvm_arch_commit_memory_region Paolo Bonzini
2015-05-18 13:48 ` [PATCH 06/11] KVM: x86: pass kvm_mmu_page to gfn_to_rmap Paolo Bonzini
2015-05-20  8:30   ` Xiao Guangrong
2015-05-20  9:07     ` Paolo Bonzini
2015-05-18 13:48 ` [PATCH 07/11] KVM: add vcpu-specific functions to read/write/translate GFNs Paolo Bonzini
2015-05-18 13:48 ` [PATCH 08/11] KVM: implement multiple address spaces Paolo Bonzini
2015-05-19 13:32   ` Radim Krčmář
2015-05-19 16:19     ` Paolo Bonzini
2015-05-19 18:28       ` Radim Krčmář
2015-05-20  7:07         ` Paolo Bonzini
2015-05-20 15:46           ` Radim Krčmář
2015-05-20 18:17             ` Paolo Bonzini
2015-05-18 13:48 ` [PATCH 09/11] KVM: x86: use vcpu-specific functions to read/write/translate GFNs Paolo Bonzini
2015-05-18 13:48 ` [PATCH 10/11] KVM: x86: work on all available address spaces Paolo Bonzini
2015-05-18 13:48 ` [PATCH 11/11] KVM: x86: add SMM to the MMU role, support SMRAM address space Paolo Bonzini
2015-05-20  8:34   ` Xiao Guangrong
2015-05-20  8:57     ` Paolo Bonzini
2015-05-20  8:31 ` [RFC PATCH 00/11] KVM: multiple address spaces (for SMM) Christian Borntraeger
2015-05-20  8:58   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.