Re: [PATCH 10/11] arm64/kvm: context-switch ptrauth registers

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 03:26:07PM +0100, Mark Rutland wrote: > On Tue, Aug 01, 2017 at 01:00:14PM +0200, Christoffer Dall wrote: > > On Wed, Jul 19, 2017 at 05:01:31PM +0100, Mark Rutland wrote: > > > When pointer authentication is supported, a guest may wish to use it. > > > This patch adds the

Re: [RFC PATCH v2 11/19] genirq: Document vcpu_info usage for per-CPU interrupts

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 05:15:39PM +0100, Marc Zyngier wrote: > On 17/07/17 15:27, Christoffer Dall wrote: > > It is currently unclear how to set the VCPU affinity for an interrupt > > which is of the per-CPU kind, since the Linux irq_data structure > > very minor nit (which I should have noticed

Re: [RFC PATCH v2 11/19] genirq: Document vcpu_info usage for per-CPU interrupts

2017-08-01 Thread Marc Zyngier
On 17/07/17 15:27, Christoffer Dall wrote: > It is currently unclear how to set the VCPU affinity for an interrupt > which is of the per-CPU kind, since the Linux irq_data structure very minor nit (which I should have noticed before, my bad): we have two kinds of per-CPU interrupts in the kernel.

Re: [RFC PATCH v2 06/19] KVM: arm/arm64: Make timer_arm and timer_disarm helpers more generic

2017-08-01 Thread Marc Zyngier
On 01/08/17 15:57, Christoffer Dall wrote: > On Tue, Aug 01, 2017 at 03:10:59PM +0100, Marc Zyngier wrote: >> On 17/07/17 15:27, Christoffer Dall wrote: >>> We are about to add an additional soft timer to the arch timer state for >>> a VCPU and would like to be able to reuse the functions to

Re: [RFC PATCH v2 04/38] KVM: arm/arm64: Check if nested virtualization is in use

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 10:07:40AM -0400, Jintack Lim wrote: > On Sun, Jul 30, 2017 at 3:59 PM, Christoffer Dall wrote: > > On Tue, Jul 18, 2017 at 11:58:30AM -0500, Jintack Lim wrote: > >> Nested virtualizaion is in use only if all three conditions are met: > >> - The

Re: [RFC PATCH v2 06/19] KVM: arm/arm64: Make timer_arm and timer_disarm helpers more generic

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 03:10:59PM +0100, Marc Zyngier wrote: > On 17/07/17 15:27, Christoffer Dall wrote: > > We are about to add an additional soft timer to the arch timer state for > > a VCPU and would like to be able to reuse the functions to program and > > cancel a timer, so we make them

Re: [PATCH 10/11] arm64/kvm: context-switch ptrauth registers

2017-08-01 Thread Will Deacon
On Tue, Aug 01, 2017 at 03:26:07PM +0100, Mark Rutland wrote: > On Tue, Aug 01, 2017 at 01:00:14PM +0200, Christoffer Dall wrote: > > On Wed, Jul 19, 2017 at 05:01:31PM +0100, Mark Rutland wrote: > > > When pointer authentication is supported, a guest may wish to use it. > > > This patch adds the

Re: [PATCH 10/11] arm64/kvm: context-switch ptrauth registers

2017-08-01 Thread Mark Rutland
On Tue, Aug 01, 2017 at 01:00:14PM +0200, Christoffer Dall wrote: > On Wed, Jul 19, 2017 at 05:01:31PM +0100, Mark Rutland wrote: > > 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

Re: [RFC PATCH v2 20/38] KVM: arm64: Handle eret instruction traps

2017-08-01 Thread Jintack Lim
On Sun, Jul 30, 2017 at 4:00 PM, Christoffer Dall wrote: > On Tue, Jul 18, 2017 at 11:58:46AM -0500, Jintack Lim wrote: >> When HCR.NV bit is set, eret instructions trap to EL2 with EC code 0x1A. >> Emulate eret instructions by setting pc and pstate. > > It may be worth noting

Re: [RFC PATCH v2 06/19] KVM: arm/arm64: Make timer_arm and timer_disarm helpers more generic

2017-08-01 Thread Marc Zyngier
On 17/07/17 15:27, Christoffer Dall wrote: > We are about to add an additional soft timer to the arch timer state for > a VCPU and would like to be able to reuse the functions to program and > cancel a timer, so we make them slightly more generic and rename to make > it more clear that these

Re: [RFC PATCH v2 08/38] KVM: arm64: Add EL2 special registers to vcpu context

2017-08-01 Thread Jintack Lim
On Sun, Jul 30, 2017 at 3:59 PM, Christoffer Dall wrote: > On Tue, Jul 18, 2017 at 11:58:34AM -0500, Jintack Lim wrote: >> To support the virtual EL2 execution, we need to maintain the EL2 >> special registers such as SPSR_EL2, ELR_EL2 and SP_EL2 in vcpu context. >> >> Note that

Re: [RFC PATCH v2 04/38] KVM: arm/arm64: Check if nested virtualization is in use

2017-08-01 Thread Jintack Lim
On Sun, Jul 30, 2017 at 3:59 PM, Christoffer Dall wrote: > On Tue, Jul 18, 2017 at 11:58:30AM -0500, Jintack Lim wrote: >> Nested virtualizaion is in use only if all three conditions are met: >> - The architecture supports nested virtualization. >> - The kernel parameter is set.

Re: [RFC PATCH v2 02/38] KVM: arm/arm64: Enable nested virtualization via command-line

2017-08-01 Thread Jintack Lim
On Sun, Jul 30, 2017 at 3:59 PM, Christoffer Dall wrote: > On Tue, Jul 18, 2017 at 11:58:28AM -0500, Jintack Lim wrote: >> Add a new kernel parameter(kvm-arm.nested) to enable KVM/ARM nested >> virtualization support. This kernel parameter on arm architecture is >> ignored since

Re: [RFC PATCH v2 04/38] KVM: arm/arm64: Check if nested virtualization is in use

2017-08-01 Thread Jintack Lim
On Sun, Jul 30, 2017 at 3:59 PM, Christoffer Dall wrote: > On Tue, Jul 18, 2017 at 11:58:30AM -0500, Jintack Lim wrote: >> Nested virtualizaion is in use only if all three conditions are met: >> - The architecture supports nested virtualization. >> - The kernel parameter is set.

Re: [PATCH v2 15/16] KVM: arm64: Save ESR_EL2 on guest SError

2017-08-01 Thread Christoffer Dall
On Fri, Jul 28, 2017 at 03:10:18PM +0100, James Morse wrote: > When we exit a guest due to an SError the vcpu fault info isn't updated > with the ESR. Today this is only done for traps. > > The v8.2 RAS Extensions define ISS values for SError. Update the vcpu's > fault_info with the ESR on SError

Re: [RFC PATCH v2 05/19] KVM: arm/arm64: Check that system supports split eoi/deactivate

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 01:37:14PM +0100, Marc Zyngier wrote: > On 01/08/17 13:26, Christoffer Dall wrote: > > On Tue, Aug 01, 2017 at 12:35:23PM +0100, Marc Zyngier wrote: > >> On 17/07/17 15:27, Christoffer Dall wrote: > >>> Some systems without proper firmware and/or hardware description data >

Re: [PATCH v2 14/16] KVM: arm64: Take pending SErrors on entry to the guest

2017-08-01 Thread Christoffer Dall
Hi James, On Fri, Jul 28, 2017 at 03:10:17PM +0100, James Morse wrote: > SErrors due to RAS are either taken as an SError, or deferred because > of an Error Synchronization Barrier (ESB). Systems that support the RAS > extensions are very likely to have firmware-first handling of these > errors,

Re: [RFC PATCH v2 05/19] KVM: arm/arm64: Check that system supports split eoi/deactivate

2017-08-01 Thread Marc Zyngier
On 01/08/17 13:26, Christoffer Dall wrote: > On Tue, Aug 01, 2017 at 12:35:23PM +0100, Marc Zyngier wrote: >> On 17/07/17 15:27, Christoffer Dall wrote: >>> Some systems without proper firmware and/or hardware description data >>> don't support the split EOI and deactivate operation. >>> >>> On

Re: [RFC PATCH v2 05/19] KVM: arm/arm64: Check that system supports split eoi/deactivate

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 12:35:23PM +0100, Marc Zyngier wrote: > On 17/07/17 15:27, Christoffer Dall wrote: > > Some systems without proper firmware and/or hardware description data > > don't support the split EOI and deactivate operation. > > > > On such systems, we cannot leave the physical

Re: [RFC PATCH v2 05/19] KVM: arm/arm64: Check that system supports split eoi/deactivate

2017-08-01 Thread Marc Zyngier
On 17/07/17 15:27, Christoffer Dall wrote: > Some systems without proper firmware and/or hardware description data > don't support the split EOI and deactivate operation. > > On such systems, we cannot leave the physical interrupt active after the > timer handler on the host has run, so we cannot

Re: [RFC PATCH v2 38/38] KVM: arm64: Respect the virtual CPTR_EL2.TCPAC setting

2017-08-01 Thread Christoffer Dall
On Tue, Aug 01, 2017 at 07:03:35AM -0400, Jintack Lim wrote: > Hi Christoffer, > > On Mon, Jul 31, 2017 at 8:59 AM, Christoffer Dall wrote: > > On Tue, Jul 18, 2017 at 11:59:04AM -0500, Jintack Lim wrote: > >> Forward CPACR_EL1 traps to the virtual EL2 if virtual CPTR_EL2 is >

Re: [PATCH 10/11] arm64/kvm: context-switch ptrauth registers

2017-08-01 Thread Christoffer Dall
On Wed, Jul 19, 2017 at 05:01:31PM +0100, Mark Rutland wrote: > 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. > > When we schedule a vcpu, we

Re: [PATCH 09/11] arm64/kvm: preserve host HCR_EL2 value

2017-08-01 Thread Christoffer Dall
On Wed, Jul 19, 2017 at 05:01:30PM +0100, Mark Rutland wrote: > 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