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 which I

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

2019-04-05 Thread Andrew Jones
On Fri, Apr 05, 2019 at 03:06:40PM +0100, Dave Martin wrote: > 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

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

2019-04-05 Thread Andrew Jones
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: > > > On Thu, Apr 04, 2019 at 11:09:21PM +0200, Andrew Jones wrote: > > > > On Fri, Mar 29, 2019 at

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

2019-04-05 Thread Andrew Jones
On Fri, Apr 05, 2019 at 01:54:13PM +0100, Dave Martin wrote: > 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

Re: [PATCH kvmtool 08/16] arm/pci: Do not use first PCI IO space bytes for devices

2019-04-05 Thread Andre Przywara
On Thu, 7 Mar 2019 08:36:09 + Julien Thierry wrote: Hi, > Linux has this convention that the lower 0x1000 bytes of the IO space > should not be used. (cf PCIBIOS_MIN_IO). > > Just allocate those bytes to prevent future allocation assigning it to > devices. > > Signed-off-by: Julien

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: > > > > This patch adds a new

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: > > > > This patch adds sections to the

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: > > > > This patch adds a new

Re: [PATCH v12 8/8] arm64: docs: document perf event attributes

2019-04-05 Thread Will Deacon
On Thu, Apr 04, 2019 at 08:33:51PM +0100, Andrew Murray wrote: > On Thu, Apr 04, 2019 at 05:21:28PM +0100, Will Deacon wrote: > > On Thu, Mar 28, 2019 at 10:37:31AM +, Andrew Murray wrote: > > > +exclude_kernel > > > +-- > > > + > > > +This attribute excludes the kernel. > > > + >

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: > > > > On Thu, Apr 04, 2019 at

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: > > > > KVM will need to interrogate the

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: > > > > This patch includes the SVE

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
On Tue, Apr 02, 2019 at 07:57:13AM +0530, Amit Daniel Kachhap wrote: > Save host MDCR_EL2 value during kvm HYP initialisation and restore > after every switch from host to guest. There should not be any > change in functionality due to this. > > The value of mdcr_el2 is now stored in struct

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

2019-04-05 Thread Dave Martin
On Tue, Apr 02, 2019 at 07:57:11AM +0530, Amit Daniel Kachhap wrote: > Currently hyp_symbol_addr is placed in kvm_mmu.h which is mostly > used by __hyp_this_cpu_ptr in kvm_asm.h but it cannot include > kvm_mmu.h directly as kvm_mmu.h uses kvm_ksym_ref which is > defined inside kvm_asm.h. Hence,

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 v8 7/9] KVM: arm/arm64: context-switch ptrauth registers

2019-04-05 Thread Amit Daniel Kachhap
Hi Kristina, On 4/5/19 12:59 AM, Kristina Martsenko wrote: On 02/04/2019 03:27, Amit Daniel Kachhap wrote: From: Mark Rutland When pointer authentication is supported, a guest may wish to use it. This patch adds the necessary KVM infrastructure for this to work, with a semi-lazy context

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

2019-04-05 Thread Andrew Jones
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: > > > On Thu, Apr 04, 2019 at 04:25:28PM +0200, Andrew Jones wrote: > > > > On Fri, Mar 29, 2019 at

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

2019-04-05 Thread Andrew Jones
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: > > > This patch adds sections to the KVM API documentation describing > > > the extensions for supporting

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

2019-04-05 Thread Andrew Jones
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: > > > This patch adds a new pseudo-register KVM_REG_ARM64_SVE_VLS to > > > allow userspace to set and query

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

2019-04-05 Thread Andrew Jones
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: > > > This patch adds a new pseudo-register KVM_REG_ARM64_SVE_VLS to > > > allow userspace to set and query

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

2019-04-05 Thread Andrew Jones
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: > > > KVM will need to interrogate the set of SVE vector lengths > > > available on the system. > > > > > >

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 +, 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: [...] > > > > diff --git

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 +, 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 > > to the guest. > > > > In the

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 +, 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 > > to the guest. > > > > In the

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 +, 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 vcpu, no new IDs are added. > > > >

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 +, Dave Martin wrote: > > KVM will need to interrogate the set of SVE vector lengths > > available on the system. > > > > This patch exposes the relevant bits to the kernel, along with a > >

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 +, Dave Martin wrote: > > Due to the way the effective SVE vector length is controlled and > > trapped at different exception levels, certain mismatches in the > > sets of vector lengths

Re: [PATCH] KVM: arm/arm64: ensure vcpu target is unset on reset failure

2019-04-05 Thread Andrew Jones
On Fri, Apr 05, 2019 at 07:38:59AM +0100, Marc Zyngier wrote: > On Thu, 04 Apr 2019 18:42:30 +0100, > Andrew Jones wrote: > > > > A failed KVM_ARM_VCPU_INIT, should not set the vcpu target, > > as the vcpu target is used by kvm_vcpu_initialized() to > > determine if other vcpu ioctls may

Re: [PATCH] KVM: arm/arm64: ensure vcpu target is unset on reset failure

2019-04-05 Thread Marc Zyngier
On Thu, 04 Apr 2019 18:42:30 +0100, Andrew Jones wrote: > > A failed KVM_ARM_VCPU_INIT, should not set the vcpu target, > as the vcpu target is used by kvm_vcpu_initialized() to > determine if other vcpu ioctls may proceed. We need to set > the target before calling kvm_reset_vcpu(), but if that