Re: KVM on ARM Cortex A53 in 32-bit Mode

2017-03-15 Thread Yasutaka, T
Hi Christopher and other KVM/ARM community members, I tried the following QEMU and Kernel combinations on Raspberry Pi 3 (AArch64 mode) but failed: Latest commit of Alexander Graf's no-kvm-irqchip QEMU branch: https://github.com/agraf/qemu/tree/no-kvm-irqchip raspberrypi/linux's rpi-4.10.y

[PATCH] KVM: arm/arm64: Signal SIGBUS when stage2 discovers hwpoison memory

2017-03-15 Thread James Morse
Once we enable ARCH_SUPPORTS_MEMORY_FAILURE on arm64[0], notifications for broken memory can call memory_failure() in mm/memory-failure.c to deliver SIGBUS to any user space process using the page, and notify all the in-kernel users. If the page corresponded with guest memory, KVM will unmap this

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Andrew Jones
On Wed, Mar 15, 2017 at 04:22:37PM +0100, Christoffer Dall wrote: > On Wed, Mar 15, 2017 at 03:06:33PM +0100, Andrew Jones wrote: > > On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: > > > > If QEMU wants to know > > > > whether or not the host it's running on is heterogeneous,

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 03:06:33PM +0100, Andrew Jones wrote: > On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: > > > If QEMU wants to know > > > whether or not the host it's running on is heterogeneous, then > > > it can just query sysfs, rather than ask KVM. > > > > > > > Can

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

2017-03-15 Thread Marc Zyngier
On 15/03/17 14:33, Suzuki K Poulose wrote: > On 15/03/17 13:28, 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 +, Suzuki

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Mark Rutland
On Wed, Mar 15, 2017 at 03:06:33PM +0100, Andrew Jones wrote: > On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: > > > If QEMU wants to know > > > whether or not the host it's running on is heterogeneous, then > > > it can just query sysfs, rather than ask KVM. > > > > > > > Can

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Andrew Jones
On Wed, Mar 15, 2017 at 02:21:48PM +, Peter Maydell wrote: > On 15 March 2017 at 14:06, Andrew Jones wrote: > > On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: > >> > If QEMU wants to know > >> > whether or not the host it's running on is heterogeneous,

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

2017-03-15 Thread Suzuki K Poulose
On 15/03/17 13:28, 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 +, Suzuki K Poulose wrote: In kvm_free_stage2_pgd() we don't hold

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Peter Maydell
On 15 March 2017 at 14:06, Andrew Jones wrote: > On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: >> > If QEMU wants to know >> > whether or not the host it's running on is heterogeneous, then >> > it can just query sysfs, rather than ask KVM. >> > >> >> Can

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Andrew Jones
On Wed, Mar 15, 2017 at 02:36:45PM +0100, Christoffer Dall wrote: > > If QEMU wants to know > > whether or not the host it's running on is heterogeneous, then > > it can just query sysfs, rather than ask KVM. > > > > Can it? Is this information available in a reliable way from userspace? I

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

2017-03-15 Thread Robin Murphy
Hi Marc, On 15/03/17 13:43, Marc Zyngier wrote: > On 15/03/17 13:35, Christoffer Dall wrote: >> 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,

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

2017-03-15 Thread Marc Zyngier
On 15/03/17 13:35, Christoffer Dall wrote: > 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

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Christoffer Dall
On Wed, Mar 15, 2017 at 01:51:13PM +0100, Andrew Jones wrote: > On Wed, Mar 15, 2017 at 12:50:44PM +0100, Christoffer Dall wrote: > > Hi Drew, > > > > [Replying here to try to capture the discussion about this patch we had > > at connect]. > > > > On Sat, Jan 28, 2017 at 03:55:51PM +0100, Andrew

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 +, Suzuki K Poulose wrote: >

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

2017-03-15 Thread Paolo Bonzini
On 15/03/2017 10: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 VMAs when >> we try to unmap each memslot for a VM. Fix this properly to >> avoid

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

2017-03-15 Thread Marc Zyngier
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 +, Suzuki K Poulose wrote: In kvm_free_stage2_pgd() we don't hold the kvm->mmu_lock while calling

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Andrew Jones
On Wed, Mar 15, 2017 at 12:50:44PM +0100, Christoffer Dall wrote: > Hi Drew, > > [Replying here to try to capture the discussion about this patch we had > at connect]. > > On Sat, Jan 28, 2017 at 03:55:51PM +0100, Andrew Jones wrote: > > On Mon, Jan 16, 2017 at 05:33:33PM +0800, Shannon Zhao

Re: [PATCH RFC 6/7] ARM64: KVM: Support heterogeneous system

2017-03-15 Thread Christoffer Dall
Hi Drew, [Replying here to try to capture the discussion about this patch we had at connect]. On Sat, Jan 28, 2017 at 03:55:51PM +0100, Andrew Jones wrote: > On Mon, Jan 16, 2017 at 05:33:33PM +0800, Shannon Zhao wrote: > > From: Shannon Zhao > > > > When initializing

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

2017-03-15 Thread Christoffer Dall
On Tue, Mar 14, 2017 at 02:52:33PM +, Suzuki K Poulose wrote: > From: Marc Zyngier > > We don't hold the mmap_sem while searching for VMAs (via find_vma), in > kvm_arch_prepare_memory_region, which can end up in expected failures. > > Fixes: commit 8eef91239e57

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 VMAs when >

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 > >> unmap_stage2_range() on the entire

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

2017-03-15 Thread Marc Zyngier
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 >> unmap_stage2_range() on the entire memory range for the guest. This could >> cause problems with other callers

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

2017-03-15 Thread Marc Zyngier
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 VMAs when >> we try to unmap each memslot for a VM. Fix this properly to >> avoid

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

2017-03-15 Thread Christoffer Dall
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 > unmap_stage2_range() on the entire memory range for the guest. This could > cause problems with other callers (e.g, munmap on a memslot) trying to > unmap a

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

2017-03-15 Thread Christoffer Dall
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 VMAs when > we try to unmap each memslot for a VM. Fix this properly to > avoid unexpected results. > > Fixes: commit 957db105c997

Re: [PATCH 00/15] arm64/kvm: use common sysreg definitions

2017-03-15 Thread Christoffer Dall
On Fri, Mar 10, 2017 at 08:17:22AM +, Marc Zyngier wrote: > On Thu, Mar 09 2017 at 5:07:12 pm GMT, Mark Rutland > wrote: > > Currently we duplicate effort in maintaining system register encodings > > across > > arm64's , KVM's sysreg tables, and other places. This >