Re: [PATCH] KVM: arm/arm64: Hold slots_lock when unregisering kvm io bus devices

2017-05-17 Thread Auger Eric
Hi Christoffer, On 17/05/2017 21:18, Christoffer Dall wrote: > We were not holding the kvm->slots_lock as required when calling > kvm_io_bus_unregister_dev() as required. > > This only affects the error path, but still, let's do our due > dilligence. > > Reported by: Eric Auger

Re: [PATCH] KVM: arm/arm64: Fix bug when registering redist iodevs

2017-05-17 Thread Auger Eric
Hi Christoffer, On 17/05/2017 15:17, Christoffer Dall wrote: > If userspace creates the VCPUs after initializing the VGIC, then we end > up in a situation where we trigger a bug in kvm_vcpu_get_idx(), because > it is called prior to adding the VCPU into the vcpus array on the VM. > > There is no

[PATCH] KVM: arm/arm64: Hold slots_lock when unregisering kvm io bus devices

2017-05-17 Thread Christoffer Dall
We were not holding the kvm->slots_lock as required when calling kvm_io_bus_unregister_dev() as required. This only affects the error path, but still, let's do our due dilligence. Reported by: Eric Auger Signed-off-by: Christoffer Dall ---

Re: [PATCH 12/31] KVM: arm64: vgic-v3: Add ICV_IGRPEN1_EL1 handler

2017-05-17 Thread Auger Eric
Hi Marc, On 03/05/2017 12:45, Marc Zyngier wrote: > Add a handler for reading/writing the guest's view of the ICC_IGRPEN1_EL1 > register, which is located in the ICH_VMCR_EL2.VENG1 field. > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger

Re: [PATCH v2 07/11] KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs

2017-05-17 Thread Auger Eric
Hi Christoffer, On 17/05/2017 13:18, Christoffer Dall wrote: > Hi Jean, > > On Tue, May 16, 2017 at 12:23:52PM +0100, Jean-Philippe Brucker wrote: >> Hi, >> >> On 09/05/17 09:56, Christoffer Dall wrote: >>> Instead of waiting with registering KVM iodevs until the first VCPU is >>> run, we can

[PATCH] KVM: arm/arm64: Fix bug when registering redist iodevs

2017-05-17 Thread Christoffer Dall
If userspace creates the VCPUs after initializing the VGIC, then we end up in a situation where we trigger a bug in kvm_vcpu_get_idx(), because it is called prior to adding the VCPU into the vcpus array on the VM. There is no tight coupling between the VCPU index and the area of the redistributor

Re: [PATCH v2 07/11] KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs

2017-05-17 Thread Jean-Philippe Brucker
On 17/05/17 12:18, Christoffer Dall wrote: > Hi Jean, > > On Tue, May 16, 2017 at 12:23:52PM +0100, Jean-Philippe Brucker wrote: >> Hi, >> >> On 09/05/17 09:56, Christoffer Dall wrote: >>> Instead of waiting with registering KVM iodevs until the first VCPU is >>> run, we can actually create the

Re: [PATCH v2 07/11] KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs

2017-05-17 Thread Christoffer Dall
Hi Jean, On Tue, May 16, 2017 at 12:23:52PM +0100, Jean-Philippe Brucker wrote: > Hi, > > On 09/05/17 09:56, Christoffer Dall wrote: > > Instead of waiting with registering KVM iodevs until the first VCPU is > > run, we can actually create the iodevs when the redist base address is > > set. The

Re: [PATCH 08/31] arm64: Add a facility to turn an ESR syndrome into a sysreg encoding

2017-05-17 Thread Auger Eric
Hi, On 03/05/2017 12:45, Marc Zyngier wrote: > It is often useful to compare an ESR syndrome reporting the trapping > of a system register with a value matching that system register. > > Since encoding both the sysreg and the ESR version seem to be a bit > overkill, let's add a set of macros

Re: [PATCH 07/31] KVM: arm/arm64: vgic-v3: Add accessors for the ICH_APxRn_EL2 registers

2017-05-17 Thread Auger Eric
Hi, On 03/05/2017 12:45, Marc Zyngier wrote: > As we're about to access the Active Priority registers a lot more, > let's define accessors that take the register number as a parameter. > > Signed-off-by: Marc Zyngier > --- > virt/kvm/arm/hyp/vgic-v3-sr.c | 116 >

Re: [PATCH 09/31] KVM: arm64: Make kvm_condition_valid32() accessible from EL2

2017-05-17 Thread Auger Eric
Hi, On 03/05/2017 12:45, Marc Zyngier wrote: > As we're about to trap CP15 accesses and handle them at EL2, we > need to evaluate whether or not the condition flags are valid, > as an implementation is allowed to trap despite the condition > not being met. > > Tagging the function as __hyp_text

Re: [PATCH 10/31] KVM: arm64: vgic-v3: Add hook to handle guest GICv3 sysreg accesses at EL2

2017-05-17 Thread Auger Eric
Hi Marc, On 03/05/2017 12:45, Marc Zyngier wrote: > In order to start handling guest access to GICv3 system registers, > let's add a hook that will get called when we trap a system register > access. This is gated by a new static key (vgic_v3_cpuif_trap). > > Signed-off-by: Marc Zyngier