[RFC PATCH 4/4] KVM: arm64: Optimise FPSIMD context switching

2018-03-21 Thread Dave Martin
Currently, the optimisations to move most of the KVM save/restore logic to vcpu_load()/vcpu_put() don't work for FPSIMD, so the host and guest FPSIMD state must be saved/restored rather deep in the guest entry code, in the local_irq_disable() region. This avoids some nasty interactions with kernel

[RFC PATCH 2/4] KVM: arm64: Convert lazy FPSIMD context switch trap to C

2018-03-21 Thread Dave Martin
To make the lazt FPSIMD context switch trap code easier to hack on, this patch converts it to C. This is not amazingly efficient, but the trap should typically only be taken once per host context switch. Signed-off-by: Dave Martin --- This patch adds the missing ! to ensure that the hyp stack

[RFC PATCH 1/4] KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change

2018-03-21 Thread Dave Martin
From: Christoffer Dall KVM/ARM differs from other architectures in having to maintain an additional virtual address space from that of the host and the guest, because we split the execution of KVM across both EL1 and EL2. This results in a need to explicitly map data structures into EL2 (hyp) wh

[RFC PATCH 3/4] arm64: fpsimd: Split cpu field out from struct fpsimd_state

2018-03-21 Thread Dave Martin
In preparation for using a common representation of the FPSIMD state for tasks and KVM vcpus, this patch separates out the "cpu" field that is used to track the cpu on which the state was most recently loaded. This will allow common code to operate on task and vcpu contexts without requiring the c

[RFC PATCH 0/4] KVM: arm64: Optimise FPSIMD context switching

2018-03-21 Thread Dave Martin
This is the second spin of my attempt to improve FPSIMD context handling for KVM. It is different enough from the previous attempt that I don't claim it's a v2 of the same RFC. The patches are based on Christoffer's VHE optimisation series. See the final patch of the series for the bulk of the e

Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-21 Thread Robin Murphy
On 21/03/18 13:14, Jean-Philippe Brucker wrote: On 21/03/18 06:43, Tian, Kevin wrote: [...] + +#include + +#define MSI_IOVA_BASE 0x800 +#define MSI_IOVA_LENGTH0x10 this is ARM specific, and according to virtio-iommu spec isn't it better probed

Re: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-21 Thread Jean-Philippe Brucker
On 21/03/18 06:43, Tian, Kevin wrote: [...] >> + >> +#include >> + >> +#define MSI_IOVA_BASE 0x800 >> +#define MSI_IOVA_LENGTH 0x10 > > this is ARM specific, and according to virtio-iommu spec isn't it > better probed on the endpoint instead of ha

RE: [PATCH 1/4] iommu: Add virtio-iommu driver

2018-03-21 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, February 14, 2018 10:54 PM > > The virtio IOMMU is a para-virtualized device, allowing to send IOMMU > requests such as map/unmap over virtio-mmio transport without > emulating > page tables. This implementatio

Re: [RFC 03/12] KVM: arm/arm64: Record RDIST Last bit at registration

2018-03-21 Thread Marc Zyngier
On 19/03/18 21:06, Auger Eric wrote: > Hi Marc, > > On 19/03/18 16:57, Marc Zyngier wrote: >> On 19/03/18 09:20, Eric Auger wrote: >>> To prepare for multiple RDIST regions, let's record the RDIST >>> Last bit field when registering the IO device. >>> >>> As a reminder the Last bit indicates wheth