Re: [PATCH v6 5/6] arm64/kvm: control accessibility of ptrauth key registers

2019-02-26 Thread James Morse
Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: > According to userspace settings, ptrauth key registers are conditionally > present in guest system register list based on user specified flag > KVM_ARM_VCPU_PTRAUTH. > > Reset routines still sets these registers to default values but they

Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-26 Thread James Morse
Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: > This feature will allow the KVM guest to allow the handling of > pointer authentication instructions or to treat them as undefined > if not set. It uses the existing vcpu API KVM_ARM_VCPU_INIT to > supply this parameter instead of creating

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-26 Thread James Morse
Hi Amit, On 19/02/2019 09:24, 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 switch of the pointer auth state. > > Pointer a

Re: [PATCH v6 0/6] Add ARMv8.3 pointer authentication for kvm guest

2019-02-26 Thread James Morse
Hi Amit, On 19/02/2019 09:24, Amit Daniel Kachhap wrote: > This patch series adds pointer authentication support for KVM guest and > is based on top of Linux 5.0-rc6. The basic patches in this series was > originally posted by Mark Rutland earlier[1,2] and contains some history > of this work. >

Re: [PATCH v5 13/26] KVM: arm64/sve: System register context switch and access support

2019-02-26 Thread Dave Martin
On Tue, Feb 26, 2019 at 04:32:30PM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >@@ -1091,6 +1088,95 @@ static int reg_from_user(u64 *val, const void __user > >*uaddr, u64 id); > > static int reg_to_user(void __user *uaddr, const u64 *val, u64 id); > > sta

Re: [PATCH v5 14/26] KVM: arm64/sve: Context switch the SVE registers

2019-02-26 Thread Julien Grall
Hi Dave, On 26/02/2019 12:13, Dave Martin wrote: On Wed, Feb 20, 2019 at 04:46:57PM +, Julien Thierry wrote: On 18/02/2019 19:52, 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_ar

Re: [PATCH v5 13/26] KVM: arm64/sve: System register context switch and access support

2019-02-26 Thread Julien Grall
Hi Dave, On 18/02/2019 19:52, Dave Martin wrote: @@ -1091,6 +1088,95 @@ static int reg_from_user(u64 *val, const void __user *uaddr, u64 id); static int reg_to_user(void __user *uaddr, const u64 *val, u64 id); static u64 sys_reg_to_index(const struct sys_reg_desc *reg); +static unsigned

Re: [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts

2019-02-26 Thread Dave Martin
On Tue, Feb 26, 2019 at 03:59:40PM +, Julien Grall wrote: > Hi Dave, > > On 26/02/2019 15:58, Dave Martin wrote: > >On Tue, Feb 26, 2019 at 03:49:00PM +, Julien Grall wrote: > >>Hi Dave, > >> > >>On 26/02/2019 12:07, Dave Martin wrote: [...] > >>>Does the code look reasonable to you? Th

Re: [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts

2019-02-26 Thread Julien Grall
Hi Dave, On 26/02/2019 15:58, Dave Martin wrote: On Tue, Feb 26, 2019 at 03:49:00PM +, Julien Grall wrote: Hi Dave, On 26/02/2019 12:07, Dave Martin wrote: On Fri, Feb 22, 2019 at 03:26:51PM +, Julien Grall wrote: Hi Dave, On 18/02/2019 19:52, Dave Martin wrote: The current FPSIMD/

Re: [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts

2019-02-26 Thread Dave Martin
On Tue, Feb 26, 2019 at 03:49:00PM +, Julien Grall wrote: > Hi Dave, > > On 26/02/2019 12:07, Dave Martin wrote: > >On Fri, Feb 22, 2019 at 03:26:51PM +, Julien Grall wrote: > >>Hi Dave, > >> > >>On 18/02/2019 19:52, Dave Martin wrote: > >>>The current FPSIMD/SVE context handling support f

Re: [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts

2019-02-26 Thread Julien Grall
Hi Dave, On 26/02/2019 12:07, Dave Martin wrote: On Fri, Feb 22, 2019 at 03:26:51PM +, Julien Grall wrote: Hi Dave, On 18/02/2019 19:52, Dave Martin wrote: The current FPSIMD/SVE context handling support for non-task (i.e., KVM vcpu) contexts does not take SVE into account. This means th

Re: [PATCH v5 06/26] arm64/sve: Check SVE virtualisability

2019-02-26 Thread Julien Grall
Hi Dave, On 26/02/2019 12:06, Dave Martin wrote: On Thu, Feb 21, 2019 at 01:36:26PM +, Julien Grall wrote: Hi Dave, On 18/02/2019 19:52, Dave Martin wrote: + /* +* Mismatches above sve_max_virtualisable_vl are fine, since +* no guest is allowed to configure ZCR_EL2.L

Re: [PATCH 1/5] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

2019-02-26 Thread Dave Martin
On Tue, Feb 26, 2019 at 01:34:49PM +0100, Christoffer Dall wrote: > On Wed, Feb 20, 2019 at 07:14:53PM +, Dave Martin wrote: > > On Fri, Jan 25, 2019 at 10:46:52AM +0100, Christoffer Dall wrote: > > > Resetting the VCPU state modifies the system register state in memory, > > > but this may inte

Re: [PATCH 1/5] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 07:41:43PM +, Marc Zyngier wrote: > On Wed, 20 Feb 2019 19:14:53 + > Dave Martin wrote: > > > On Fri, Jan 25, 2019 at 10:46:52AM +0100, Christoffer Dall wrote: > > > Resetting the VCPU state modifies the system register state in memory, > > > but this may interact

Re: [PATCH V3 1/10] X86/Hyper-V: Add parameter offset for hyperv_fill_flush_guest_mapping_list()

2019-02-26 Thread Tianyu Lan
Hi Stephen: Thanks for your review. On Sat, Feb 23, 2019 at 1:08 AM Stephen Hemminger wrote: > > int hyperv_fill_flush_guest_mapping_list( > struct hv_guest_mapping_flush_list *flush, > - u64 start_gfn, u64 pages) > + int offset, u64 start

Re: [PATCH v10 4/5] arm64: arm_pmu: Add support for exclude_host/exclude_guest attributes

2019-02-26 Thread Christoffer Dall
On Wed, Feb 20, 2019 at 04:15:40PM +, Andrew Murray wrote: > On Mon, Feb 18, 2019 at 10:53:07PM +0100, Christoffer Dall wrote: > > On Mon, Jan 14, 2019 at 04:11:47PM +, Andrew Murray wrote: > > > Add support for the :G and :H attributes in perf by handling the > > > exclude_host/exclude_gue

Re: [PATCH v5 05/26] KVM: arm64: Add missing #include of to kvm_host.h

2019-02-26 Thread Mark Rutland
On Tue, Feb 26, 2019 at 12:33:22PM +, Dave Martin wrote: > On Tue, Feb 26, 2019 at 12:31:45PM +, Mark Rutland wrote: > > On Tue, Feb 26, 2019 at 12:06:16PM +, Dave Martin wrote: > > > On Wed, Feb 20, 2019 at 03:23:50PM +, Mark Rutland wrote: > > [...] > > > > > #include > > > >

Re: [PATCH v5 02/26] arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush

2019-02-26 Thread Julien Grall
On 26/02/2019 12:06, Dave Martin wrote: On Thu, Feb 21, 2019 at 12:39:39PM +, Julien Grall wrote: Hi Dave, On 18/02/2019 19:52, Dave Martin wrote: This patch updates fpsimd_flush_task_state() to mirror the new semantics of fpsimd_flush_cpu_state() introduced by commit d8ad71fa38a9 ("arm

Re: [PATCH 1/5] KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded

2019-02-26 Thread Christoffer Dall
On Wed, Feb 20, 2019 at 07:14:53PM +, Dave Martin wrote: > On Fri, Jan 25, 2019 at 10:46:52AM +0100, Christoffer Dall wrote: > > Resetting the VCPU state modifies the system register state in memory, > > but this may interact with vcpu_load/vcpu_put if running with preemption > > disabled, whic

Re: [PATCH v5 05/26] KVM: arm64: Add missing #include of to kvm_host.h

2019-02-26 Thread Dave Martin
On Tue, Feb 26, 2019 at 12:31:45PM +, Mark Rutland wrote: > On Tue, Feb 26, 2019 at 12:06:16PM +, Dave Martin wrote: > > On Wed, Feb 20, 2019 at 03:23:50PM +, Mark Rutland wrote: [...] > > > #include > > > > [...] > > > > > #include > > > #include > > > > Done for those three. >

Re: [PATCH v5 05/26] KVM: arm64: Add missing #include of to kvm_host.h

2019-02-26 Thread Mark Rutland
On Tue, Feb 26, 2019 at 12:06:16PM +, Dave Martin wrote: > On Wed, Feb 20, 2019 at 03:23:50PM +, Mark Rutland wrote: > > On Mon, Feb 18, 2019 at 07:52:18PM +, Dave Martin wrote: > > > kvm_host.h uses DECLARE_BITMAP() to declare the features member of > > > struct vcpu_arch, but the corr

Re: [PATCH v5 24/26] KVM: arm64: Add a capabillity to advertise SVE support

2019-02-26 Thread Dave Martin
On Fri, Feb 22, 2019 at 09:10:46AM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > > 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

Re: [PATCH v5 23/26] KVM: arm64/sve: Allow userspace to enable SVE for vcpus

2019-02-26 Thread Dave Martin
On Fri, Feb 22, 2019 at 09:05:16AM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > > Now that all the pieces are in place, this patch offers a new flag > > KVM_ARM_VCPU_SVE that userspace can pass to KVM_ARM_VCPU_INIT to > > turn on SVE for the guest, on a per

Re: [PATCH v5 22/26] KVM: arm64/sve: Add pseudo-register for the guest's vector lengths

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 05:48:59PM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, 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, along with correspondin

Re: [PATCH v5 17/26] KVM: arm64: Reject ioctl access to FPSIMD V-regs on SVE vcpus

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 12:06:23PM +, Julien Thierry wrote: > > > On 18/02/2019 19:52, Dave Martin wrote: > > In order to avoid the pointless complexity of maintaining two ioctl > > register access views of the same data, this patch blocks ioctl > > access to the FPSIMD V-registers on vcpus t

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

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 03:23:37PM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, 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 = 0..31) (in 2048-bit slices) > >

Re: [PATCH v5 14/26] KVM: arm64/sve: Context switch the SVE registers

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 04:46:57PM +, Julien Thierry wrote: > > > On 18/02/2019 19:52, 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_arch. An additional member sve_max_vl

Re: [PATCH v5 12/26] KVM: arm64: Support runtime sysreg visibility filtering

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 03:37:26PM +, Mark Rutland wrote: > On Mon, Feb 18, 2019 at 07:52:25PM +, Dave Martin wrote: > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optional for

Re: [PATCH v5 14/26] KVM: arm64/sve: Context switch the SVE registers

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 04:19:18PM +, Mark Rutland wrote: > On Mon, Feb 18, 2019 at 07:52:27PM +, Dave Martin wrote: > > -static bool __hyp_text __hyp_switch_fpsimd(struct kvm_vcpu *vcpu) > > +/* Check for an FPSIMD/SVE trap and handle as appropriate */ > > +static bool __hyp_text __hyp_han

Re: [PATCH v5 12/26] KVM: arm64: Support runtime sysreg visibility filtering

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 02:33:44PM +, Julien Thierry wrote: > > > On 18/02/2019 19:52, Dave Martin wrote: > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optional for the guest, th

Re: [PATCH v5 11/26] KVM: arm64: Extend reset_unknown() to handle mixed RES0/UNKNOWN registers

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 01:33:28PM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > > The reset_unknown() system register helper initialises a guest > > register to a distinctive junk value on vcpu reset, to help expose > > and debug deficient register initiali

Re: [PATCH v5 06/26] arm64/sve: Check SVE virtualisability

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 01:36:26PM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >+/* > >+ * Mismatches above sve_max_virtualisable_vl are fine, since > >+ * no guest is allowed to configure ZCR_EL2.LEN to exceed this: > >+ */ > >+if (sve_v

Re: [PATCH v5 07/26] arm64/sve: Clarify role of the VQ map maintenance functions

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 11:43:24AM +, Julien Thierry wrote: > > > On 18/02/2019 19:52, Dave Martin wrote: > > The roles of sve_init_vq_map(), sve_update_vq_map() and > > sve_verify_vq_map() are highly non-obvious to anyone who has not dug > > through cpufeatures.c in detail. > > > > Since th

Re: [PATCH v5 08/26] arm64/sve: Enable SVE state tracking for non-task contexts

2019-02-26 Thread Dave Martin
On Fri, Feb 22, 2019 at 03:26:51PM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >The current FPSIMD/SVE context handling support for non-task (i.e., > >KVM vcpu) contexts does not take SVE into account. This means that > > NIT: Double-space before "This".

Re: [PATCH v5 07/26] arm64/sve: Clarify role of the VQ map maintenance functions

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 01:46:46PM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >The roles of sve_init_vq_map(), sve_update_vq_map() and > >sve_verify_vq_map() are highly non-obvious to anyone who has not dug > >through cpufeatures.c in detail. > > > >Since t

Re: [PATCH v5 06/26] arm64/sve: Check SVE virtualisability

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 11:12:49AM +, Julien Thierry wrote: > Hi Dave, > > On 18/02/2019 19:52, 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 supported by d

Re: [PATCH v5 05/26] KVM: arm64: Add missing #include of to kvm_host.h

2019-02-26 Thread Dave Martin
On Wed, Feb 20, 2019 at 03:23:50PM +, Mark Rutland wrote: > On Mon, Feb 18, 2019 at 07:52:18PM +, Dave Martin wrote: > > kvm_host.h uses DECLARE_BITMAP() to declare the features member of > > struct vcpu_arch, but the corresponding #include for this is > > missing. > > > > This patch adds

Re: [PATCH v5 02/26] arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 12:39:39PM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >This patch updates fpsimd_flush_task_state() to mirror the new > >semantics of fpsimd_flush_cpu_state() introduced by commit > >d8ad71fa38a9 ("arm64: fpsimd: Fix TIF_FOREIGN_FPST

Re: [PATCH v5 01/26] KVM: Documentation: Document arm64 core registers in detail

2019-02-26 Thread Dave Martin
On Thu, Feb 21, 2019 at 11:48:30AM +, Julien Grall wrote: > Hi Dave, > > On 18/02/2019 19:52, Dave Martin wrote: > >Since the the sizes of individual members of the core arm64 > >registers vary, the list of register encodings that make sense is > >not a simple linear sequence. > > > >To clarif

Re: [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-02-26 Thread James Morse
Hi Amit, On 25/02/2019 17:39, James Morse wrote: > On 19/02/2019 09:24, 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 w

Re: [kvm-unit-tests PATCH v3 1/5] lib: arm: Use UART address from generated config.h

2019-02-26 Thread Vladimir Murzin
... snip >>> >>> What is my next step? >>> >> Wait for Paolo or Radim to merge :-) I've added them to CC. > > Hi, > > Any updates? > Pabl/Radim, these patches have been on a list for several weeks. It looks to me that Alex addressed all points raised by Andrew. Do you think they can be merge

Re: [PATCH v1 2/4] KVM: arm/arm64: vgic: Improve comment on kvm_vgic_inject_irq

2019-02-26 Thread Leo Yan
On Fri, Feb 22, 2019 at 03:40:50PM +, Marc Zyngier wrote: [...] > > > The interrupt affinity is either defined by the distributor > > > configuration (SPIs) or the ITS configuration (LPIs). > > > > Given to the up example, I am struggling to understand how you can set > > the interrupt affin

Re: [PATCH v4 19/22] vfio-pci: Register an iommu fault handler

2019-02-26 Thread Vincent Stehlé
Hi Eric, On Mon, Feb 18, 2019 at 02:55:00PM +0100, Eric Auger wrote: > This patch registers a fault handler which records faults in > a circular buffer and then signals an eventfd. This buffer is > exposed within the fault region. > > Signed-off-by: Eric Auger > --- > drivers/vfio/pci/vfio_pci.

Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-02-26 Thread Tomasz Nowicki
Hi Jean, On 15.01.2019 13:19, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. > > This is a simple rebase onto Linux v5.0-rc2. We now use the > dev_iommu_fwspec_get() helper introduced in v5.0 instead of accessing > dev->iommu_fwspec, but there