Re: [PATCH v3 2/7] dt-bindings: virtio: Add virtio-pci-iommu node

2018-10-17 Thread Rob Herring
On Fri, 12 Oct 2018 15:59:12 +0100, Jean-Philippe Brucker wrote: > Some systems implement virtio-iommu as a PCI endpoint. The operating > systems needs to discover the relationship between IOMMU and masters long > before the PCI endpoint gets probed. Add a PCI child node to describe the > virtio-io

Re: [PATCH v3 1/7] dt-bindings: virtio-mmio: Add IOMMU description

2018-10-17 Thread Rob Herring
On Fri, Oct 12, 2018 at 03:59:11PM +0100, Jean-Philippe Brucker wrote: > The nature of a virtio-mmio node is discovered by the virtio driver at > probe time. However the DMA relation between devices must be described > statically. When a virtio-mmio node is a virtio-iommu device, it needs an > "#io

Re: [PATCH] KVM: arm64: Safety check PSTATE when entering guest and handle IL

2018-10-17 Thread Peter Maydell
On 17 October 2018 at 19:21, Christoffer Dall wrote: > This commit adds a paranoid check when entering the guest to make sure > we don't attempt running guest code in an equally or more privilged mode > than the hypervisor. We also catch other accidental programming of the > SPSR_EL2 which result

[PATCH] KVM: arm64: Safety check PSTATE when entering guest and handle IL

2018-10-17 Thread Christoffer Dall
This commit adds a paranoid check when entering the guest to make sure we don't attempt running guest code in an equally or more privilged mode than the hypervisor. We also catch other accidental programming of the SPSR_EL2 which results in an illegal exception return and report this safely back t

Re: [PATCH] kvm: arm64: fix caching of host MDCR_EL2 value

2018-10-17 Thread Robin Murphy
On 17/10/18 17:42, Mark Rutland wrote: At boot time, KVM stashes the host MDCR_EL2 value, but only does this when the kernel is not running in hyp mode (i.e. is non-VHE). In these cases, the stashed value of MDCR_EL2.HPMN happens to be zero, which can lead to CONSTRAINED UNPREDICTABLE behaviour.

Re: [PATCH] kvm: arm64: fix caching of host MDCR_EL2 value

2018-10-17 Thread Marc Zyngier
On 17/10/18 17:42, Mark Rutland wrote: > At boot time, KVM stashes the host MDCR_EL2 value, but only does this > when the kernel is not running in hyp mode (i.e. is non-VHE). In these > cases, the stashed value of MDCR_EL2.HPMN happens to be zero, which can > lead to CONSTRAINED UNPREDICTABLE behav

[PATCH] kvm: arm64: fix caching of host MDCR_EL2 value

2018-10-17 Thread Mark Rutland
At boot time, KVM stashes the host MDCR_EL2 value, but only does this when the kernel is not running in hyp mode (i.e. is non-VHE). In these cases, the stashed value of MDCR_EL2.HPMN happens to be zero, which can lead to CONSTRAINED UNPREDICTABLE behaviour. Since we use this value to derive the MD

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

2018-10-17 Thread Michael S. Tsirkin
On Wed, Oct 17, 2018 at 12:54:28PM +0100, Jean-Philippe Brucker wrote: > On 16/10/2018 21:31, Auger Eric wrote: > > Hi Jean, > > > > On 10/16/18 8:44 PM, Jean-Philippe Brucker wrote: > >> On 16/10/2018 10:25, Auger Eric wrote: > >>> Hi Jean, > >>> > >>> On 10/12/18 4:59 PM, Jean-Philippe Brucker w

Re: [PATCH v3 3/7] PCI: OF: Allow endpoints to bypass the iommu

2018-10-17 Thread Michael S. Tsirkin
On Mon, Oct 15, 2018 at 08:46:41PM +0100, Jean-philippe Brucker wrote: > [Replying with my personal address because we're having SMTP issues] > > On 15/10/2018 11:52, Michael S. Tsirkin wrote: > > On Fri, Oct 12, 2018 at 02:41:59PM -0500, Bjorn Helgaas wrote: > >> s/iommu/IOMMU/ in subject > >> >

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

2018-10-17 Thread Jean-Philippe Brucker
On 16/10/2018 21:31, Auger Eric wrote: > Hi Jean, > > On 10/16/18 8:44 PM, Jean-Philippe Brucker wrote: >> On 16/10/2018 10:25, Auger Eric wrote: >>> Hi Jean, >>> >>> On 10/12/18 4:59 PM, Jean-Philippe Brucker wrote: Implement the virtio-iommu driver, following specification v0.8 [1]. Ch

[PATCH v3 6/7] arm64: docs: document KVM support of pointer authentication

2018-10-17 Thread Amit Daniel Kachhap
The documentation is updated to help in using pointer authentication for KVM guests. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- Documentation/arm64/pointer-authentication.txt | 8 +++- 1 file changed, 7 in

[PATCH v3 5/7] arm64/kvm: control accessibility of ptrauth key registers

2018-10-17 Thread Amit Daniel Kachhap
According to userspace settings, ptrauth key registers are conditionally present in guest system register list based on user specified flag KVM_ARM_VCPU_PTRAUTH. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- arch

[PATCH v3 7/7] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2018-10-17 Thread Amit Daniel Kachhap
This is a runtime feature and can be enabled by --ptrauth option. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- arm/aarch32/include/kvm/kvm-cpu-arch.h| 2 ++ arm/aarch64/include/asm/kvm.h | 3 +++

[PATCH v3 3/7] arm64/kvm: add a userspace option to enable pointer authentication

2018-10-17 Thread Amit Daniel Kachhap
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 a new API. A new register is not created to pass this parameter

[PATCH v3 4/7] arm64/kvm: enable pointer authentication cpufeature conditionally

2018-10-17 Thread Amit Daniel Kachhap
According to userspace settings, pointer authentication cpufeature is enabled/disabled from guests. Signed-off-by: Amit Daniel Kachhap Cc: Mark Rutland Cc: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu --- arch/arm64/kvm/sys_regs.c | 33 +

[PATCH v3 2/7] arm64/kvm: context-switch ptrauth registers

2018-10-17 Thread Amit Daniel Kachhap
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. When we schedule a vcpu, we enable guest usage of pointer authentication instructions and accesses to the keys. After these are enabled, we

[PATCH v3 0/7] Add ARMv8.3 pointer authentication for kvm guest

2018-10-17 Thread Amit Daniel Kachhap
Hi, This patch series adds pointer authentication support for KVM guest and is based on top of Linux 4.19-rc7 and generic pointer authentication patch series[1]. The first two patch in this series was originally posted by Mark Rutland earlier[2,3] and contains some history of this work. Extension

[PATCH v3 1/7] arm64/kvm: preserve host HCR_EL2 value

2018-10-17 Thread Amit Daniel Kachhap
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 supporting extensions that require HCR_EL2 bits to be set conditionally for the host. To

Re: [PATCH 2/4] mm: speed up mremap by 500x on large regions (v2)

2018-10-17 Thread Joel Fernandes
On Tue, Oct 16, 2018 at 01:29:52PM +0200, Vlastimil Babka wrote: > On 10/16/18 12:33 AM, Joel Fernandes wrote: > > On Mon, Oct 15, 2018 at 02:42:09AM -0700, Christoph Hellwig wrote: > >> On Fri, Oct 12, 2018 at 06:31:58PM -0700, Joel Fernandes (Google) wrote: > >>> Android needs to mremap large reg

Re: [PATCH 2/4] mm: speed up mremap by 500x on large regions (v2)

2018-10-17 Thread Vlastimil Babka
On 10/16/18 9:43 PM, Joel Fernandes wrote: > On Tue, Oct 16, 2018 at 01:29:52PM +0200, Vlastimil Babka wrote: >> On 10/16/18 12:33 AM, Joel Fernandes wrote: >>> On Mon, Oct 15, 2018 at 02:42:09AM -0700, Christoph Hellwig wrote: On Fri, Oct 12, 2018 at 06:31:58PM -0700, Joel Fernandes (Google)