All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/26] KVM: arm64: SVE guest support
@ 2019-02-18 19:52 ` Dave Martin
  0 siblings, 0 replies; 189+ messages in thread
From: Dave Martin @ 2019-02-18 19:52 UTC (permalink / raw)
  To: kvmarm
  Cc: Peter Maydell, Okamoto Takayuki, Christoffer Dall,
	Ard Biesheuvel, Marc Zyngier, Catalin Marinas, Will Deacon,
	Zhang Lei, Julien Grall, Alex Bennée, linux-arm-kernel

This series implements support for allowing KVM guests to use the Arm
Scalable Vector Extension (SVE), superseding the previous v4 series [1].

The patches are also available on a branch for reviewer convenience. [2]

The patches are based on v5.0-rc6.

They depend on another small series currently under review [3] that does
a bit of relevant refactoring (as well as fixing an anomaly not directly
related to this series).  A base branch [4] is provided so that
reviewers don't need to hunt down both series independently.

This series contains no major update except for the removal of multiple
register slice support in the user register access ioctls.  The ABI is
kept as-is so that this functionality can be added back in later on
if/when needed.  ioctl access to nonexistent slices now yields ENOENT,
which is more consistent with the notion of an absent register.

For a description of minor updates, see the individual patches.


Functionality testing and stress-testing has been done, using a
hacked-up kvmtool [5]:

 * Arm Fast Model: full testing of arm64 defconfig, including running
   non-SVE and SVE guests with mixtures of vector lengths.  limited
   testing of other configurations.

 * ThunderX2: basic testing of arm64 defconfig, including booting guests
   (no SVE support on this hardware).

 * Full build-bisect testing and sparse testing of every commit done
   for arm64 (defconfig, CONFIG_ARM64_SVE=n, CONFIG_KVM=n) and arm
   (multi_v7_defconfig, CONFIG_KVM=y).  One new sparse warning,
   probably spurious (see note in patch 22).


AArch32 host testing is pending.  I will ping this series with a reply
to the cover letter when that testing has been completed.

   
Known issues:

 * **Possible bug**

   SVE state corruption has been in the host when running on the Arm
   Fast Model.

   After some investigation with the model engineers, it appears that
   there may be a model bug in this area.  I have also obtained detailed
   trace of failure cases, which is also suggestive of a model bug.  No
   clear evidence has been obtained to show that there is a bug in
   Linux, so far.

   All available evidence suggests that this bug will not affect non-SVE
   hardware: the symptom is unexpected zeroing of bits 128 and above of
   the vector registers (which don't exist prior to SVE).

 * kvmtool support is not mature


[1] [RFC PATCH v4 00/24] KVM: arm64: SVE guest support
https://lists.cs.columbia.edu/pipermail/kvmarm/2019-January/034134.html

[2] This series in git:
http://linux-arm.org/git?p=linux-dm.git;a=shortlog;h=refs/heads/sve-kvm/v5/head
git://linux-arm.org/linux-dm.git sve-kvm/v5/head

[3] [PATCH v2 0/2] Fix KVM_GET_REG_LIST invalid register ID regression
https://lists.cs.columbia.edu/pipermail/kvmarm/2018-December/033810.html

[4] Base of this series in git:
http://linux-arm.org/git?p=linux-dm.git;a=shortlog;h=refs/heads/sve-kvm/v5/base
git://linux-arm.org/linux-dm.git sve-kvm/v5/base

[5] [RFC PATCH 00/12] arm64: SVE guest support test hacks
https://lists.cs.columbia.edu/pipermail/kvmarm/2019-January/034162.html


Dave Martin (26):
  KVM: Documentation: Document arm64 core registers in detail
  arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush
  KVM: arm64: Delete orphaned declaration for __fpsimd_enabled()
  KVM: arm64: Refactor kvm_arm_num_regs() for easier maintenance
  KVM: arm64: Add missing #include of <linux/bitmap.h> to kvm_host.h
  arm64/sve: Check SVE virtualisability
  arm64/sve: Clarify role of the VQ map maintenance functions
  arm64/sve: Enable SVE state tracking for non-task contexts
  KVM: arm64: Add a vcpu flag to control SVE visibility for the guest
  KVM: arm64: Propagate vcpu into read_id_reg()
  KVM: arm64: Extend reset_unknown() to handle mixed RES0/UNKNOWN
    registers
  KVM: arm64: Support runtime sysreg visibility filtering
  KVM: arm64/sve: System register context switch and access support
  KVM: arm64/sve: Context switch the SVE registers
  KVM: Allow 2048-bit register access via ioctl interface
  KVM: arm64: Add missing #include of <linux/string.h> in guest.c
  KVM: arm64: Reject ioctl access to FPSIMD V-regs on SVE vcpus
  KVM: arm64/sve: Add SVE support to register access ioctl interface
  KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST
  arm64/sve: In-kernel vector length availability query interface
  KVM: arm/arm64: Add hook to finalize the vcpu configuration
  KVM: arm64/sve: Add pseudo-register for the guest's vector lengths
  KVM: arm64/sve: Allow userspace to enable SVE for vcpus
  KVM: arm64: Add a capabillity to advertise SVE support
  KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG
  KVM: arm64/sve: Document KVM API extensions for SVE

 Documentation/virtual/kvm/api.txt |  93 ++++++++++
 arch/arm/include/asm/kvm_host.h   |   4 +
 arch/arm64/include/asm/fpsimd.h   |  33 +++-
 arch/arm64/include/asm/kvm_host.h |  35 +++-
 arch/arm64/include/asm/kvm_hyp.h  |   1 -
 arch/arm64/include/asm/sysreg.h   |   3 +
 arch/arm64/include/uapi/asm/kvm.h |  22 +++
 arch/arm64/kernel/cpufeature.c    |   2 +-
 arch/arm64/kernel/fpsimd.c        | 172 +++++++++++++------
 arch/arm64/kernel/signal.c        |   5 -
 arch/arm64/kvm/fpsimd.c           |  17 +-
 arch/arm64/kvm/guest.c            | 348 +++++++++++++++++++++++++++++++++++---
 arch/arm64/kvm/hyp/switch.c       |  69 ++++++--
 arch/arm64/kvm/reset.c            |  87 +++++++++-
 arch/arm64/kvm/sys_regs.c         | 144 ++++++++++++++--
 arch/arm64/kvm/sys_regs.h         |  24 ++-
 include/uapi/linux/kvm.h          |   2 +
 virt/kvm/arm/arm.c                |   8 +
 18 files changed, 944 insertions(+), 125 deletions(-)

-- 
2.1.4

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

end of thread, other threads:[~2019-03-08  7:07 UTC | newest]

Thread overview: 189+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 19:52 [PATCH v5 00/26] KVM: arm64: SVE guest support Dave Martin
2019-02-18 19:52 ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 01/26] KVM: Documentation: Document arm64 core registers in detail Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 11:48   ` Julien Grall
2019-02-21 11:48     ` Julien Grall
2019-02-26 12:05     ` Dave Martin
2019-02-26 12:05       ` Dave Martin
2019-02-21 11:57   ` Peter Maydell
2019-02-21 11:57     ` Peter Maydell
2019-02-18 19:52 ` [PATCH v5 02/26] arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 12:39   ` Julien Grall
2019-02-26 12:06     ` Dave Martin
2019-02-26 12:06       ` Dave Martin
2019-02-26 12:35       ` Julien Grall
2019-02-26 12:35         ` Julien Grall
2019-02-18 19:52 ` [PATCH v5 03/26] KVM: arm64: Delete orphaned declaration for __fpsimd_enabled() Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 04/26] KVM: arm64: Refactor kvm_arm_num_regs() for easier maintenance Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 05/26] KVM: arm64: Add missing #include of <linux/bitmap.h> to kvm_host.h Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 15:23   ` Mark Rutland
2019-02-20 15:23     ` Mark Rutland
2019-02-26 12:06     ` Dave Martin
2019-02-26 12:06       ` Dave Martin
2019-02-26 12:31       ` Mark Rutland
2019-02-26 12:33         ` Dave Martin
2019-02-26 12:33           ` Dave Martin
2019-02-26 12:40           ` Mark Rutland
2019-02-26 12:40             ` Mark Rutland
2019-02-18 19:52 ` [PATCH v5 06/26] arm64/sve: Check SVE virtualisability Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 11:12   ` Julien Thierry
2019-02-20 11:12     ` Julien Thierry
2019-02-26 12:06     ` Dave Martin
2019-02-26 12:06       ` Dave Martin
2019-03-01 12:39       ` Julien Thierry
2019-03-01 12:39         ` Julien Thierry
2019-03-01 14:44         ` Dave Martin
2019-03-01 14:44           ` Dave Martin
2019-02-21 13:36   ` Julien Grall
2019-02-21 13:36     ` Julien Grall
2019-02-26 12:06     ` Dave Martin
2019-02-26 12:06       ` Dave Martin
2019-02-26 15:43       ` Julien Grall
2019-02-26 15:43         ` Julien Grall
2019-02-18 19:52 ` [PATCH v5 07/26] arm64/sve: Clarify role of the VQ map maintenance functions Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 11:43   ` Julien Thierry
2019-02-20 11:43     ` Julien Thierry
2019-02-26 12:06     ` Dave Martin
2019-02-26 12:06       ` Dave Martin
2019-02-21 13:46   ` Julien Grall
2019-02-21 13:46     ` Julien Grall
2019-02-26 12:07     ` Dave Martin
2019-02-26 12:07       ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-22 15:26   ` Julien Grall
2019-02-22 15:26     ` Julien Grall
2019-02-26 12:07     ` Dave Martin
2019-02-26 12:07       ` Dave Martin
2019-02-26 15:49       ` Julien Grall
2019-02-26 15:49         ` Julien Grall
2019-02-26 15:58         ` Dave Martin
2019-02-26 15:58           ` Dave Martin
2019-02-26 15:59           ` Julien Grall
2019-02-26 15:59             ` Julien Grall
2019-02-26 16:03             ` Dave Martin
2019-02-26 16:03               ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 09/26] KVM: arm64: Add a vcpu flag to control SVE visibility for the guest Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 10/26] KVM: arm64: Propagate vcpu into read_id_reg() Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 11/26] KVM: arm64: Extend reset_unknown() to handle mixed RES0/UNKNOWN registers Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 13:33   ` Julien Thierry
2019-02-20 13:33     ` Julien Thierry
2019-02-26 12:07     ` Dave Martin
2019-02-26 12:07       ` Dave Martin
2019-02-22 16:04   ` Julien Grall
2019-02-22 16:04     ` Julien Grall
2019-02-18 19:52 ` [PATCH v5 12/26] KVM: arm64: Support runtime sysreg visibility filtering Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 14:33   ` Julien Thierry
2019-02-20 14:33     ` Julien Thierry
2019-02-26 12:07     ` Dave Martin
2019-02-26 12:07       ` Dave Martin
2019-02-20 15:37   ` Mark Rutland
2019-02-20 15:37     ` Mark Rutland
2019-02-26 12:12     ` Dave Martin
2019-02-26 12:12       ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 13/26] KVM: arm64/sve: System register context switch and access support Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 16:48   ` Julien Thierry
2019-02-20 16:48     ` Julien Thierry
2019-02-26 16:32   ` Julien Grall
2019-02-26 16:32     ` Julien Grall
2019-02-26 17:01     ` Dave Martin
2019-02-26 17:01       ` Dave Martin
2019-02-27 12:02       ` Julien Grall
2019-02-27 12:02         ` Julien Grall
2019-02-27 13:50         ` Dave Martin
2019-02-27 13:50           ` Dave Martin
2019-02-27 14:17           ` Julien Grall
2019-02-27 14:17             ` Julien Grall
2019-02-27 14:38             ` Dave Martin
2019-02-27 14:38               ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 14/26] KVM: arm64/sve: Context switch the SVE registers Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 16:19   ` Mark Rutland
2019-02-20 16:19     ` Mark Rutland
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-02-20 16:46   ` Julien Thierry
2019-02-20 16:46     ` Julien Thierry
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-02-26 16:56       ` Julien Grall
2019-02-26 16:56         ` Julien Grall
2019-02-27 13:37         ` Dave Martin
2019-02-27 13:37           ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 15/26] KVM: Allow 2048-bit register access via ioctl interface Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 16/26] KVM: arm64: Add missing #include of <linux/string.h> in guest.c Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 17/26] KVM: arm64: Reject ioctl access to FPSIMD V-regs on SVE vcpus Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 12:06   ` Julien Thierry
2019-02-21 12:06     ` Julien Thierry
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 18/26] KVM: arm64/sve: Add SVE support to register access ioctl interface Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 15:23   ` Julien Thierry
2019-02-21 15:23     ` Julien Thierry
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-03-01 13:03       ` Julien Thierry
2019-03-01 13:03         ` Julien Thierry
2019-03-01 14:45         ` Dave Martin
2019-03-01 14:45           ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 19/26] KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 16:28   ` Julien Thierry
2019-02-21 16:28     ` Julien Thierry
2019-02-18 19:52 ` [PATCH v5 20/26] arm64/sve: In-kernel vector length availability query interface Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 21/26] KVM: arm/arm64: Add hook to finalize the vcpu configuration Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 22/26] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-21 17:48   ` Julien Thierry
2019-02-21 17:48     ` Julien Thierry
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-03-01 13:28       ` Julien Thierry
2019-03-01 13:28         ` Julien Thierry
2019-03-01 14:55         ` Dave Martin
2019-03-01 14:55           ` Dave Martin
2019-03-07 13:47           ` Marc Zyngier
2019-03-07 13:47             ` Marc Zyngier
2019-03-07 15:30             ` Dave Martin
2019-03-07 15:30               ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 23/26] KVM: arm64/sve: Allow userspace to enable SVE for vcpus Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-22  9:05   ` Julien Thierry
2019-02-22  9:05     ` Julien Thierry
2019-02-26 12:13     ` Dave Martin
2019-02-26 12:13       ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 24/26] KVM: arm64: Add a capabillity to advertise SVE support Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-22  9:10   ` Julien Thierry
2019-02-22  9:10     ` Julien Thierry
2019-02-26 12:14     ` Dave Martin
2019-02-26 12:14       ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 25/26] KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-18 19:52 ` [PATCH v5 26/26] KVM: arm64/sve: Document KVM API extensions for SVE Dave Martin
2019-02-18 19:52   ` Dave Martin
2019-02-20 15:47 ` [PATCH v5 00/26] KVM: arm64: SVE guest support Dave Martin
2019-02-20 15:47   ` Dave Martin
2019-03-03  2:40 ` Zhang, Lei
2019-03-05  9:47   ` Dave Martin
2019-03-05  9:47     ` Dave Martin
2019-03-08  7:06     ` Zhang, Lei
2019-03-08  7:06       ` Zhang, Lei

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.