Re: [PATCH] KVM: arm/arm64: Handle hva aging while destroying the vm

2017-07-03 Thread Christoffer Dall
Hi Alex, On Fri, Jun 23, 2017 at 05:21:59PM +0200, Alexander Graf wrote: > If we want to age an HVA while the VM is getting destroyed, we have a > tiny race window during which we may end up dereferencing an invalid > kvm->arch.pgd value. > >CPU0 CPU1 > >kvm_age_hva() >

Re: [PATCH v4] arm64: kvm: inject SError with user space specified syndrome

2017-07-03 Thread Christoffer Dall
Hi Dongjiu, It seems you sent this patch twice, once on its own and then part of a series? Also, please use a cover letter when sending patch series. Thanks, -Christoffer On Mon, Jun 26, 2017 at 07:39:15PM +0800, Dongjiu Geng wrote: > when SError happen, kvm notifies user space to record the

Re: [PATCH v4] arm64: kvm: inject SError with user space specified syndrome

2017-07-03 Thread Christoffer Dall
Hi Dongjiu, It seems you sent this patch twice, once on its own and then part of a series? Also, please use a cover letter when sending patch series. Thanks, -Christoffer On Mon, Jun 26, 2017 at 07:39:15PM +0800, Dongjiu Geng wrote: > when SError happen, kvm notifies user space to record the

Re: [PATCH v2] KVM: ARM64: fix phy counter access failure in guest.

2017-06-12 Thread Christoffer Dall
On Mon, Jun 12, 2017 at 10:08:16AM +0100, Marc Zyngier wrote: > Nit: Please fix the time on your machine. It ended up in my Spam folder > because it comes from the future... > > On 12/06/17 15:37, Hu Huajun wrote: > > When reading the cntpct_el0 in guest with VHE (Virtual Host Extension) > >

Re: [PATCH v2] KVM: ARM64: fix phy counter access failure in guest.

2017-06-12 Thread Christoffer Dall
On Mon, Jun 12, 2017 at 10:08:16AM +0100, Marc Zyngier wrote: > Nit: Please fix the time on your machine. It ended up in my Spam folder > because it comes from the future... > > On 12/06/17 15:37, Hu Huajun wrote: > > When reading the cntpct_el0 in guest with VHE (Virtual Host Extension) > >

Re: [PATCH v2] KVM: ARM64: fix phy counter access failure in guest.

2017-06-12 Thread Christoffer Dall
art of the commit log. I can fix this up when applying though. > > Signed-off-by: Hu Huajun <huhua...@huawei.com> Reviewed-by: Christoffer Dall <cd...@linaro.org> Applied. Thanks, -Christoffer > --- > virt/kvm/arm/arm.c | 4 +--- > 1 file changed, 1 insertion(+),

Re: [PATCH v2] KVM: ARM64: fix phy counter access failure in guest.

2017-06-12 Thread Christoffer Dall
art of the commit log. I can fix this up when applying though. > > Signed-off-by: Hu Huajun Reviewed-by: Christoffer Dall Applied. Thanks, -Christoffer > --- > virt/kvm/arm/arm.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/virt/kvm/arm/arm.

Re: [PATCH] KVM: ARM64: fix phy counter access failure in guest.

2017-06-09 Thread Christoffer Dall
Hi, On Sat, Jun 10, 2017 at 12:22:20AM +0800, Hu Huajun wrote: > When reading the cntpct_el0 in guest with VHE (Virtual Host Extension) > enabled in host, the "Unsupported guest sys_reg access" error reported. > The reason is cnthctl_el2.EL1PCTEN is not enabled, which is expected > to be done in

Re: [PATCH] KVM: ARM64: fix phy counter access failure in guest.

2017-06-09 Thread Christoffer Dall
Hi, On Sat, Jun 10, 2017 at 12:22:20AM +0800, Hu Huajun wrote: > When reading the cntpct_el0 in guest with VHE (Virtual Host Extension) > enabled in host, the "Unsupported guest sys_reg access" error reported. > The reason is cnthctl_el2.EL1PCTEN is not enabled, which is expected > to be done in

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 10:55:29AM +0200, Auger Eric wrote: > Hi Christoffer, Marc, > > On 08/06/2017 10:34, Christoffer Dall wrote: > > On Thu, Jun 08, 2017 at 09:23:16AM +0100, Marc Zyngier wrote: > >> On Fri, Jun 02 2017 at 6:29:44 pm BST, Christoffer Dall >

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 10:55:29AM +0200, Auger Eric wrote: > Hi Christoffer, Marc, > > On 08/06/2017 10:34, Christoffer Dall wrote: > > On Thu, Jun 08, 2017 at 09:23:16AM +0100, Marc Zyngier wrote: > >> On Fri, Jun 02 2017 at 6:29:44 pm BST, Christoffer Dall > >

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 10:49:12AM +0200, Auger Eric wrote: > Hi Christoffer, > > On 02/06/2017 15:33, Christoffer Dall wrote: > > On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > >> Virtual interrupts directly mapped to physical interrupts requir

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 10:49:12AM +0200, Auger Eric wrote: > Hi Christoffer, > > On 02/06/2017 15:33, Christoffer Dall wrote: > > On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > >> Virtual interrupts directly mapped to physical interrupts requir

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 09:23:16AM +0100, Marc Zyngier wrote: > On Fri, Jun 02 2017 at 6:29:44 pm BST, Christoffer Dall <cd...@linaro.org> > wrote: > > On Fri, Jun 02, 2017 at 03:10:23PM +0100, Marc Zyngier wrote: > >> On 02/06/17 14:33, Christoffer Dall wrote: > &

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-08 Thread Christoffer Dall
On Thu, Jun 08, 2017 at 09:23:16AM +0100, Marc Zyngier wrote: > On Fri, Jun 02 2017 at 6:29:44 pm BST, Christoffer Dall > wrote: > > On Fri, Jun 02, 2017 at 03:10:23PM +0100, Marc Zyngier wrote: > >> On 02/06/17 14:33, Christoffer Dall wrote: > >> > On Wed,

Re: [RFC 07/55] KVM: arm/arm64: Add virtual EL2 state emulation framework

2017-06-02 Thread Christoffer Dall
On Fri, Jun 02, 2017 at 01:36:23PM -0400, Bandan Das wrote: > Christoffer Dall <cd...@linaro.org> writes: > > > On Thu, Jun 01, 2017 at 04:05:49PM -0400, Bandan Das wrote: > >> Jintack Lim <jint...@cs.columbia.edu> writes: > >> ... > >> >

Re: [RFC 07/55] KVM: arm/arm64: Add virtual EL2 state emulation framework

2017-06-02 Thread Christoffer Dall
On Fri, Jun 02, 2017 at 01:36:23PM -0400, Bandan Das wrote: > Christoffer Dall writes: > > > On Thu, Jun 01, 2017 at 04:05:49PM -0400, Bandan Das wrote: > >> Jintack Lim writes: > >> ... > >> > +/** > >> > + * kvm_arm_setup_shadow_state

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-02 Thread Christoffer Dall
On Fri, Jun 02, 2017 at 03:10:23PM +0100, Marc Zyngier wrote: > On 02/06/17 14:33, Christoffer Dall wrote: > > On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > >> Virtual interrupts directly mapped to physical interrupts require > >> some special care. The

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-02 Thread Christoffer Dall
On Fri, Jun 02, 2017 at 03:10:23PM +0100, Marc Zyngier wrote: > On 02/06/17 14:33, Christoffer Dall wrote: > > On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > >> Virtual interrupts directly mapped to physical interrupts require > >> some special care. The

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-02 Thread Christoffer Dall
On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > Virtual interrupts directly mapped to physical interrupts require > some special care. Their pending and active state must be observed > at distributor level and not in the list register. This is not entirely true. There's a

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Handle unshared mapped interrupts

2017-06-02 Thread Christoffer Dall
On Wed, May 24, 2017 at 10:13:21PM +0200, Eric Auger wrote: > Virtual interrupts directly mapped to physical interrupts require > some special care. Their pending and active state must be observed > at distributor level and not in the list register. This is not entirely true. There's a

Re: [RFC 07/55] KVM: arm/arm64: Add virtual EL2 state emulation framework

2017-06-02 Thread Christoffer Dall
On Thu, Jun 01, 2017 at 04:05:49PM -0400, Bandan Das wrote: > Jintack Lim writes: > ... > > +/** > > + * kvm_arm_setup_shadow_state -- prepare shadow state based on emulated > > mode > > + * @vcpu: The VCPU pointer > > + */ > > +void kvm_arm_setup_shadow_state(struct

Re: [RFC 07/55] KVM: arm/arm64: Add virtual EL2 state emulation framework

2017-06-02 Thread Christoffer Dall
On Thu, Jun 01, 2017 at 04:05:49PM -0400, Bandan Das wrote: > Jintack Lim writes: > ... > > +/** > > + * kvm_arm_setup_shadow_state -- prepare shadow state based on emulated > > mode > > + * @vcpu: The VCPU pointer > > + */ > > +void kvm_arm_setup_shadow_state(struct kvm_vcpu *vcpu) > > +{ > > +

Re: [PATCH v3 0/2] kvm: arm/arm64: Fixes for race conditions

2017-05-16 Thread Christoffer Dall
On Tue, May 16, 2017 at 11:01:54AM +0100, Suzuki K Poulose wrote: > On 16/05/17 10:53, Christoffer Dall wrote: > >On Tue, May 16, 2017 at 10:34:53AM +0100, Suzuki K Poulose wrote: > >>The patches fixes race conditions in stage2 pgd accesses. > >> > >>Patch 1

Re: [PATCH v3 0/2] kvm: arm/arm64: Fixes for race conditions

2017-05-16 Thread Christoffer Dall
On Tue, May 16, 2017 at 11:01:54AM +0100, Suzuki K Poulose wrote: > On 16/05/17 10:53, Christoffer Dall wrote: > >On Tue, May 16, 2017 at 10:34:53AM +0100, Suzuki K Poulose wrote: > >>The patches fixes race conditions in stage2 pgd accesses. > >> > >>Patch 1

Re: [PATCH v3 0/2] kvm: arm/arm64: Fixes for race conditions

2017-05-16 Thread Christoffer Dall
'd when we release > the kvm->mmu_lock to prevent VCPU starvation. > > Applies on kvmarm/master tree Thanks for the rebase and fix. Applied to master, and for both patches:: Reviewed-by: Christoffer Dall <cd...@linaro.org>

Re: [PATCH v3 0/2] kvm: arm/arm64: Fixes for race conditions

2017-05-16 Thread Christoffer Dall
'd when we release > the kvm->mmu_lock to prevent VCPU starvation. > > Applies on kvmarm/master tree Thanks for the rebase and fix. Applied to master, and for both patches:: Reviewed-by: Christoffer Dall

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
On Mon, May 15, 2017 at 06:51:26PM +0100, Suzuki K Poulose wrote: > On 15/05/17 18:43, Christoffer Dall wrote: > >On Mon, May 15, 2017 at 02:36:58PM +0100, Suzuki K Poulose wrote: > >>On 15/05/17 11:00, Christoffer Dall wrote: > >>>Hi Suzuki, > >>>So

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
On Mon, May 15, 2017 at 06:51:26PM +0100, Suzuki K Poulose wrote: > On 15/05/17 18:43, Christoffer Dall wrote: > >On Mon, May 15, 2017 at 02:36:58PM +0100, Suzuki K Poulose wrote: > >>On 15/05/17 11:00, Christoffer Dall wrote: > >>>Hi Suzuki, > >>>So

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
On Mon, May 15, 2017 at 02:36:58PM +0100, Suzuki K Poulose wrote: > On 15/05/17 11:00, Christoffer Dall wrote: > >Hi Suzuki, > > > >On Wed, May 03, 2017 at 03:17:52PM +0100, Suzuki K Poulose wrote: > >>We yield the kvm->mmu_lock occassionaly while perfor

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
On Mon, May 15, 2017 at 02:36:58PM +0100, Suzuki K Poulose wrote: > On 15/05/17 11:00, Christoffer Dall wrote: > >Hi Suzuki, > > > >On Wed, May 03, 2017 at 03:17:52PM +0100, Suzuki K Poulose wrote: > >>We yield the kvm->mmu_lock occassionaly while perfor

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
around cond_resched_lock in > stage2_wp_range(), as cond_resched_lock already does the same checks. > > Cc: Mark Rutland <mark.rutl...@arm.com> > Cc: Radim Krčmář <rkrc...@redhat.com> > Cc: andreyk...@google.com > Cc: Christoffer Dall <christoffer.d...@li

Re: [PATCH 2/2] kvm: arm/arm64: Fix use after free of stage2 page table

2017-05-15 Thread Christoffer Dall
around cond_resched_lock in > stage2_wp_range(), as cond_resched_lock already does the same checks. > > Cc: Mark Rutland > Cc: Radim Krčmář > Cc: andreyk...@google.com > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Paolo Bonzini > Signed-off-by: Suzuki K Poulose

Re: [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error

2017-05-10 Thread Christoffer Dall
On Wed, May 10, 2017 at 05:15:04PM +0800, gengdongjiu wrote: > Thanks James's explanation. > > Hi Christoffer, > > On 2017/5/9 22:28, James Morse wrote: > > Hi Christoffer, > > > > On 08/05/17 18:54, Christoffer Dall wrote: > >> On Mon, May 08, 2

Re: [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error

2017-05-10 Thread Christoffer Dall
On Wed, May 10, 2017 at 05:15:04PM +0800, gengdongjiu wrote: > Thanks James's explanation. > > Hi Christoffer, > > On 2017/5/9 22:28, James Morse wrote: > > Hi Christoffer, > > > > On 08/05/17 18:54, Christoffer Dall wrote: > >> On Mon, May 08, 2

Re: [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 06:28:02PM +0100, James Morse wrote: [...] > > > >>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > >>> index bb02909..1d2e2e7 100644 > >>> --- a/include/uapi/linux/kvm.h > >>> +++ b/include/uapi/linux/kvm.h > >>> @@ -1306,6 +1306,7 @@ struct

Re: [PATCH v3 3/3] arm/arm64: signal SIBGUS and inject SEA Error

2017-05-08 Thread Christoffer Dall
On Mon, May 08, 2017 at 06:28:02PM +0100, James Morse wrote: [...] > > > >>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > >>> index bb02909..1d2e2e7 100644 > >>> --- a/include/uapi/linux/kvm.h > >>> +++ b/include/uapi/linux/kvm.h > >>> @@ -1306,6 +1306,7 @@ struct

Re: [PATCH 1/2] kvm: Fix mmu_notifier release race

2017-04-25 Thread Christoffer Dall
; > [0] > http://lkml.kernel.org/r/caaehk+x8udhkq9xa1zkto6ax5e8dk32hywfat05fmchl2cr...@mail.gmail.com > > Fixes: commit 85db06e514422 ("KVM: mmu_notifiers release method") > Reported-by: andreyk...@google.com > Cc: Mark Rutland <mark.rutl...@arm.com> > Cc: Paolo B

Re: [PATCH 1/2] kvm: Fix mmu_notifier release race

2017-04-25 Thread Christoffer Dall
; > [0] > http://lkml.kernel.org/r/caaehk+x8udhkq9xa1zkto6ax5e8dk32hywfat05fmchl2cr...@mail.gmail.com > > Fixes: commit 85db06e514422 ("KVM: mmu_notifiers release method") > Reported-by: andreyk...@google.com > Cc: Mark Rutland > Cc: Paolo Bonzini > Cc: Radim Krčmá

Re: [PATCH V9 1/3] irq: Allow to pass the IRQF_TIMER flag with percpu irq request

2017-04-25 Thread Christoffer Dall
On Tue, Apr 25, 2017 at 11:49:27AM +0200, Daniel Lezcano wrote: [...] > > > > The idle code is very much *not* aware of anything concerning that guest > > timer. > > Just for my own curiosity, if there are two VM (VM1 and VM2). VM1 sets a > timer1 > at and exits, VM2 runs and sets a timer2

Re: [PATCH V9 1/3] irq: Allow to pass the IRQF_TIMER flag with percpu irq request

2017-04-25 Thread Christoffer Dall
On Tue, Apr 25, 2017 at 11:49:27AM +0200, Daniel Lezcano wrote: [...] > > > > The idle code is very much *not* aware of anything concerning that guest > > timer. > > Just for my own curiosity, if there are two VM (VM1 and VM2). VM1 sets a > timer1 > at and exits, VM2 runs and sets a timer2

Re: [PATCH 2/2] kvm: arm/arm64: Fix race in resetting stage2 PGD

2017-04-24 Thread Christoffer Dall
nder Graf <ag...@suse.de> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Cc: Marc Zyngier <marc.zyng...@arm.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: Suzuki K Poulose <suzuki.poul...@arm.com> Reviewed-by: Christoffer Dall <c

Re: [PATCH 2/2] kvm: arm/arm64: Fix race in resetting stage2 PGD

2017-04-24 Thread Christoffer Dall
ter dropping this lock, which could cause a race condition > where another thread waiting on the lock could potentially see that > the PGD is still valid and proceed to perform a stage2 operation. > > This patch moves the stage2 PGD manipulation under the lock. > > Reported-by: Alexande

Re: linux-next: manual merge of the kvm-arm tree with Linus' tree

2017-04-10 Thread Christoffer Dall
Hi Stephen, On Mon, Apr 10, 2017 at 02:02:08PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm-arm tree got conflicts in: > > virt/kvm/arm/vgic/vgic-v2.c > virt/kvm/arm/vgic/vgic.h > > between commit: > > 5b0d2cc28058 ("KVM: arm64: Ensure LRs are clear

Re: linux-next: manual merge of the kvm-arm tree with Linus' tree

2017-04-10 Thread Christoffer Dall
Hi Stephen, On Mon, Apr 10, 2017 at 02:02:08PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm-arm tree got conflicts in: > > virt/kvm/arm/vgic/vgic-v2.c > virt/kvm/arm/vgic/vgic.h > > between commit: > > 5b0d2cc28058 ("KVM: arm64: Ensure LRs are clear

Re: linux-next: manual merge of the kvm-arm tree with the kvm tree

2017-04-10 Thread Christoffer Dall
Hi Stephen, On Mon, Apr 10, 2017 at 01:52:42PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm-arm tree got conflicts in: > > Documentation/virtual/kvm/api.txt > include/uapi/linux/kvm.h > > between commits: > > a8a3c426772e ("KVM: MIPS: Add VZ & TE

Re: linux-next: manual merge of the kvm-arm tree with the kvm tree

2017-04-10 Thread Christoffer Dall
Hi Stephen, On Mon, Apr 10, 2017 at 01:52:42PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm-arm tree got conflicts in: > > Documentation/virtual/kvm/api.txt > include/uapi/linux/kvm.h > > between commits: > > a8a3c426772e ("KVM: MIPS: Add VZ & TE

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-04 Thread Christoffer Dall
On Tue, Apr 04, 2017 at 11:35:35AM +0100, Suzuki K Poulose wrote: > Hi Christoffer, > > On 04/04/17 11:13, Christoffer Dall wrote: > >Hi Suzuki, > > > >On Mon, Apr 03, 2017 at 03:12:43PM +0100, Suzuki K Poulose wrote: > >>In kvm_free_stage2_pgd() we don't

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-04 Thread Christoffer Dall
On Tue, Apr 04, 2017 at 11:35:35AM +0100, Suzuki K Poulose wrote: > Hi Christoffer, > > On 04/04/17 11:13, Christoffer Dall wrote: > >Hi Suzuki, > > > >On Mon, Apr 03, 2017 at 03:12:43PM +0100, Suzuki K Poulose wrote: > >>In kvm_free_stage2_pgd() we don't

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-04 Thread Christoffer Dall
...@vger.kernel.org # v3.10+ > Cc: Paolo Bonzini <pbon...@redhat.com> > Cc: Marc Zyngier <marc.zyng...@arm.com> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Cc: Mark Rutland <mark.rutl...@arm.com> > Signed-off-by: Suzuki K Poulose <suzuki.poul...@arm.c

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-04 Thread Christoffer Dall
...@vger.kernel.org # v3.10+ > Cc: Paolo Bonzini > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: Mark Rutland > Signed-off-by: Suzuki K Poulose > [ Avoid vCPU starvation and lockup detector warnings ] > Signed-off-by: Marc Zyngier > Signed-off-by: Suzuki K Poulose > T

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-03 Thread Christoffer Dall
gt; > > Fixes: commit d5d8184d35c9 ("KVM: ARM: Memory virtualization setup") > > Cc: sta...@vger.kernel.org # v3.10+ > > Cc: Paolo Bonzini <pbon...@redhat.com> > > Cc: Marc Zyngier <marc.zyng...@arm.com> > > Cc: Christoffer Dall <christoffer.

Re: [PATCH v3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-04-03 Thread Christoffer Dall
gt; > > Fixes: commit d5d8184d35c9 ("KVM: ARM: Memory virtualization setup") > > Cc: sta...@vger.kernel.org # v3.10+ > > Cc: Paolo Bonzini > > Cc: Marc Zyngier > > Cc: Christoffer Dall > > Cc: Mark Rutland > > Signed-off-by: Suzuki K Poulose

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 05:37:49PM +0200, Laszlo Ersek wrote: > On 03/29/17 16:48, Christoffer Dall wrote: > > On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: > >> 2017-03-29 18:36 GMT+08:00, Achin Gupta <achin.gu...@arm.com>: > > >>> Qemu is es

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 05:37:49PM +0200, Laszlo Ersek wrote: > On 03/29/17 16:48, Christoffer Dall wrote: > > On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: > >> 2017-03-29 18:36 GMT+08:00, Achin Gupta : > > >>> Qemu is essentially fulfi

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: > Hi Achin, > Thanks for your mail and answer. > > 2017-03-29 18:36 GMT+08:00, Achin Gupta : > > Hi gengdongjiu, > > > > On Wed, Mar 29, 2017 at 05:36:37PM +0800, gengdongjiu wrote: > >> > >> Hi

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: > Hi Achin, > Thanks for your mail and answer. > > 2017-03-29 18:36 GMT+08:00, Achin Gupta : > > Hi gengdongjiu, > > > > On Wed, Mar 29, 2017 at 05:36:37PM +0800, gengdongjiu wrote: > >> > >> Hi Laszlo/Biesheuvel/Qemu developer, > >>

Re: [PATCH V14 10/10] arm/arm64: KVM: add guest SEA support

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 03:33:17PM -0600, Baicar, Tyler wrote: > Hello Christoffer, > > > On 3/28/2017 2:26 PM, Christoffer Dall wrote: > >On Tue, Mar 28, 2017 at 01:30:40PM -0600, Tyler Baicar wrote: > >>Currently external aborts are unsupported by the guest abort

Re: [PATCH V14 10/10] arm/arm64: KVM: add guest SEA support

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 03:33:17PM -0600, Baicar, Tyler wrote: > Hello Christoffer, > > > On 3/28/2017 2:26 PM, Christoffer Dall wrote: > >On Tue, Mar 28, 2017 at 01:30:40PM -0600, Tyler Baicar wrote: > >>Currently external aborts are unsupported by the guest abort

Re: [PATCH V14 10/10] arm/arm64: KVM: add guest SEA support

2017-03-28 Thread Christoffer Dall
gt; +int ghes_notify_sea(void) > { > struct ghes *ghes; > + int ret = -ENOENT; > > - /* > - * synchronize_rcu() will wait for nmi_exit(), so no need to > - * rcu_read_lock(). > - */ > + rcu_read_lock(); > list_for_each_entry_rcu(ghes, _sea, list) { > - ghes_proc(ghes); > + if(!ghes_proc(ghes)) > + ret = 0; > } > + rcu_read_unlock(); > + return ret; > } > > static void ghes_sea_add(struct ghes *ghes) > diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h > index 18bc935..2a727dc 100644 > --- a/include/acpi/ghes.h > +++ b/include/acpi/ghes.h > @@ -99,6 +99,6 @@ static inline void *acpi_hest_generic_data_payload(struct > acpi_hest_generic_data > gdata + 1; > } > > -void ghes_notify_sea(void); > +int ghes_notify_sea(void); > > #endif /* GHES_H */ > -- I feel like the changes to acpi/arm64 in this patch could have been a separate patch or folded into previous patches, but for the KVM part of this patch: Acked-by: Christoffer Dall <cd...@linaro.org>

Re: [PATCH V14 10/10] arm/arm64: KVM: add guest SEA support

2017-03-28 Thread Christoffer Dall
et = -ENOENT; > > - /* > - * synchronize_rcu() will wait for nmi_exit(), so no need to > - * rcu_read_lock(). > - */ > + rcu_read_lock(); > list_for_each_entry_rcu(ghes, _sea, list) { > - ghes_proc(ghes); > + if(!ghes_proc(ghes)) > + ret = 0; > } > + rcu_read_unlock(); > + return ret; > } > > static void ghes_sea_add(struct ghes *ghes) > diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h > index 18bc935..2a727dc 100644 > --- a/include/acpi/ghes.h > +++ b/include/acpi/ghes.h > @@ -99,6 +99,6 @@ static inline void *acpi_hest_generic_data_payload(struct > acpi_hest_generic_data > gdata + 1; > } > > -void ghes_notify_sea(void); > +int ghes_notify_sea(void); > > #endif /* GHES_H */ > -- I feel like the changes to acpi/arm64 in this patch could have been a separate patch or folded into previous patches, but for the KVM part of this patch: Acked-by: Christoffer Dall

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 02:24:55PM +0100, Achin Gupta wrote: > On Tue, Mar 28, 2017 at 02:22:29PM +0200, Christoffer Dall wrote: > > On Tue, Mar 28, 2017 at 12:54:13PM +0100, Achin Gupta wrote: > > > On Tue, Mar 28, 2017 at 01:23:28PM +0200, Christoffer Dall wrote: > >

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 02:24:55PM +0100, Achin Gupta wrote: > On Tue, Mar 28, 2017 at 02:22:29PM +0200, Christoffer Dall wrote: > > On Tue, Mar 28, 2017 at 12:54:13PM +0100, Achin Gupta wrote: > > > On Tue, Mar 28, 2017 at 01:23:28PM +0200, Christoffer Dall wrote: > >

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 12:54:13PM +0100, Achin Gupta wrote: > On Tue, Mar 28, 2017 at 01:23:28PM +0200, Christoffer Dall wrote: > > On Tue, Mar 28, 2017 at 11:48:08AM +0100, James Morse wrote: > > > Hi Christoffer, > > > > > > (CC: Leif and Ach

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 12:54:13PM +0100, Achin Gupta wrote: > On Tue, Mar 28, 2017 at 01:23:28PM +0200, Christoffer Dall wrote: > > On Tue, Mar 28, 2017 at 11:48:08AM +0100, James Morse wrote: > > > Hi Christoffer, > > > > > > (CC: Leif and Ach

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 11:48:08AM +0100, James Morse wrote: > Hi Christoffer, > > (CC: Leif and Achin who know more about how UEFI fits into this picture) > > On 21/03/17 19:39, Christoffer Dall wrote: > > On Tue, Mar 21, 2017 at 07:11:44PM +, James Morse wrote: &

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-28 Thread Christoffer Dall
On Tue, Mar 28, 2017 at 11:48:08AM +0100, James Morse wrote: > Hi Christoffer, > > (CC: Leif and Achin who know more about how UEFI fits into this picture) > > On 21/03/17 19:39, Christoffer Dall wrote: > > On Tue, Mar 21, 2017 at 07:11:44PM +, James Morse wrote: &

Re: [PATCH] kvm: arm/arm64: Rework gpa callback handlers

2017-03-24 Thread Christoffer Dall
This patch reworks the code to invoke the callback handlers on the > biggest range possible within the memory slot to avoid reduce the > number of iterations. avoid reduce? did you mean "to reduce the number of times the handler is called" ? > > Cc: Marc Zyngier <marc.zy

Re: [PATCH] kvm: arm/arm64: Rework gpa callback handlers

2017-03-24 Thread Christoffer Dall
This patch reworks the code to invoke the callback handlers on the > biggest range possible within the memory slot to avoid reduce the > number of iterations. avoid reduce? did you mean "to reduce the number of times the handler is called" ? > > Cc: Marc Zyngier > Cc:

Re: [PATCH V13 10/10] arm/arm64: KVM: add guest SEA support

2017-03-24 Thread Christoffer Dall
On Tue, Mar 21, 2017 at 04:47:05PM -0600, Tyler Baicar wrote: > Currently external aborts are unsupported by the guest abort > handling. Add handling for SEAs so that the host kernel reports > SEAs which occur in the guest kernel. The logic in kvm_handle_guest_abort could deserve an explanation

Re: [PATCH V13 10/10] arm/arm64: KVM: add guest SEA support

2017-03-24 Thread Christoffer Dall
On Tue, Mar 21, 2017 at 04:47:05PM -0600, Tyler Baicar wrote: > Currently external aborts are unsupported by the guest abort > handling. Add handling for SEAs so that the host kernel reports > SEAs which occur in the guest kernel. The logic in kvm_handle_guest_abort could deserve an explanation

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-21 Thread Christoffer Dall
[resending as clear text - I thought GMail supported that - sorry] On Tue, Mar 21, 2017 at 07:11:44PM +, James Morse wrote: > Hi Christoffer, > > On 21/03/17 11:34, Christoffer Dall wrote: > > On Tue, Mar 21, 2017 at 02:32:29PM +0800, gengdongjiu wrote: > >> On 2017

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-21 Thread Christoffer Dall
[resending as clear text - I thought GMail supported that - sorry] On Tue, Mar 21, 2017 at 07:11:44PM +, James Morse wrote: > Hi Christoffer, > > On 21/03/17 11:34, Christoffer Dall wrote: > > On Tue, Mar 21, 2017 at 02:32:29PM +0800, gengdongjiu wrote: > >> On 2017

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-21 Thread Christoffer Dall
On Tue, Mar 21, 2017 at 02:32:29PM +0800, gengdongjiu wrote: > > > On 2017/3/20 23:08, James Morse wrote: > > Hi Dongjiu Geng, > > > > On 20/03/17 13:58, Marc Zyngier wrote: > >> On 20/03/17 12:28, gengdongjiu wrote: > >>> On 2017/3/20 19:24, Marc Zyngier wrote: > Please include James

Re: [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-21 Thread Christoffer Dall
On Tue, Mar 21, 2017 at 02:32:29PM +0800, gengdongjiu wrote: > > > On 2017/3/20 23:08, James Morse wrote: > > Hi Dongjiu Geng, > > > > On 20/03/17 13:58, Marc Zyngier wrote: > >> On 20/03/17 12:28, gengdongjiu wrote: > >>> On 2017/3/20 19:24, Marc Zyngier wrote: > Please include James

Re: [PATCH v2 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-17 Thread Christoffer Dall
l.org # v3.10+ > Cc: Paolo Bonzini <pbon...@redhat.com> > Cc: Marc Zyngier <marc.zyng...@arm.com> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Signed-off-by: Suzuki K Poulose <suzuki.poul...@arm.com> > [ Avoid vCPU starvation and lockup detect

Re: [PATCH v2 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-17 Thread Christoffer Dall
l.org # v3.10+ > Cc: Paolo Bonzini > Cc: Marc Zyngier > Cc: Christoffer Dall > Signed-off-by: Suzuki K Poulose > [ Avoid vCPU starvation and lockup detector warnings ] > Signed-off-by: Marc Zyngier > Signed-off-by: Suzuki K Poulose Reviewed-by: Christoffer Dall &

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 09:39:26AM +, Marc Zyngier wrote: > On 15/03/17 09:21, Christoffer Dall wrote: > > On Tue, Mar 14, 2017 at 02:52:34PM +, Suzuki K Poulose wrote: > >> In kvm_free_stage2_pgd() we don't hold the kvm->mmu_lock while calling > >> unma

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 09:39:26AM +, Marc Zyngier wrote: > On 15/03/17 09:21, Christoffer Dall wrote: > > On Tue, Mar 14, 2017 at 02:52:34PM +, Suzuki K Poulose wrote: > >> In kvm_free_stage2_pgd() we don't hold the kvm->mmu_lock while calling > >> unma

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 01:28:07PM +, Marc Zyngier wrote: > On 15/03/17 10:56, Christoffer Dall wrote: > > On Wed, Mar 15, 2017 at 09:39:26AM +, Marc Zyngier wrote: > >> On 15/03/17 09:21, Christoffer Dall wrote: > >>> On Tue, Mar 14, 2017 at 02:52:34PM

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 01:28:07PM +, Marc Zyngier wrote: > On 15/03/17 10:56, Christoffer Dall wrote: > > On Wed, Mar 15, 2017 at 09:39:26AM +, Marc Zyngier wrote: > >> On 15/03/17 09:21, Christoffer Dall wrote: > >>> On Tue, Mar 14, 2017 at 02:52:34PM

Re: [PATCH 2/3] kvm: arm/arm64: Take mmap_sem in kvm_arch_prepare_memory_region

2017-03-15 Thread Christoffer Dall
ommit 8eef91239e57 ("arm/arm64: KVM: map MMIO regions at creation > time") > Cc: Ard Biesheuvel <ard.biesheu...@linaro.org> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Cc: Eric Auger <eric.au...@rehat.com> > Cc: sta...@vger.kernel.org # v3.18+ &g

Re: [PATCH 1/3] kvm: arm/arm64: Take mmap_sem in stage2_unmap_vm

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 09:34:53AM +, Marc Zyngier wrote: > On 15/03/17 09:17, Christoffer Dall wrote: > > On Tue, Mar 14, 2017 at 02:52:32PM +, Suzuki K Poulose wrote: > >> From: Marc Zyngier <marc.zyng...@arm.com> > >> > >> We don't hold the

Re: [PATCH 2/3] kvm: arm/arm64: Take mmap_sem in kvm_arch_prepare_memory_region

2017-03-15 Thread Christoffer Dall
rm/arm64: KVM: map MMIO regions at creation > time") > Cc: Ard Biesheuvel > Cc: Christoffer Dall > Cc: Eric Auger > Cc: sta...@vger.kernel.org # v3.18+ > Signed-off-by: Marc Zyngier > [ Handle dirty page logging failure case ] > Signed-off-by: Suzuki K Poulose R

Re: [PATCH 1/3] kvm: arm/arm64: Take mmap_sem in stage2_unmap_vm

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 09:34:53AM +, Marc Zyngier wrote: > On 15/03/17 09:17, Christoffer Dall wrote: > > On Tue, Mar 14, 2017 at 02:52:32PM +, Suzuki K Poulose wrote: > >> From: Marc Zyngier > >> > >> We don't hold the mmap_sem while searching for the

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
g to > unmap a range. > > Fixes: commit d5d8184d35c9 ("KVM: ARM: Memory virtualization setup") > Cc: sta...@vger.kernel.org # v3.10+ > Cc: Marc Zyngier <marc.zyng...@arm.com> > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Signed-off-by: Suzuki K Poulo

Re: [PATCH 3/3] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

2017-03-15 Thread Christoffer Dall
g to > unmap a range. > > Fixes: commit d5d8184d35c9 ("KVM: ARM: Memory virtualization setup") > Cc: sta...@vger.kernel.org # v3.10+ > Cc: Marc Zyngier > Cc: Christoffer Dall > Signed-off-by: Suzuki K Poulose > --- > arch/arm/kvm/mmu.c | 3 +++ > 1 file cha

Re: [PATCH 1/3] kvm: arm/arm64: Take mmap_sem in stage2_unmap_vm

2017-03-15 Thread Christoffer Dall
Fixes: commit 957db105c997 ("arm/arm64: KVM: Introduce stage2_unmap_vm") > Cc: sta...@vger.kernel.org # v3.19+ > Cc: Christoffer Dall <christoffer.d...@linaro.org> > Signed-off-by: Marc Zyngier <marc.zyng...@arm.com> > Signed-off-by: Suzuki K Poulose <suzu

Re: [PATCH 1/3] kvm: arm/arm64: Take mmap_sem in stage2_unmap_vm

2017-03-15 Thread Christoffer Dall
c997 ("arm/arm64: KVM: Introduce stage2_unmap_vm") > Cc: sta...@vger.kernel.org # v3.19+ > Cc: Christoffer Dall > Signed-off-by: Marc Zyngier > Signed-off-by: Suzuki K Poulose > --- > arch/arm/kvm/mmu.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git

Re: [PATCH v2] arm64: kvm: Use has_vhe() instead of hyp_alternate_select()

2017-03-09 Thread Christoffer Dall
Hi Shanker, On Sun, Mar 05, 2017 at 08:33:18PM -0600, Shanker Donthineni wrote: > Now all the cpu_hwcaps features have their own static keys. We don't > need a separate function hyp_alternate_select() to patch the vhe/nvhe > code. We can achieve the same functionality by using has_vhe(). It >

Re: [PATCH v2] arm64: kvm: Use has_vhe() instead of hyp_alternate_select()

2017-03-09 Thread Christoffer Dall
Hi Shanker, On Sun, Mar 05, 2017 at 08:33:18PM -0600, Shanker Donthineni wrote: > Now all the cpu_hwcaps features have their own static keys. We don't > need a separate function hyp_alternate_select() to patch the vhe/nvhe > code. We can achieve the same functionality by using has_vhe(). It >

Re: [PATCH 4/5] KVM: add __kvm_request_needs_mb

2017-02-24 Thread Christoffer Dall
On Wed, Feb 22, 2017 at 04:17:05PM +0100, Radim Krčmář wrote: > [Oops, the end of this thread got dragged into a mark-as-read spree ...] > > 2017-02-17 11:13+0100, David Hildenbrand: > >>> This is really complicated stuff, and the basic reason for it (if I > >>> remember correctly) is that s390x

Re: [PATCH 4/5] KVM: add __kvm_request_needs_mb

2017-02-24 Thread Christoffer Dall
On Wed, Feb 22, 2017 at 04:17:05PM +0100, Radim Krčmář wrote: > [Oops, the end of this thread got dragged into a mark-as-read spree ...] > > 2017-02-17 11:13+0100, David Hildenbrand: > >>> This is really complicated stuff, and the basic reason for it (if I > >>> remember correctly) is that s390x

Re: [RFC 54/55] KVM: arm/arm64: Adjust virtual offset considering nesting

2017-02-22 Thread Christoffer Dall
Hi Jintack, On Mon, Jan 09, 2017 at 01:24:50AM -0500, Jintack Lim wrote: > The guest hypervisor sets cntvoff_el2 for its VM (i.e. nested VM). Note > that physical/virtual counter value in the guest hypervisor's point of > view is already offsetted by the virtual offset set by the host >

Re: [RFC 54/55] KVM: arm/arm64: Adjust virtual offset considering nesting

2017-02-22 Thread Christoffer Dall
Hi Jintack, On Mon, Jan 09, 2017 at 01:24:50AM -0500, Jintack Lim wrote: > The guest hypervisor sets cntvoff_el2 for its VM (i.e. nested VM). Note > that physical/virtual counter value in the guest hypervisor's point of > view is already offsetted by the virtual offset set by the host >

Re: [RFC 00/55] Nested Virtualization on KVM/ARM

2017-02-22 Thread Christoffer Dall
Hi Jintack, On Mon, Jan 09, 2017 at 01:23:56AM -0500, Jintack Lim wrote: > Nested virtualization is the ability to run a virtual machine inside another > virtual machine. In other words, it’s about running a hypervisor (the guest > hypervisor) on top of another hypervisor (the host hypervisor).

Re: [RFC 00/55] Nested Virtualization on KVM/ARM

2017-02-22 Thread Christoffer Dall
Hi Jintack, On Mon, Jan 09, 2017 at 01:23:56AM -0500, Jintack Lim wrote: > Nested virtualization is the ability to run a virtual machine inside another > virtual machine. In other words, it’s about running a hypervisor (the guest > hypervisor) on top of another hypervisor (the host hypervisor).

Re: [RFC 47/55] KVM: arm/arm64: Forward the guest hypervisor's stage 2 permission faults

2017-02-22 Thread Christoffer Dall
On Mon, Jan 09, 2017 at 01:24:43AM -0500, Jintack Lim wrote: > From: Christoffer Dall <christoffer.d...@linaro.org> > > When faulting on a shadow stage 2 page table we have to check if the > fault was a permission fault and if so, if that fault needs to be > handled by the gu

Re: [RFC 41/55] KVM: arm/arm64: Unmap/flush shadow stage 2 page tables

2017-02-22 Thread Christoffer Dall
On Mon, Jan 09, 2017 at 01:24:37AM -0500, Jintack Lim wrote: > From: Christoffer Dall <christoffer.d...@linaro.org> > > Unmap/flush shadow stage 2 page tables for the nested VMs as well as the > stage 2 page table for the guest hypervisor. > > Note: A bunch of the code

Re: [RFC 47/55] KVM: arm/arm64: Forward the guest hypervisor's stage 2 permission faults

2017-02-22 Thread Christoffer Dall
On Mon, Jan 09, 2017 at 01:24:43AM -0500, Jintack Lim wrote: > From: Christoffer Dall > > When faulting on a shadow stage 2 page table we have to check if the > fault was a permission fault and if so, if that fault needs to be > handled by the guest hypervisor before us, in

<    2   3   4   5   6   7   8   9   10   11   >