All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 00/18] KVM: arm64: Optimise FPSIMD context switching
@ 2018-05-22 16:05 ` Dave Martin
  0 siblings, 0 replies; 138+ messages in thread
From: Dave Martin @ 2018-05-22 16:05 UTC (permalink / raw)
  To: kvmarm
  Cc: linux-arm-kernel, Christoffer Dall, Marc Zyngier, Ard Biesheuvel,
	Catalin Marinas, Will Deacon, linux-arch, linux-kernel,
	Ingo Molnar, Peter Zijlstra, Steven Rostedt, Oleg Nesterov

Note: Most of these patches are Arm-specific.  People not Cc'd on the
whole series can find it in the linux-arm-kernel archive [2].

This series aims to improve the way FPSIMD context is handled by KVM.
Changes since the previous v9 [1] are mostly minor, but there are some
fixes worthy of closer attention.

In addition to addressing a review comment by Marc on the changes in v9,
this series attempts to fix a NULL-dereference bug observed by Marc on
ESPRESSOBin [5].  A reproducer for a similar bug is documented in [6],
and this series fixes the observed bug (in patches 1 and 7).  At the
moment, this is my best hypothesis for the ESPRESSOBin failure, though
the relationship is unproven and we have no reproducer for the latter.

The changes are summarised in the individual patches.

Reviewers please note:

 * Since v8, patches 10 and 14 have changed.  Reviewer tags have been
   stripped from patch 14, due to non-trivial changes in v9 of the
   series: see the patch for details.

 * Since v9, patches 1 and 7 are also new, and correct a latent bug in
   FPSIMD context handling which is exposed by this series.

If people could take a close look at the above patches, that would be
much appreciated.

Cheers
---Dave

[1] [PATCH v9 00/16] KVM: arm64: Optimise FPSIMD context switching
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/579569.html

[2] linux-arm-kernel archive
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/thread.html

[3] [kvmarm:queue 9/29] arch/arm/kvm/../../../virt/kvm/arm/arm.c:783:3: error: implicit declaration of function 'kvm_arch_vcpu_ctxsync_fp'; did you mean 'kvm_arch_vcpu_put_fp'?
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/579400.html

[4] [kvmarm:queue 13/29] arch/arm/kvm/../../../virt/kvm/arm/arm.c:1598:6: error: implicit declaration of function 'system_supports_sve'
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/579399.html

[5] [PULL v8] KVM: arm64: Optimise FPSIMD context switching
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/579353.html


Christoffer Dall (1):
  KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change

Dave Martin (17):
  arm64: fpsimd: Fix TIF_FOREIGN_FPSTATE after invalidating cpu regs
  thread_info: Add update_thread_flag() helpers
  arm64: Use update{,_tsk}_thread_flag()
  KVM: arm64: Convert lazy FPSIMD context switch trap to C
  arm64: fpsimd: Generalise context saving for non-task contexts
  arm64: fpsimd: Eliminate task->mm checks
  arm64/sve: Refactor user SVE trap maintenance for external use
  KVM: arm64: Repurpose vcpu_arch.debug_flags for general-purpose flags
  KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing
  arm64/sve: Move read_zcr_features() out of cpufeature.h
  arm64/sve: Switch sve_pffr() argument from task to thread
  arm64/sve: Move sve_pffr() to fpsimd.h and make inline
  KVM: arm64: Save host SVE context as appropriate
  KVM: arm64: Remove eager host SVE state saving
  KVM: arm64: Remove redundant *exit_code changes in fpsimd_guest_exit()
  KVM: arm64: Fold redundant exit code checks out of fixup_guest_exit()
  KVM: arm64: Invoke FPSIMD context switch trap from C

 arch/arm/include/asm/kvm_host.h      |  10 +-
 arch/arm64/Kconfig                   |   7 ++
 arch/arm64/include/asm/cpufeature.h  |  29 ------
 arch/arm64/include/asm/fpsimd.h      |  21 +++++
 arch/arm64/include/asm/kvm_asm.h     |   3 -
 arch/arm64/include/asm/kvm_host.h    |  45 +++++++--
 arch/arm64/include/asm/processor.h   |   2 +
 arch/arm64/include/asm/thread_info.h |   1 +
 arch/arm64/kernel/fpsimd.c           | 176 +++++++++++++++++------------------
 arch/arm64/kernel/ptrace.c           |   1 +
 arch/arm64/kvm/Kconfig               |   1 +
 arch/arm64/kvm/Makefile              |   2 +-
 arch/arm64/kvm/debug.c               |   8 +-
 arch/arm64/kvm/fpsimd.c              | 110 ++++++++++++++++++++++
 arch/arm64/kvm/hyp/debug-sr.c        |   6 +-
 arch/arm64/kvm/hyp/entry.S           |  43 ---------
 arch/arm64/kvm/hyp/hyp-entry.S       |  19 ----
 arch/arm64/kvm/hyp/switch.c          | 124 ++++++++++++++++--------
 arch/arm64/kvm/hyp/sysreg-sr.c       |   4 +-
 arch/arm64/kvm/sys_regs.c            |   9 +-
 include/linux/kvm_host.h             |   9 ++
 include/linux/sched.h                |   6 ++
 include/linux/thread_info.h          |  11 +++
 virt/kvm/Kconfig                     |   3 +
 virt/kvm/arm/arm.c                   |  14 ++-
 virt/kvm/kvm_main.c                  |   7 +-
 26 files changed, 416 insertions(+), 255 deletions(-)
 create mode 100644 arch/arm64/kvm/fpsimd.c

-- 
2.1.4

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

end of thread, other threads:[~2018-05-25 11:28 UTC | newest]

Thread overview: 138+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 16:05 [PATCH v10 00/18] KVM: arm64: Optimise FPSIMD context switching Dave Martin
2018-05-22 16:05 ` Dave Martin
2018-05-22 16:05 ` [PATCH v10 01/18] arm64: fpsimd: Fix TIF_FOREIGN_FPSTATE after invalidating cpu regs Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 11:33   ` Christoffer Dall
2018-05-23 11:33     ` Christoffer Dall
2018-05-23 13:44   ` Alex Bennée
2018-05-23 13:44     ` Alex Bennée
2018-05-23 13:46   ` Catalin Marinas
2018-05-23 13:46     ` Catalin Marinas
2018-05-22 16:05 ` [PATCH v10 02/18] thread_info: Add update_thread_flag() helpers Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 13:46   ` Alex Bennée
2018-05-23 13:46     ` Alex Bennée
2018-05-23 13:57     ` Dave Martin
2018-05-23 13:57       ` Dave Martin
2018-05-23 14:35       ` Alex Bennée
2018-05-23 14:35         ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 03/18] arm64: Use update{,_tsk}_thread_flag() Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 13:48   ` Alex Bennée
2018-05-23 13:48     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 04/18] KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 14:34   ` Alex Bennée
2018-05-23 14:34     ` Alex Bennée
2018-05-23 14:40     ` Dave Martin
2018-05-23 14:40       ` Dave Martin
2018-05-24  8:11       ` Christoffer Dall
2018-05-24  8:11         ` Christoffer Dall
2018-05-24  9:18         ` Alex Bennée
2018-05-24  9:18           ` Alex Bennée
2018-05-24 10:04           ` Dave Martin
2018-05-24 10:04             ` Dave Martin
2018-05-22 16:05 ` [PATCH v10 05/18] KVM: arm64: Convert lazy FPSIMD context switch trap to C Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 19:35   ` Alex Bennée
2018-05-23 19:35     ` Alex Bennée
2018-05-24  8:12     ` Christoffer Dall
2018-05-24  8:12       ` Christoffer Dall
2018-05-24  8:54       ` Dave Martin
2018-05-24  8:54         ` Dave Martin
2018-05-24  9:14         ` Alex Bennée
2018-05-24  9:14           ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 06/18] arm64: fpsimd: Generalise context saving for non-task contexts Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 20:15   ` Alex Bennée
2018-05-23 20:15     ` Alex Bennée
2018-05-24  9:03     ` Dave Martin
2018-05-24  9:03       ` Dave Martin
2018-05-24  9:41       ` Alex Bennée
2018-05-24  9:41         ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 07/18] arm64: fpsimd: Eliminate task->mm checks Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 11:48   ` Christoffer Dall
2018-05-23 11:48     ` Christoffer Dall
2018-05-23 13:31     ` Dave Martin
2018-05-23 13:31       ` Dave Martin
2018-05-23 14:56       ` Catalin Marinas
2018-05-23 14:56         ` Catalin Marinas
2018-05-23 15:03         ` Dave Martin
2018-05-23 15:03           ` Dave Martin
2018-05-23 16:42           ` Catalin Marinas
2018-05-23 16:42             ` Catalin Marinas
2018-05-24  8:33           ` Christoffer Dall
2018-05-24  8:33             ` Christoffer Dall
2018-05-24  9:16             ` Alex Bennée
2018-05-24  9:16               ` Alex Bennée
2018-05-24  9:50             ` Dave Martin
2018-05-24  9:50               ` Dave Martin
2018-05-24 10:06               ` Christoffer Dall
2018-05-24 10:06                 ` Christoffer Dall
2018-05-24 14:37                 ` Dave Martin
2018-05-24 14:37                   ` Dave Martin
2018-05-25  9:00                   ` Christoffer Dall
2018-05-25  9:00                     ` Christoffer Dall
2018-05-25  9:45                     ` Dave Martin
2018-05-25  9:45                       ` Dave Martin
2018-05-25 11:28                       ` Christoffer Dall
2018-05-25 11:28                         ` Christoffer Dall
2018-05-24  9:19   ` Alex Bennée
2018-05-24  9:19     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 08/18] arm64/sve: Refactor user SVE trap maintenance for external use Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 20:16   ` Alex Bennée
2018-05-23 20:16     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 09/18] KVM: arm64: Repurpose vcpu_arch.debug_flags for general-purpose flags Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24  9:21   ` Alex Bennée
2018-05-24  9:21     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 10/18] KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 10:09   ` Alex Bennée
2018-05-24 10:09     ` Alex Bennée
2018-05-24 10:18     ` Dave Martin
2018-05-24 10:18       ` Dave Martin
2018-05-22 16:05 ` [PATCH v10 11/18] arm64/sve: Move read_zcr_features() out of cpufeature.h Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 10:12   ` Alex Bennée
2018-05-24 10:12     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 12/18] arm64/sve: Switch sve_pffr() argument from task to thread Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 10:12   ` Alex Bennée
2018-05-24 10:12     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 13/18] arm64/sve: Move sve_pffr() to fpsimd.h and make inline Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 10:20   ` Alex Bennée
2018-05-24 10:20     ` Alex Bennée
2018-05-24 11:22     ` Dave Martin
2018-05-24 11:22       ` Dave Martin
2018-05-22 16:05 ` [PATCH v10 14/18] KVM: arm64: Save host SVE context as appropriate Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-23 14:59   ` Catalin Marinas
2018-05-23 14:59     ` Catalin Marinas
2018-05-24  9:11   ` Christoffer Dall
2018-05-24  9:11     ` Christoffer Dall
2018-05-24 14:49   ` Alex Bennée
2018-05-24 14:49     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 15/18] KVM: arm64: Remove eager host SVE state saving Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 14:54   ` Alex Bennée
2018-05-24 14:54     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 16/18] KVM: arm64: Remove redundant *exit_code changes in fpsimd_guest_exit() Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24  9:11   ` Christoffer Dall
2018-05-24  9:11     ` Christoffer Dall
2018-05-24 15:02   ` Alex Bennée
2018-05-24 15:02     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 17/18] KVM: arm64: Fold redundant exit code checks out of fixup_guest_exit() Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24  9:12   ` Christoffer Dall
2018-05-24  9:12     ` Christoffer Dall
2018-05-24 15:06   ` Alex Bennée
2018-05-24 15:06     ` Alex Bennée
2018-05-22 16:05 ` [PATCH v10 18/18] KVM: arm64: Invoke FPSIMD context switch trap from C Dave Martin
2018-05-22 16:05   ` Dave Martin
2018-05-24 15:09   ` Alex Bennée
2018-05-24 15:09     ` Alex Bennée

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.