linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/13] KVM: MIPS: Dirty logging, SYNC_MMU & READONLY_MEM
@ 2017-01-16 12:49 James Hogan
  2017-01-16 12:49 ` James Hogan
                   ` (13 more replies)
  0 siblings, 14 replies; 36+ messages in thread
From: James Hogan @ 2017-01-16 12:49 UTC (permalink / raw)
  To: linux-mips
  Cc: James Hogan, Paolo Bonzini, Radim Krčmář,
	Ralf Baechle, kvm

Note: My intention is to take this series via the MIPS KVM tree. This
series is based on my other series posted this cycle:
[0/10] KVM: MIPS: Implement GVA page tables and shadow flushing
[0/3]  KVM: MIPS: Use CP0_BadInstr[P] for emulation
[0/30] KVM: MIPS: Implement GVA page tables

This series adds proper dirty page logging, KVM_CAP_SYNC_MMU, and
KVM_CAP_READONLY_MEM support to MIPS KVM.

The existing dirty page logging support (integral to live migration) was
basically incomplete as pages were never marked read only or recorded as
being dirty on a TLB modified exception. This series incrementally adds
proper support, using the dirty bit in the GPA and GVA page tables to
trigger TLB modified exceptions.

Support is added for KVM_CAP_SYNC_MMU, which adds MMU notifiers so that
KVM can react to asynchronous (and synchronous) host virtual MM changes.
This allows for several features to work with guest RAM which require
mappings to be altered or protected, such as copy-on-write, KSM (Kernel
Samepage Merging), idle page tracking, memory swapping, and guest memory
ballooning, as well as paving the way for KVM_CAP_READONLY_MEM.

Finally support is added for read only memory regions
(KVM_CAP_READONLY_MEM), which can be supported fairly minimally once
dirty page logging and KVM_CAP_SYNC_MMU are in place. This allows memory
regions to be marked read only to the guest so that reads work but
writes trigger MMIO.

The patches are roughly grouped as follows:

Patches 1-2:
  Preliminary changes for readonly regions / dirty logging.

Patches 3-5:
  Add handling of read only regions (or areas with no region) as MMIO,
  and also call fault handling for dirty logging.

Patches 6-11:
  Incrementally add proper dirty logging support, first making ranges of
  GPA clean when log read or region is made readonly, then adding the
  fast path fault handling for dirty logging, and finally transferring
  GPA protection bits (including dirty) across to GVA page tables so
  they take effect.

Patch 12:
  Add KVM_CAP_SYNC_MMU support.

Patch 13:
  Enable KVM_CAP_READONLY_MEM. This is after KVM_CAP_SYNC_MMU support as
  it needs to use gfn_to_pfn_prot() to know whether the GFN is read
  only, which opens up the possibility of getting copy-on-write enabled
  pages, which aren't safe without KVM_CAP_SYNC_MMU since the guest
  mappings wouldn't get updated after a copy-on-write took place.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org

James Hogan (13):
  KVM: MIPS/T&E: Ignore user writes to CP0_Config7
  KVM: MIPS: Pass type of fault down to kvm_mips_map_page()
  KVM: MIPS/T&E: Abstract bad access handling
  KVM: MIPS/T&E: Treat unhandled guest KSeg0 as MMIO
  KVM: MIPS/T&E: Handle read only GPA in TLB mod
  KVM: MIPS/MMU: Add GPA PT mkclean helper
  KVM: MIPS/MMU: Use generic dirty log & protect helper
  KVM: MIPS: Clean & flush on dirty page logging enable
  KVM: MIPS/MMU: Handle dirty logging on GPA faults
  KVM: MIPS/MMU: Pass GPA PTE bits to KSeg0 GVA PTEs
  KVM: MIPS/MMU: Pass GPA PTE bits to mapped GVA PTEs
  KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU
  KVM: MIPS: Claim KVM_CAP_READONLY_MEM support

 arch/mips/include/asm/kvm_host.h |  28 +-
 arch/mips/include/uapi/asm/kvm.h |   2 +-
 arch/mips/kvm/Kconfig            |   2 +-
 arch/mips/kvm/emulate.c          |  38 +--
 arch/mips/kvm/mips.c             |  68 ++--
 arch/mips/kvm/mmu.c              | 546 ++++++++++++++++++++++++++++----
 arch/mips/kvm/trap_emul.c        | 203 +++++++-----
 7 files changed, 693 insertions(+), 194 deletions(-)

-- 
git-series 0.8.10

^ permalink raw reply	[flat|nested] 36+ messages in thread
[parent not found: <201701171906397244491@zte.com.cn>]
[parent not found: <201701181618464411994@zte.com.cn>]
[parent not found: <201701191629518310684@zte.com.cn>]

end of thread, other threads:[~2017-02-02 12:46 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16 12:49 [PATCH 0/13] KVM: MIPS: Dirty logging, SYNC_MMU & READONLY_MEM James Hogan
2017-01-16 12:49 ` James Hogan
2017-01-16 12:49 ` [PATCH 1/13] KVM: MIPS/T&E: Ignore user writes to CP0_Config7 James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page() James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 3/13] KVM: MIPS/T&E: Abstract bad access handling James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 4/13] KVM: MIPS/T&E: Treat unhandled guest KSeg0 as MMIO James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 5/13] KVM: MIPS/T&E: Handle read only GPA in TLB mod James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 6/13] KVM: MIPS/MMU: Add GPA PT mkclean helper James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 7/13] KVM: MIPS/MMU: Use generic dirty log & protect helper James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 8/13] KVM: MIPS: Clean & flush on dirty page logging enable James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 9/13] KVM: MIPS/MMU: Handle dirty logging on GPA faults James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 10/13] KVM: MIPS/MMU: Pass GPA PTE bits to KSeg0 GVA PTEs James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 11/13] KVM: MIPS/MMU: Pass GPA PTE bits to mapped " James Hogan
2017-01-16 12:49   ` James Hogan
2017-01-16 12:49 ` [PATCH 12/13] KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU James Hogan
2017-01-16 12:49   ` James Hogan
2017-02-02 12:45   ` [PATCH v2 " James Hogan
2017-02-02 12:45     ` James Hogan
2017-01-16 12:49 ` [PATCH 13/13] KVM: MIPS: Claim KVM_CAP_READONLY_MEM support James Hogan
2017-01-16 12:49   ` James Hogan
     [not found] <201701171906397244491@zte.com.cn>
2017-01-17 13:27 ` [PATCH 2/13] KVM: MIPS: Pass type of fault down to kvm_mips_map_page() James Hogan
2017-01-17 13:27   ` James Hogan
     [not found] <201701181618464411994@zte.com.cn>
2017-01-18 12:12 ` James Hogan
2017-01-18 12:12   ` James Hogan
     [not found] <201701191629518310684@zte.com.cn>
2017-01-19  9:08 ` James Hogan
2017-01-19  9:08   ` James Hogan

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).