All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] MIPS: KVM: Guest FPU & SIMD (MSA) support
@ 2015-03-11 14:44 ` James Hogan
  0 siblings, 0 replies; 54+ messages in thread
From: James Hogan @ 2015-03-11 14:44 UTC (permalink / raw)
  To: Paolo Bonzini, kvm-u79uwXL29TY76Z2rM5mHXA,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA
  Cc: James Hogan, Paul Burton, Ralf Baechle, Gleb Natapov,
	Jonathan Corbet, linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA

This patchset primarily adds guest Floating Point Unit (FPU) and MIPS
SIMD Architecture (MSA) support to MIPS KVM, by enabling the host
FPU/MSA while in guest mode.

This patchset depends on Paul Burton's FP/MSA fixes patchset, which will
hopefully make it into 4.0. I'd like to get this into 4.1, so all review
comments welcome. Corresponding QEMU patches will follow soon.

- Adds KVM_CAP_MIPS_FPU and KVM_CAP_MIPS_MSA capabilities which must be
  enabled to add FPU/MSA to the guest.
- Supports FR=0, FR=1, FRE=1 floating point register modes and 128-bit
  vector registers.
- Does not support UFR/UFE (guest user control of FR/FRE bits), or MSA
  vector partitioning.
- Context restore is lazy: done on first actual use.
- Context save is lazy: once restored, host FPU/MSA gets
  enabled/disabled when guest enables/disables it, with registers left
  loaded as long as possible.
- So the state that can be loaded at any one time is:
    - No FPRs/vector state
    - FR=0 FPRs (change of FR discards FP state)
    - FR=1 FPRs
    - Vector state (includes FR=1 FPRs)
    - Vector state only (when guest CU1=0, FR=0)
- FCSR/MSACSR status registers are saved/restored around guest
  execution, since care must be taken to handle FP exceptions when
  writing these registers.

The patches are arranged roughly in groups:
- Patch 1 is a related minimal stable fix which can be applied in
  advance of the others (patch 18 fills it out a bit).
- Patch 2 is a generic MIPS change required to be able to restore
  FCSR/MSACSR registers with exceptions pending.
- Patches 3..10 add various misc KVM improvements and cleanups, most of
  which the later patches depend on.
- Patches 11..15 add the main guest FPU support.
- Patches 16..20 add the main guest MSA support (structured like 11.15).

James Hogan (20):
  MIPS: KVM: Handle MSA Disabled exceptions from guest

  MIPS: Clear [MSA]FPE CSR.Cause after notify_die()

  MIPS: KVM: Handle TRAP exceptions from guest kernel
  MIPS: KVM: Implement PRid CP0 register access
  MIPS: KVM: Sort kvm_mips_get_reg() registers
  MIPS: KVM: Drop pr_info messages on init/exit
  MIPS: KVM: Clean up register definitions a little
  MIPS: KVM: Simplify default guest Config registers
  MIPS: KVM: Add Config4/5 and writing of Config registers
  MIPS: KVM: Add vcpu_get_regs/vcpu_set_regs callback

  MIPS: KVM: Add base guest FPU support
  MIPS: KVM: Emulate FPU bits in COP0 interface
  MIPS: KVM: Add FP exception handling
  MIPS: KVM: Expose FPU registers
  MIPS: KVM: Wire up FPU capability

  MIPS: KVM: Add base guest MSA support
  MIPS: KVM: Emulate MSA bits in COP0 interface
  MIPS: KVM: Add MSA exception handling
  MIPS: KVM: Expose MSA registers
  MIPS: KVM: Wire up MSA capability

 Documentation/virtual/kvm/api.txt |  47 ++++
 arch/mips/include/asm/kdebug.h    |   3 +-
 arch/mips/include/asm/kvm_host.h  | 125 +++++++---
 arch/mips/include/uapi/asm/kvm.h  | 160 ++++++++-----
 arch/mips/kernel/asm-offsets.c    |  39 ++++
 arch/mips/kernel/genex.S          |  14 +-
 arch/mips/kernel/traps.c          |  16 +-
 arch/mips/kvm/Makefile            |   8 +-
 arch/mips/kvm/emulate.c           | 332 +++++++++++++++++++++++++-
 arch/mips/kvm/fpu.S               | 122 ++++++++++
 arch/mips/kvm/locore.S            |  38 +++
 arch/mips/kvm/mips.c              | 478 +++++++++++++++++++++++++++++++++++++-
 arch/mips/kvm/msa.S               | 161 +++++++++++++
 arch/mips/kvm/stats.c             |   4 +
 arch/mips/kvm/tlb.c               |   6 +
 arch/mips/kvm/trap_emul.c         | 199 +++++++++++++++-
 include/uapi/linux/kvm.h          |   2 +
 17 files changed, 1630 insertions(+), 124 deletions(-)
 create mode 100644 arch/mips/kvm/fpu.S
 create mode 100644 arch/mips/kvm/msa.S

Cc: Paolo Bonzini <pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Paul Burton <paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>
Cc: Gleb Natapov <gleb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Jonathan Corbet <corbet-T1hC0tSOHrs@public.gmane.org>
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org
Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
-- 
2.0.5

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

end of thread, other threads:[~2015-04-08  0:43 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 14:44 [PATCH 00/20] MIPS: KVM: Guest FPU & SIMD (MSA) support James Hogan
2015-03-11 14:44 ` James Hogan
2015-03-11 14:44 ` James Hogan
2015-03-11 14:44 ` James Hogan
2015-03-11 14:44 ` [PATCH 01/20] MIPS: KVM: Handle MSA Disabled exceptions from guest James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 02/20] MIPS: Clear [MSA]FPE CSR.Cause after notify_die() James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-23 13:56   ` Ralf Baechle
2015-04-08  0:43   ` Maciej W. Rozycki
2015-03-11 14:44 ` [PATCH 03/20] MIPS: KVM: Handle TRAP exceptions from guest kernel James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 04/20] MIPS: KVM: Implement PRid CP0 register access James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 05/20] MIPS: KVM: Sort kvm_mips_get_reg() registers James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 06/20] MIPS: KVM: Drop pr_info messages on init/exit James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 07/20] MIPS: KVM: Clean up register definitions a little James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 08/20] MIPS: KVM: Simplify default guest Config registers James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 09/20] MIPS: KVM: Add Config4/5 and writing of " James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 10/20] MIPS: KVM: Add vcpu_get_regs/vcpu_set_regs callback James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 11/20] MIPS: KVM: Add base guest FPU support James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 12/20] MIPS: KVM: Emulate FPU bits in COP0 interface James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 13/20] MIPS: KVM: Add FP exception handling James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 14/20] MIPS: KVM: Expose FPU registers James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-26 13:55   ` Paolo Bonzini
2015-03-11 14:44 ` [PATCH 16/20] MIPS: KVM: Add base guest MSA support James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 17/20] MIPS: KVM: Emulate MSA bits in COP0 interface James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-11 14:44 ` [PATCH 18/20] MIPS: KVM: Add MSA exception handling James Hogan
2015-03-11 14:44   ` James Hogan
     [not found] ` <1426085096-12932-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-03-11 14:44   ` [PATCH 15/20] MIPS: KVM: Wire up FPU capability James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44   ` [PATCH 19/20] MIPS: KVM: Expose MSA registers James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44     ` James Hogan
2015-03-11 14:44 ` [PATCH 20/20] MIPS: KVM: Wire up MSA capability James Hogan
2015-03-11 14:44   ` James Hogan
2015-03-26 13:58   ` Paolo Bonzini
2015-03-26 14:52     ` James Hogan
2015-03-26 14:52       ` James Hogan

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.