Re: [PATCH v2 07/14] KVM: arm64/sve: Make register ioctl access errors more consistent

2019-04-25 Thread Dave Martin
On Thu, Apr 25, 2019 at 01:30:29PM +0100, Alex Bennée wrote: > > Dave Martin writes: > > > Currently, the way error codes are generated when processing the > > SVE register access ioctls in a bit haphazard. > > > > This patch refactors the code so that the beha

Re: [PATCH v7 11/27] KVM: arm64: Support runtime sysreg visibility filtering

2019-04-24 Thread Dave Martin
On Wed, Apr 24, 2019 at 09:39:31AM +, Alex Bennée wrote: > > Dave Martin writes: > > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optio

Re: [PATCH v10 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest

2019-04-24 Thread Dave Martin
On Wed, Apr 24, 2019 at 11:27:50AM +0530, Amit Daniel Kachhap wrote: > Hi, > > On 4/23/19 9:14 PM, Dave Martin wrote: > >On Tue, Apr 23, 2019 at 10:12:34AM +0530, Amit Daniel Kachhap wrote: > >>A per vcpu flag is added to check if pointer authentication is

Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-24 Thread Dave Martin
On Wed, Apr 24, 2019 at 12:32:22PM +0530, Amit Daniel Kachhap wrote: > Hi, > > On 4/23/19 9:16 PM, Dave Martin wrote: > >On Tue, Apr 23, 2019 at 10:12:38AM +0530, Amit Daniel Kachhap wrote: > >>This patch adds a runtime capabality for KVM tool to enable Arm64 8.3 &g

Re: [PATCH v10 2/5] KVM: arm/arm64: context-switch ptrauth registers

2019-04-24 Thread Dave Martin
On Wed, Apr 24, 2019 at 11:29:37AM +0100, Marc Zyngier wrote: > On 23/04/2019 16:44, Dave Martin wrote: > > On Tue, Apr 23, 2019 at 03:54:32PM +0530, Amit Daniel Kachhap wrote: > >> Hi Mark, > >> > >> On 4/23/19 3:09 PM, Marc Zyngier wrote: > >>>

Re: [PATCH v10 2/5] KVM: arm/arm64: context-switch ptrauth registers

2019-04-24 Thread Dave Martin
this before, but this error message no longer makes sense now that KVM _does_ support pointer auth. Without vcpu_has_ptrauth(vcpu), we should just silently mask out the relevant ID fields now (same as for SVE). The patch below should achieve that. --8<-- >From c6065122c5cccef57108dff990ce8fb43426f88e Mon Sep 17 00:00:00

Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-23 Thread Dave Martin
macros defined in the headers are not in sync and should be replaced > from the upstream. > > Signed-off-by: Amit Daniel Kachhap > --- > > Changes since v9: > * Added a error check for both enable-ptrauth and disable-ptrauth > option. > * Make the error explicit when en

Re: [PATCH v10 4/5] KVM: arm64: Add capability to advertise ptrauth for guest

2019-04-23 Thread Dave Martin
s. > > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu > --- > Changes since v9: > * Fixed tab alignment issues [Dave Martin]. > * Clarify the api documentation [D

Re: [PATCH v10 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest

2019-04-23 Thread Dave Martin
o adds a helper to check the flag. > > Reviewed-by: Dave Martin > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu > --- > Changes since v9: > > * Added ptrauth cpufeature static chec

Re: [PATCH v10 2/5] KVM: arm/arm64: context-switch ptrauth registers

2019-04-23 Thread Dave Martin
On Tue, Apr 23, 2019 at 03:54:32PM +0530, Amit Daniel Kachhap wrote: > Hi Mark, > > On 4/23/19 3:09 PM, Marc Zyngier wrote: > >On Tue, 23 Apr 2019 05:42:35 +0100, > >Amit Daniel Kachhap wrote: > >> > >>From: Mark Rutland > >> > >>When pointer authentication is supported, a guest may wish to use

[PATCH v2 12/14] KVM: Clarify capability requirements for KVM_ARM_VCPU_FINALIZE

2019-04-18 Thread Dave Martin
Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- Documentation/virtual/kvm/api.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 03df379..5519df0 100644 --- a/Documentation/virtual/kvm

[PATCH v2 14/14] KVM: arm64: Clarify access behaviour for out-of-range SVE register slice IDs

2019-04-18 Thread Dave Martin
-off-by: Dave Martin Reviewed-by: Andrew Jones --- Documentation/virtual/kvm/api.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 818ac97..e410a9f 100644 --- a/Documentation/virtual/kvm/api.txt

[PATCH v2 13/14] KVM: Clarify KVM_{SET, GET}_ONE_REG error code documentation

2019-04-18 Thread Dave Martin
of the API in this instance. No functional change. Suggested-by: Andrew Jones Fixes: 395f562f2b4c ("KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG") Fixes: 50036ad06b7f ("KVM: arm64/sve: Document KVM API extensions for SVE") Signed-off-by: Dave Martin Revie

[PATCH v2 04/14] KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs

2019-04-18 Thread Dave Martin
the compiler make the right optimisation decisions, this patch adds WARN_ON() for these cases. Given the way the logic is spread out, this seems preferable to dropping the checks altogether. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/kvm/sys_regs.c

[PATCH v2 06/14] KVM: arm64/sve: Miscellaneous tidyups in guest.c

2019-04-18 Thread Dave Martin
. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/kvm/guest.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2e449e1..f5ff7ae 1006

[PATCH v2 10/14] KVM: arm64/sve: Explain validity checks in set_sve_vls()

2019-04-18 Thread Dave Martin
at all to people who do not have detailed knowledge of the SVE system-level architecture. This patch adds a suitable comment to explain what these checks are for. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/kvm/guest.c | 7

[PATCH v2 03/14] KVM: arm: Make vcpu finalization stubs into inline functions

2019-04-18 Thread Dave Martin
functions. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm/include/asm/kvm_host.h | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h

[PATCH v2 08/14] KVM: arm64/sve: WARN when avoiding divide-by-zero in sve_reg_to_region()

2019-04-18 Thread Dave Martin
to trigger, this patch marks the check with WARN_ON(). Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/kvm/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index e45a042..73044e3

[PATCH v2 07/14] KVM: arm64/sve: Make register ioctl access errors more consistent

2019-04-18 Thread Dave Martin
VM: arm64/sve: Add pseudo-register for the guest's vector lengths") Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/kvm/guest.c | 52 ++ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a

[PATCH v2 11/14] KVM: arm/arm64: Clean up vcpu finalization function parameter naming

2019-04-18 Thread Dave Martin
functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/reset.c| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arc

[PATCH v2 05/14] KVM: arm64/sve: Clean up UAPI register ID definitions

2019-04-18 Thread Dave Martin
ister access ioctl interface") Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/include/uapi/asm/kvm.h | 32 +++- arch/arm64/kvm/guest.c| 9 + 2 files changed, 32 insertions(+), 9 deletions(-)

[PATCH v2 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-18 Thread Dave Martin
for these at present is manipulation of KVM_REG_ARM64_SVE_VLS, no corresponding _VL_ macros are defined. They could be added later if a need arises. Since use of DIV_ROUND_UP() was the only reason for including in guest.c, this patch also removes that #include. Suggested-by: Andrew Jones Signed-off-by: Dave

[PATCH v2 02/14] KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE

2019-04-18 Thread Dave Martin
(), retaining the arm stub version under the new name. Suggested-by: Andrew Jones Signed-off-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/reset.c| 2 +- virt/kvm/arm/arm.c| 2

[PATCH v2 01/14] arm64/sve: Clarify vq map semantics

2019-04-18 Thread Dave Martin
-by: Dave Martin Reviewed-by: Andrew Jones --- arch/arm64/include/asm/fpsimd.h | 4 arch/arm64/kernel/fpsimd.c | 7 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index ad6d2e4..df62bbd 100644

[PATCH v2 00/14] KVM: arm64: SVE cleanups

2019-04-18 Thread Dave Martin
with qemu and kvmtool on ThunderX2, and with kvmtool on the Arm Fast model (to exercise SVE support). Some additional manual testing was done to exercise the updated error behaviours when accessing the SVE registers via ioctl. Dave Martin (14): arm64/sve: Clarify vq map semantics KVM: arm/arm

Re: [PATCH v9 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest

2019-04-17 Thread Dave Martin
On Wed, Apr 17, 2019 at 04:54:32PM +0100, Marc Zyngier wrote: > On 17/04/2019 15:52, Dave Martin wrote: > > On Wed, Apr 17, 2019 at 03:19:11PM +0100, Marc Zyngier wrote: > >> On 17/04/2019 14:08, Amit Daniel Kachhap wrote: > >>> Hi, > >>> > >>>

Re: [kvmtool PATCH v9 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-17 Thread Dave Martin
On Wed, Apr 17, 2019 at 06:06:11PM +0530, Amit Daniel Kachhap wrote: > Hi, > > On 4/16/19 10:02 PM, Dave Martin wrote: > >On Fri, Apr 12, 2019 at 08:50:36AM +0530, Amit Daniel Kachhap wrote: > >>This patch adds a runtime capabality for KVM tool to enable Arm64 8.3 &g

Re: [PATCH v9 4/5] KVM: arm64: Add capability to advertise ptrauth for guest

2019-04-17 Thread Dave Martin
On Wed, Apr 17, 2019 at 03:09:02PM +0530, Amit Daniel Kachhap wrote: > Hi, > > On 4/16/19 10:02 PM, Dave Martin wrote: > >On Fri, Apr 12, 2019 at 08:50:35AM +0530, Amit Daniel Kachhap wrote: > >>This patch advertises the capability of two cpu feature called address &g

Re: [PATCH v9 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest

2019-04-17 Thread Dave Martin
gt; > >>> Signed-off-by: Amit Daniel Kachhap > >>> Cc: Mark Rutland > >>> Cc: Marc Zyngier > >>> Cc: Christoffer Dall > >>> Cc: kvmarm@lists.cs.columbia.edu > >>> --- > >>> > >>> Changes since v8: > >&g

Re: [PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-17 Thread Dave Martin
On Wed, Apr 17, 2019 at 06:16:56AM +0200, Andrew Jones wrote: > On Tue, Apr 16, 2019 at 04:52:28PM +0100, Dave Martin wrote: > > On Tue, Apr 16, 2019 at 04:28:31PM +0200, Andrew Jones wrote: > > > On Tue, Apr 16, 2019 at 03:10:55PM +0100, Dave Martin wrote: > > > >

Re: [kvmtool PATCH v9 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-16 Thread Dave Martin
macros defined in the headers are not in sync and should be replaced > from the upstream. > > Signed-off-by: Amit Daniel Kachhap > --- > Changes since v8: > * Added option --enable-ptrauth and --disable-ptrauth to use ptrauth. Also >enable ptrauth if no option provided and Ho

Re: [PATCH v9 4/5] KVM: arm64: Add capability to advertise ptrauth for guest

2019-04-16 Thread Dave Martin
s. > > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu > --- > Changes since v8: > * Keep the capability check same for the 2 vcpu ptrauth features. [Dave > Martin] > > Doc

Re: [PATCH v9 3/5] KVM: arm64: Add userspace flag to enable pointer authentication

2019-04-16 Thread Dave Martin
the changes done. > > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu > --- > > Changes since v8: > * Update vcpu->arch.flags to final enable state. [Dave Martin] > * Change in

Re: [PATCH v9 1/5] KVM: arm64: Add a vcpu flag to control ptrauth for guest

2019-04-16 Thread Dave Martin
o adds a helper to check the flag. > > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu Reviewed-by: Dave Martin > --- > > Changes since v8: > * Added a new per vcpu flag which will s

Re: [PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-16 Thread Dave Martin
On Tue, Apr 16, 2019 at 04:28:31PM +0200, Andrew Jones wrote: > On Tue, Apr 16, 2019 at 03:10:55PM +0100, Dave Martin wrote: [...] > > arch/arm64/include/uapi/asm/kvm.h: > > > > #include /* which we already have anyway */ > > > > #define KVM_ARM64_SV

Re: [PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-16 Thread Dave Martin
On Tue, Apr 16, 2019 at 04:28:31PM +0200, Andrew Jones wrote: > On Tue, Apr 16, 2019 at 03:10:55PM +0100, Dave Martin wrote: > > On Tue, Apr 16, 2019 at 03:00:54PM +0200, Andrew Jones wrote: > > > On Tue, Apr 16, 2019 at 01:41:42PM +0100, Dave Martin wrote: > > > >

Re: [PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-16 Thread Dave Martin
On Tue, Apr 16, 2019 at 03:00:54PM +0200, Andrew Jones wrote: > On Tue, Apr 16, 2019 at 01:41:42PM +0100, Dave Martin wrote: > > On Mon, Apr 15, 2019 at 05:20:37PM +0200, Andrew Jones wrote: > > > On Fri, Apr 12, 2019 at 05:28:13PM +0100, Dave Martin wrote: > > > &

Re: [PATCH 00/14] KVM: arm64: SVE cleanups

2019-04-16 Thread Dave Martin
On Mon, Apr 15, 2019 at 05:22:13PM +0200, Andrew Jones wrote: > On Fri, Apr 12, 2019 at 05:28:04PM +0100, Dave Martin wrote: > > This series contains some cleanups applicable to the SVE KVM support > > patches merged into kvmarm/next. These arose from Andrew Jones' > > review

Re: [PATCH 13/14] KVM: Clarify KVM_{SET,GET}_ONE_REG error code documentation

2019-04-16 Thread Dave Martin
On Mon, Apr 15, 2019 at 05:21:32PM +0200, Andrew Jones wrote: > On Fri, Apr 12, 2019 at 05:28:17PM +0100, Dave Martin wrote: > > The current error code documentation for KVM_GET_ONE_REG and > > KVM_SET_ONE_REG could be read as implying that all architectures > > implem

Re: [PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-16 Thread Dave Martin
On Mon, Apr 15, 2019 at 05:20:37PM +0200, Andrew Jones wrote: > On Fri, Apr 12, 2019 at 05:28:13PM +0100, Dave Martin wrote: > > A complicated DIV_ROUND_UP() expression is currently written out > > explicitly in multiple places in order to specify the size of the >

Re: [PATCH 05/14] KVM: arm64/sve: Clean up UAPI register ID definitions

2019-04-16 Thread Dave Martin
On Mon, Apr 15, 2019 at 05:17:39PM +0200, Andrew Jones wrote: > On Fri, Apr 12, 2019 at 05:28:09PM +0100, Dave Martin wrote: > > Currently, the SVE register ID macros are not all defined in the > > same way, and advertise the fact that FFR maps onto the nonexistent > > p

[PATCH 13/14] KVM: Clarify KVM_{SET, GET}_ONE_REG error code documentation

2019-04-12 Thread Dave Martin
of the API in this instance. No functional change. Suggested-by: Andrew Jones Fixes: 395f562f2b4c ("KVM: Document errors for KVM_GET_ONE_REG and KVM_SET_ONE_REG") Fixes: 50036ad06b7f ("KVM: arm64/sve: Document KVM API extensions for SVE") Signed-off-by: Dave Martin --- D

[PATCH 14/14] KVM: arm64: Clarify access behaviour for out-of-range SVE register slice IDs

2019-04-12 Thread Dave Martin
-off-by: Dave Martin --- Documentation/virtual/kvm/api.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 74c51c7..91cb12a 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual

[PATCH 11/14] KVM: arm/arm64: Clean up vcpu finalization function parameter naming

2019-04-12 Thread Dave Martin
functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/reset.c| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/kvm

[PATCH 12/14] KVM: Clarify capability requirements for KVM_ARM_VCPU_FINALIZE

2019-04-12 Thread Dave Martin
Signed-off-by: Dave Martin --- Documentation/virtual/kvm/api.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 68509de..b115b23 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation

[PATCH 06/14] KVM: arm64/sve: Miscellaneous tidyups in guest.c

2019-04-12 Thread Dave Martin
. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/guest.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2e449e1..f5ff7ae 100644 --- a/arch/arm64/kvm/g

[PATCH 05/14] KVM: arm64/sve: Clean up UAPI register ID definitions

2019-04-12 Thread Dave Martin
pport to register access ioctl interface") Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/include/uapi/asm/kvm.h | 32 +++- arch/arm64/kvm/guest.c| 9 + 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/arch/arm64/in

[PATCH 09/14] KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing

2019-04-12 Thread Dave Martin
that #include. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/guest.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 73044e3..f025a2f 100644 --- a/arch/arm64/kvm/guest.c

[PATCH 10/14] KVM: arm64/sve: Explain validity checks in set_sve_vls()

2019-04-12 Thread Dave Martin
at all to people who do not have detailed knowledge of the SVE system-level architecture. This patch adds a suitable comment to explain what these checks are for. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/guest.c | 7 +++ 1 file changed, 7

[PATCH 08/14] KVM: arm64/sve: WARN when avoiding divide-by-zero in sve_reg_to_region()

2019-04-12 Thread Dave Martin
to trigger, this patch marks the check with WARN_ON(). Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index e45a042..73044e3 100644 --- a/arch/arm64/kvm

[PATCH 07/14] KVM: arm64/sve: Make register ioctl access errors more consistent

2019-04-12 Thread Dave Martin
VM: arm64/sve: Add pseudo-register for the guest's vector lengths") Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/guest.c | 52 ++ 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/arch/arm64/kvm/guest.c b

[PATCH 01/14] arm64/sve: Clarify vq map semantics

2019-04-12 Thread Dave Martin
-by: Dave Martin --- arch/arm64/include/asm/fpsimd.h | 4 arch/arm64/kernel/fpsimd.c | 7 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index ad6d2e4..df62bbd 100644 --- a/arch/arm64/include/asm

[PATCH 03/14] KVM: arm: Make vcpu finalization stubs into inline functions

2019-04-12 Thread Dave Martin
functions. No functional change. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm/include/asm/kvm_host.h | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index d956273..7feddac 100644

[PATCH 04/14] KVM: arm64/sve: sys_regs: Demote redundant vcpu_has_sve() checks to WARNs

2019-04-12 Thread Dave Martin
the compiler make the right optimisation decisions, this patch adds WARN_ON() for these cases. Given the way the logic is spread out, this seems preferable to dropping the checks altogether. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm64/kvm/sys_regs.c | 4 ++-- 1 file changed, 2

[PATCH 02/14] KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE

2019-04-12 Thread Dave Martin
(), retaining the arm stub version under the new name. Suggested-by: Andrew Jones Signed-off-by: Dave Martin --- arch/arm/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/reset.c| 2 +- virt/kvm/arm/arm.c| 2 +- 4 files changed, 4

[PATCH 00/14] KVM: arm64: SVE cleanups

2019-04-12 Thread Dave Martin
nux-dm.git sve-kvm-fixes/v1/head http://linux-arm.org/git?p=linux-dm.git;a=shortlog;h=refs/heads/sve-kvm-fixes/v1/head Dave Martin (14): arm64/sve: Clarify vq map semantics KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE KVM: arm: Make vcpu finalization stubs i

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-10 Thread Dave Martin
On Fri, Apr 05, 2019 at 05:33:21PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 01:54:13PM +0100, Dave Martin wrote: [...] > > If you think the above is enough for ABI documentation purposes, I will > > aim to drop the following comment i

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-10 Thread Dave Martin
On Fri, Apr 05, 2019 at 05:41:31PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 03:06:40PM +0100, Dave Martin wrote: [...] > > Clearing KVM_ARM64_GUEST_HAS_SVE could be done on finalization failure; > > it just feels a bit weird. > > Let's leave it. It's safe no

Re: [PATCH v7 27/27] KVM: arm64/sve: Document KVM API extensions for SVE

2019-04-10 Thread Dave Martin
On Fri, Apr 05, 2019 at 05:38:04PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 02:00:07PM +0100, Dave Martin wrote: > > On Fri, Apr 05, 2019 at 12:39:37PM +0200, Andrew Jones wrote: > > > On Fri, Apr 05, 2019 at 10:36:17AM +0100, Dave Martin wrote: > > > >

Re: [PATCH v7 00/27] KVM: arm64: SVE guest support

2019-04-05 Thread Dave Martin
On Fri, Mar 29, 2019 at 01:00:25PM +, Dave Martin wrote: > This series implements support for allowing KVM guests to use the Arm > Scalable Vector Extension (SVE), superseding the previous v6 series [1]. [...] FYI, I'm working on a series of minor fixups based on Andrew's comments w

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 12:22:04PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:36:10AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 10:31:09PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:48PM +, Dave Martin wrote: > > > >

Re: [PATCH v7 27/27] KVM: arm64/sve: Document KVM API extensions for SVE

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 12:39:37PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:36:17AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 11:09:21PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:52PM +, Dave Martin wrote: > > >

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 12:14:51PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:36:03AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 10:18:54PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:48PM +, Dave Martin wrote: > > > >

Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 12:40:57PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:36:24AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 06:33:08PM +0200, Andrew Jones wrote: > > > On Thu, Apr 04, 2019 at 03:53:55PM +0100, Dave Martin wrote: > > > >

Re: [PATCH v7 20/27] arm64/sve: In-kernel vector length availability query interface

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 11:54:07AM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:35:55AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 04:20:34PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:45PM +, Dave Martin wrote: > > > >

Re: [PATCH v7 19/27] KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 11:45:56AM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:35:45AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 04:08:32PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:44PM +, Dave Martin wrote: > > > &g

Re: [kvmtool PATCH v8 9/9] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-05 Thread Dave Martin
On Tue, Apr 02, 2019 at 07:57:17AM +0530, Amit Daniel Kachhap wrote: > This is a runtime capabality for KVM tool to enable Arm64 8.3 Pointer > Authentication in guest kernel. Two vcpu features > KVM_ARM_VCPU_PTRAUTH_[ADDRESS/GENERIC] are supplied together to enable > Pointer Authentication in KVM

Re: [PATCH v8 8/9] KVM: arm64: Add capability to advertise ptrauth for guest

2019-04-05 Thread Dave Martin
On Tue, Apr 02, 2019 at 07:57:16AM +0530, Amit Daniel Kachhap wrote: > This patch advertises the capability of two cpu feature called address > pointer authentication and generic pointer authentication. These > capabilities depend upon system support for pointer authentication and > VHE mode. > >

Re: [PATCH v8 5/9] KVM: arm/arm64: preserve host MDCR_EL2 value

2019-04-05 Thread Dave Martin
if (!has_vhe()) > return; > > - deactivate_traps_vhe_put(); > + deactivate_traps_vhe_put(vcpu); > > __sysreg_save_el1_state(guest_ctxt); > __sysreg_save_user_state(guest_ctxt); > @@ -333,4 +333,10 @@ void __hyp_text __kvm_populate_host_

Re: [PATCH v8 3/9] KVM: arm64: Move hyp_symbol_addr to fix dependency

2019-04-05 Thread Dave Martin
ddr;\ > + asm("adrp %0, %1\n" \ > + "add%0, %0, :lo12:%1\n" \ > + : "=r" (addr) : "S" ());

Re: [PATCH v8 4/9] KVM: arm/arm64: preserve host HCR_EL2 value

2019-04-05 Thread Dave Martin
On Tue, Apr 02, 2019 at 07:57:12AM +0530, Amit Daniel Kachhap wrote: > From: Mark Rutland > > When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which > is a constant value. This works today, as the host HCR_EL2 value is > always the same, but this will get in the way of

Re: [PATCH v8 6/9] KVM: arm64: Add vcpu feature flags to control ptrauth accessibility

2019-04-05 Thread Dave Martin
On Tue, Apr 02, 2019 at 07:57:14AM +0530, Amit Daniel Kachhap wrote: > Since Pointer authentication will be enabled or disabled on a > per-vcpu basis, vcpu feature flags are added in order to know which > vcpus have it enabled from userspace. > > This features will allow the KVM guest to allow

Re: [PATCH v7 27/27] KVM: arm64/sve: Document KVM API extensions for SVE

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 11:09:21PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:52PM +0000, Dave Martin wrote: > > This patch adds sections to the KVM API documentation describing > > the extensions for supporting the Scalable Vector Extension (SVE) > > in guests

Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 06:33:08PM +0200, Andrew Jones wrote: > On Thu, Apr 04, 2019 at 03:53:55PM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 04:25:28PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:46PM +, Dave Martin wrote: [...] > > &

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 10:31:09PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:48PM +0000, Dave Martin wrote: > > This patch adds a new pseudo-register KVM_REG_ARM64_SVE_VLS to > > allow userspace to set and query the set of vector lengths visible &

Re: [PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 10:18:54PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:48PM +0000, Dave Martin wrote: > > This patch adds a new pseudo-register KVM_REG_ARM64_SVE_VLS to > > allow userspace to set and query the set of vector lengths visible &

Re: [PATCH v7 19/27] KVM: arm64: Enumerate SVE register indices for KVM_GET_REG_LIST

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 04:08:32PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:44PM +0000, Dave Martin wrote: > > This patch includes the SVE register IDs in the list returned by > > KVM_GET_REG_LIST, as appropriate. > > > > On a non-SVE-enabled

Re: [PATCH v7 20/27] arm64/sve: In-kernel vector length availability query interface

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 04:20:34PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:45PM +0000, Dave Martin wrote: > > KVM will need to interrogate the set of SVE vector lengths > > available on the system. > > > > This patch exposes the relevan

Re: [PATCH v7 07/27] arm64/sve: Check SVE virtualisability

2019-04-05 Thread Dave Martin
On Thu, Apr 04, 2019 at 11:21:04PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:32PM +0000, Dave Martin wrote: > > Due to the way the effective SVE vector length is controlled and > > trapped at different exception levels, certain mismatches in the > > s

Re: [PATCH v7 18/27] KVM: arm64/sve: Add SVE support to register access ioctl interface

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 06:25:39PM +0200, Andrew Jones wrote: > On Thu, Apr 04, 2019 at 03:50:56PM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 03:57:06PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:43PM +, Dave Martin wrote: > > > >

Re: [PATCH v7 22/27] KVM: arm/arm64: Add KVM_ARM_VCPU_FINALIZE ioctl

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 05:07:09PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:47PM +0000, Dave Martin wrote: > > Some aspects of vcpu configuration may be too complex to be > > completed inside KVM_ARM_VCPU_INIT. Thus, there may be a > > requirement for

Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 04:25:28PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:46PM +0000, Dave Martin wrote: > > This patch adds a kvm_arm_init_arch_resources() hook to perform > > subarch-specific initialisation when starting up KVM. > > > > This w

Re: [PATCH v7 18/27] KVM: arm64/sve: Add SVE support to register access ioctl interface

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 03:57:06PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:43PM +0000, Dave Martin wrote: > > This patch adds the following registers for access via the > > KVM_{GET,SET}_ONE_REG interface: > > > > * KVM_REG_ARM64_SVE_ZREG(n, i) (n =

Re: [PATCH v7 12/27] KVM: arm64/sve: System register context switch and access support

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 10:32:18AM +0200, Andrew Jones wrote: > On Thu, Apr 04, 2019 at 09:06:58AM +0100, Dave Martin wrote: > > On Wed, Apr 03, 2019 at 09:39:43PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:37PM +, Dave Martin wrote: [...] &

Re: [PATCH v7 13/27] KVM: arm64/sve: Context switch the SVE registers

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 10:35:02AM +0200, Andrew Jones wrote: > On Thu, Apr 04, 2019 at 09:10:08AM +0100, Dave Martin wrote: > > On Wed, Apr 03, 2019 at 10:01:45PM +0200, Andrew Jones wrote: > > > On Fri, Mar 29, 2019 at 01:00:38PM +, Dave Martin wrote: > > > >

Re: [PATCH v7 13/27] KVM: arm64/sve: Context switch the SVE registers

2019-04-04 Thread Dave Martin
On Wed, Apr 03, 2019 at 10:01:45PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:38PM +0000, Dave Martin wrote: > > In order to give each vcpu its own view of the SVE registers, this > > patch adds context storage via a new sve_state pointer in struct > > vcpu

Re: [PATCH v7 12/27] KVM: arm64/sve: System register context switch and access support

2019-04-04 Thread Dave Martin
On Wed, Apr 03, 2019 at 09:39:43PM +0200, Andrew Jones wrote: > On Fri, Mar 29, 2019 at 01:00:37PM +0000, Dave Martin wrote: > > This patch adds the necessary support for context switching ZCR_EL1 > > for each vcpu. > > > > ZCR_EL1 is trapped alongside the FPSIMD

Re: [PATCH v7 09/27] KVM: arm64: Add a vcpu flag to control SVE visibility for the guest

2019-04-04 Thread Dave Martin
On Thu, Apr 04, 2019 at 04:17:24AM +0100, Marc Zyngier wrote: > On Wed, 03 Apr 2019 20:14:13 +0100, > Andrew Jones wrote: > > > > On Fri, Mar 29, 2019 at 01:00:34PM +, Dave Martin wrote: > > > Since SVE will be enabled or disabled on a per-vcpu basis, a flag > &

[PATCH] KVM: arm64: Filter out invalid core register IDs in KVM_GET_REG_LIST

2019-04-03 Thread Dave Martin
. Cc: sta...@vger.kernel.org Fixes: d26c25a9d19b ("arm64: KVM: Tighten guest core register access from userspace") Signed-off-by: Dave Martin --- Tested by hacking kvmtool to dump the register list and eyballing the results, both with and without this patch, and with and without SVE. Qemu test

Re: [PATCH v7 16/27] KVM: arm64: Factor out core register ID enumeration

2019-04-02 Thread Dave Martin
On Tue, Apr 02, 2019 at 03:41:56AM +0100, Marc Zyngier wrote: > On Fri, 29 Mar 2019 13:00:41 +, > Dave Martin wrote: > > > > In preparation for adding logic to filter out some KVM_REG_ARM_CORE > > registers from the KVM_GET_REG_LIST output, this patch factors o

Re: [PATCH v7 00/27] KVM: arm64: SVE guest support

2019-03-29 Thread Dave Martin
On Fri, Mar 29, 2019 at 02:56:36PM +, Marc Zyngier wrote: > Hi Dave, > > On 29/03/2019 13:00, Dave Martin wrote: > > This series implements support for allowing KVM guests to use the Arm > > Scalable Vector Extension (SVE), superseding the previous v6 series [1]. > >

[PATCH v7 27/27] KVM: arm64/sve: Document KVM API extensions for SVE

2019-03-29 Thread Dave Martin
This patch adds sections to the KVM API documentation describing the extensions for supporting the Scalable Vector Extension (SVE) in guests. Signed-off-by: Dave Martin --- Changes since v5: * Document KVM_ARM_VCPU_FINALIZE and its interactions with SVE. --- Documentation/virtual/kvm

[PATCH v7 15/27] KVM: arm64: Add missing #include of in guest.c

2019-03-29 Thread Dave Martin
arch/arm64/kvm/guest.c uses the string functions, but the corresponding header is not included. We seem to get away with this for now, but for completeness this patch adds the #include, in preparation for adding yet more memset() calls. Signed-off-by: Dave Martin Tested-by: zhang.lei --- arch

[PATCH v7 11/27] KVM: arm64: Support runtime sysreg visibility filtering

2019-03-29 Thread Dave Martin
hiding register where appropriate. Signed-off-by: Dave Martin Tested-by: zhang.lei --- Changes since v5: * Rename the visibility override flags, add some comments, and rename/ introduce helpers to make the purpose of this code clearer. --- arch/arm64/kvm/sys_regs.c | 24

[PATCH v7 18/27] KVM: arm64/sve: Add SVE support to register access ioctl interface

2019-03-29 Thread Dave Martin
state. This avoids some complex and pointless emulation in the kernel to convert between the two views of these aliased registers. Signed-off-by: Dave Martin Reviewed-by: Julien Thierry Tested-by: zhang.lei --- Changes since v5: * [Julien Thierry] rename sve_reg_region() to sve_reg_to_region

[PATCH v7 05/27] KVM: arm64: Add missing #includes to kvm_host.h

2019-03-29 Thread Dave Martin
kvm_host.h uses some declarations from other headers that are currently included by accident, without an explicit #include. This patch adds a few #includes that are clearly missing. Although the header builds without them today, this should help to avoid future surprises. Signed-off-by: Dave

[PATCH v7 25/27] KVM: arm64: Add a capability to advertise SVE support

2019-03-29 Thread Dave Martin
To provide a uniform way to check for KVM SVE support amongst other features, this patch adds a suitable capability KVM_CAP_ARM_SVE, and reports it as present when SVE is available. Signed-off-by: Dave Martin Reviewed-by: Julien Thierry Tested-by: zhang.lei --- Changes since v5: * [Julien

[PATCH v7 23/27] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-03-29 Thread Dave Martin
nit to work this out, in the kvm_arm_init_arch_resources() hook. The KVM_REG_ARM64_SVE_VLS pseudo-register is not exposed yet. Subsequent patches will allow SVE to be turned on for guest vcpus, making it visible. Signed-off-by: Dave Martin Reviewed-by: Julien Thierry Tested-by: zhang.

[PATCH v7 20/27] arm64/sve: In-kernel vector length availability query interface

2019-03-29 Thread Dave Martin
outside these functions: now that these are exposed outside fpsimd.c, they are prefixed with __ in order to provide an extra hint that they are not intended for general-purpose use. Signed-off-by: Dave Martin Reviewed-by: Alex Bennée Tested-by: zhang.lei --- arch/arm64/include/asm/fpsimd.h | 29

[PATCH v7 02/27] arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush

2019-03-29 Thread Dave Martin
e() anyway. Signed-off-by: Dave Martin Reviewed-by: Alex Bennée Reviewed-by: Julien Grall Tested-by: zhang.lei --- arch/arm64/kernel/fpsimd.c | 25 +++-- arch/arm64/kernel/signal.c | 5 - 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/arch/arm64/kernel/fpsim

<    1   2   3   4   5   6   7   8   9   10   >