Skip to content

KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

David Daney kvm linux-mips lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest31 patches 49 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/31MIPS: Move allocate_kscratch to cpu-probe.c and make it public.arch/mips/include/asm/mipsregs.h arch/mips/kernel/cpu-probe.c arch/mips/mm/tlbex.c+32 -192 replies
2/31MIPS: Save and restore K0/K1 when CONFIG_KVM_MIPSVZarch/mips/include/asm/mipsregs.h arch/mips/include/asm/stackframe.h arch/mips/kernel/cpu-probe.c +5 more+82 -10 replies
3/31mips/kvm: Fix 32-bitisms in kvm_locore.Sarch/mips/kvm/kvm_locore.S+4 -42 replies
4/31mips/kvm: Add casts to avoid pointer width mismatch build failures.arch/mips/kvm/kvm_mips.c arch/mips/kvm/kvm_mips_dyntrans.c arch/mips/kvm/kvm_mips_emul.c +1 more+7 -71 reply
5/31mips/kvm: Use generic cache flushing functions.arch/mips/kvm/kvm_mips_emul.c+2 -41 reply
6/31mips/kvm: Rename kvm_vcpu_arch.pc to kvm_vcpu_arch.epcarch/mips/include/asm/kvm_host.h arch/mips/kernel/asm-offsets.c arch/mips/kvm/kvm_locore.S +4 more+95 -951 reply
7/31mips/kvm: Rename VCPU_registername to KVM_VCPU_ARCH_registernamearch/mips/kernel/asm-offsets.c arch/mips/kvm/kvm_locore.S+137 -1371 reply
8/31mips/kvm: Fix code formatting in arch/mips/kvm/kvm_locore.Sarch/mips/kvm/kvm_locore.S+464 -4571 reply
9/31mips/kvm: Factor trap-and-emulate support into a pluggable implementation.arch/mips/include/asm/kvm_host.h arch/mips/include/asm/kvm_mips_te.h arch/mips/kernel/asm-offsets.c +10 more+1807 -15331 reply
10/31mips/kvm: Implement ioctls to get and set FPU registers.arch/mips/include/asm/kvm_host.h arch/mips/kernel/asm-offsets.c arch/mips/kvm/kvm_mips.c+40 -21 reply
11/31MIPS: Rearrange branch.c so it can be used by kvm code.arch/mips/include/asm/branch.h arch/mips/kernel/branch.c+54 -161 reply
12/31MIPS: Add instruction format information for WAIT, MTC0, MFC0, et al.arch/mips/include/uapi/asm/inst.h+22 -11 reply
13/31mips/kvm: Add accessors for MIPS VZ registers.arch/mips/include/asm/mipsregs.h+260 -01 reply
14/31mips/kvm: Add thread_info flag to indicate operation in MIPS VZ Guest Mode.arch/mips/include/asm/thread_info.h+2 -01 reply
15/31mips/kvm: Exception handling to leave and reenter guest mode.arch/mips/include/asm/stackframe.h+132 -32 replies
16/31mips/kvm: Add exception handler for MIPSVZ Guest exceptions.arch/mips/kernel/genex.S+3 -01 reply
17/31MIPS: Quit exposing Kconfig symbols in uapi headers.arch/mips/include/asm/ptrace.h arch/mips/include/uapi/asm/ptrace.h+34 -152 replies
18/31mips/kvm: Add pt_regs slots for BadInstr and BadInstrParch/mips/include/asm/ptrace.h arch/mips/kernel/asm-offsets.c+8 -01 reply
19/31mips/kvm: Add host definitions for MIPS VZ based host.arch/mips/include/asm/kvm_mips_vz.h+29 -01 reply
20/31mips/kvm: Hook into TLB fault handlers.arch/mips/mm/fault.c arch/mips/mm/tlbex-fault.S+14 -03 replies
21/31mips/kvm: Allow set_except_vector() to be used from MIPSVZ code.arch/mips/include/asm/uasm.h arch/mips/kernel/traps.c+2 -21 reply
22/31mips/kvm: Split get_new_mmu_context into two parts.arch/mips/include/asm/mmu_context.h+8 -21 reply
23/31mips/kvm: Hook into CP unusable exception handler.arch/mips/kernel/traps.c+8 -01 reply
24/31mips/kvm: Add thread_struct fields used by MIPSVZ hosts.arch/mips/include/asm/processor.h arch/mips/kernel/asm-offsets.c+11 -01 reply
25/31mips/kvm: Add some asm-offsets constants used by MIPSVZ.arch/mips/kernel/asm-offsets.c+7 -02 replies
26/31mips/kvm: Split up Kconfig and Makefile definitions in preperation for MIPSVZ.arch/mips/kvm/Kconfig arch/mips/kvm/Makefile+17 -111 reply
27/31mips/kvm: Gate the use of kvm_local_flush_tlb_all() by KVM_MIPSTEarch/mips/include/asm/mmu_context.h+1 -11 reply
28/31mips/kvm: Only use KVM_COALESCED_MMIO_PAGE_OFFSET with KVM_MIPSTEarch/mips/include/asm/kvm_host.h+2 -01 reply
29/31mips/kvm: Add MIPSVZ support.arch/mips/kvm/kvm_mips.c arch/mips/kvm/kvm_mipsvz.c arch/mips/kvm/kvm_mipsvz_guest.S+2156 -31 reply
30/31mips/kvm: Enable MIPSVZ in Kconfig/Makefilearch/mips/Kconfig arch/mips/kvm/Kconfig arch/mips/kvm/Makefile+11 -01 reply
31/31mips/kvm: Allow for upto 8 KVM vcpus per vm.arch/mips/include/asm/kvm_host.h+1 -11 reply

Reviews trailers per patch

24 of 31 patches have a Reviewed-by or Acked-by.

PatchRalf Baechle
1/31A-b A-b
2/31
3/31A-b
4/31A-b
5/31
6/31A-b
7/31A-b
8/31A-b
9/31A-b
10/31A-b
11/31A-b
12/31A-b
13/31A-b
14/31A-b
15/31A-b
16/31A-b
17/31
18/31A-b
19/31A-b
20/31A-b
21/31
22/31A-b
23/31
24/31A-b
25/31
26/31A-b
27/31A-b
28/31
29/31A-b
30/31A-b
31/31A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

From: David Daney <[email protected]>

These patches take a somewhat different approach to MIPS virtualization via the MIPS-VZ extensions than the patches previously sent by Sanjay Lal.

Several facts about the code:

o Existing exception handlers are modified to hook in to KVM instead of intercepting all exceptions via the EBase register, and then chaining to real exception handlers.

o Able to boot 64-bit SMP guests that use the FPU (I have booted 4-way SMP 64-bit MIPS/Linux).

o Additional overhead on every exception even when *no* vCPU is running.

o Lower interrupt overhead, than the EBase interception method, when vCPU *is* running.

o This code is somewhat smaller than the existing trap/emulate implementation (about 2100 lines vs. about 5300 lines)

o Currently probably only usable on the OCTEON III CPU model, as some MIPS-VZ implementation-defined behaviors were assumed to have the OCTEON III behavior.

Note: I think Ralf already has the 17/31 (MIPS: Quit exposing Kconfig symbols in uapi headers.) queued, but I also include it here.

David Daney (31):
MIPS: Move allocate_kscratch to cpu-probe.c and make it public.
MIPS: Save and restore K0/K1 when CONFIG_KVM_MIPSVZ mips/kvm: Fix 32-bitisms in kvm_locore.S
mips/kvm: Add casts to avoid pointer width mismatch build failures. mips/kvm: Use generic cache flushing functions.
mips/kvm: Rename kvm_vcpu_arch.pc to kvm_vcpu_arch.epc mips/kvm: Rename VCPU_registername to KVM_VCPU_ARCH_registername mips/kvm: Fix code formatting in arch/mips/kvm/kvm_locore.S mips/kvm: Factor trap-and-emulate support into a pluggable
implementation.
mips/kvm: Implement ioctls to get and set FPU registers.
MIPS: Rearrange branch.c so it can be used by kvm code.
MIPS: Add instruction format information for WAIT, MTC0, MFC0, et al. mips/kvm: Add accessors for MIPS VZ registers.
mips/kvm: Add thread_info flag to indicate operation in MIPS VZ Guest
Mode.
mips/kvm: Exception handling to leave and reenter guest mode. mips/kvm: Add exception handler for MIPSVZ Guest exceptions.
MIPS: Quit exposing Kconfig symbols in uapi headers. mips/kvm: Add pt_regs slots for BadInstr and BadInstrP mips/kvm: Add host definitions for MIPS VZ based host. mips/kvm: Hook into TLB fault handlers.
mips/kvm: Allow set_except_vector() to be used from MIPSVZ code. mips/kvm: Split get_new_mmu_context into two parts. mips/kvm: Hook into CP unusable exception handler. mips/kvm: Add thread_struct fields used by MIPSVZ hosts. mips/kvm: Add some asm-offsets constants used by MIPSVZ. mips/kvm: Split up Kconfig and Makefile definitions in preperation
for MIPSVZ.
mips/kvm: Gate the use of kvm_local_flush_tlb_all() by KVM_MIPSTE mips/kvm: Only use KVM_COALESCED_MMIO_PAGE_OFFSET with KVM_MIPSTE mips/kvm: Add MIPSVZ support.
mips/kvm: Enable MIPSVZ in Kconfig/Makefile
mips/kvm: Allow for upto 8 KVM vcpus per vm.

 arch/mips/Kconfig                   |    1 +
 arch/mips/include/asm/branch.h      |    7 +
 arch/mips/include/asm/kvm_host.h    |  622 +-----------
 arch/mips/include/asm/kvm_mips_te.h |  589 +++++++++++
 arch/mips/include/asm/kvm_mips_vz.h |   29 +
 arch/mips/include/asm/mipsregs.h    |  264 +++++
 arch/mips/include/asm/mmu_context.h |   12 +-
 arch/mips/include/asm/processor.h   |    6 +
 arch/mips/include/asm/ptrace.h      |   36 +
 arch/mips/include/asm/stackframe.h  |  150 ++-
 arch/mips/include/asm/thread_info.h |    2 +
 arch/mips/include/asm/uasm.h        |    2 +-
 arch/mips/include/uapi/asm/inst.h   |   23 +-
 arch/mips/include/uapi/asm/ptrace.h |   17 +-
 arch/mips/kernel/asm-offsets.c      |  124 ++-
 arch/mips/kernel/branch.c           |   63 +-
 arch/mips/kernel/cpu-probe.c        |   34 +
 arch/mips/kernel/genex.S            |    8 +
 arch/mips/kernel/scall64-64.S       |   12 +
 arch/mips/kernel/scall64-n32.S      |   12 +
 arch/mips/kernel/traps.c            |   15 +-
 arch/mips/kvm/Kconfig               |   23 +-
 arch/mips/kvm/Makefile              |   15 +-
 arch/mips/kvm/kvm_locore.S          |  980 +++++++++---------
 arch/mips/kvm/kvm_mips.c            |  768 ++------------
 arch/mips/kvm/kvm_mips_comm.h       |    1 +
 arch/mips/kvm/kvm_mips_commpage.c   |    9 +-
 arch/mips/kvm/kvm_mips_dyntrans.c   |    4 +-
 arch/mips/kvm/kvm_mips_emul.c       |  312 +++---
 arch/mips/kvm/kvm_mips_int.c        |   53 +-
 arch/mips/kvm/kvm_mips_int.h        |    2 -
 arch/mips/kvm/kvm_mips_stats.c      |    6 +-
 arch/mips/kvm/kvm_mipsvz.c          | 1894 +++++++++++++++++++++++++++++++++++
 arch/mips/kvm/kvm_mipsvz_guest.S    |  234 +++++
 arch/mips/kvm/kvm_tlb.c             |  140 +--
 arch/mips/kvm/kvm_trap_emul.c       |  932 +++++++++++++++--
 arch/mips/mm/fault.c                |    8 +
 arch/mips/mm/tlbex-fault.S          |    6 +
 arch/mips/mm/tlbex.c                |   45 +-
 39 files changed, 5299 insertions(+), 2161 deletions(-)
 create mode 100644 arch/mips/include/asm/kvm_mips_te.h
 create mode 100644 arch/mips/include/asm/kvm_mips_vz.h
 create mode 100644 arch/mips/kvm/kvm_mipsvz.c
 create mode 100644 arch/mips/kvm/kvm_mipsvz_guest.S
Signature · 1 line
1.7.11.7