Re: [PATCH] KVM: arm/arm64: fix unaligned hva start and end in handle_hva_to_gpa

2018-05-15 Thread Suzuki K Poulose
Hi Jia On 05/15/2018 03:03 AM, Jia He wrote: Hi Suzuki I will merge the other thread into this, and add the necessary CC list That WARN_ON call trace is very easy to reproduce in my armv8a server after I start 20 guests and run memhog in the host. Of course, ksm should be enabled For you

Re: [PATCH 0/4] KVM: arm/arm64: Fix locking issues

2018-05-15 Thread Christoffer Dall
On Fri, May 11, 2018 at 03:20:11PM +0100, Andre Przywara wrote: > Jan recently reported lockdep complaints regarding various locks in our > VGIC emulation [1][2]. > This boiled down to two separate issues: > - When promoting the vgic_irq->irq_lock to require IRQs being disabled, > we forgot to am

Re: [PATCH v7 14/16] KVM: arm64: Remove redundant *exit_code changes in fpsimd_guest_exit()

2018-05-15 Thread Christoffer Dall
On Wed, May 09, 2018 at 05:13:03PM +0100, Dave Martin wrote: > In fixup_guest_exit(), there are a couple of cases where after > checking what the exit code was, we assign it explicitly with the > value it already had. > > Assuming this is not indicative of a bug, these assignments are not > needed

Re: [PATCH v7 07/16] KVM: arm64: Repurpose vcpu_arch.debug_flags for general-purpose flags

2018-05-15 Thread Christoffer Dall
On Wed, May 09, 2018 at 05:12:56PM +0100, Dave Martin wrote: > In struct vcpu_arch, the debug_flags field is used to store > debug-related flags about the vcpu state. > > Since we are about to add some more flags related to FPSIMD and > SVE, it makes sense to add them to the existing flags field r

Re: [PATCH v7 08/16] KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing

2018-05-15 Thread Christoffer Dall
On Wed, May 09, 2018 at 05:12:57PM +0100, Dave Martin wrote: > This patch refactors KVM to align the host and guest FPSIMD > save/restore logic with each other for arm64. This reduces the > number of redundant save/restore operations that must occur, and > reduces the common-case IRQ blackout time

Re: [PATCH v7 16/16] KVM: arm64: Invoke FPSIMD context switch trap from C

2018-05-15 Thread Christoffer Dall
On Wed, May 09, 2018 at 05:13:05PM +0100, Dave Martin wrote: > The conversion of the FPSIMD context switch trap code to C has added > some overhead to calling it, due to the need to save registers that > the procedure call standard defines as caller-saved. > > So, perhaps it is no longer worth inv

Re: [PATCH 0/4] KVM: arm/arm64: Fix locking issues

2018-05-15 Thread Paolo Bonzini
On 15/05/2018 12:26, Christoffer Dall wrote: > On Fri, May 11, 2018 at 03:20:11PM +0100, Andre Przywara wrote: >> Jan recently reported lockdep complaints regarding various locks in our >> VGIC emulation [1][2]. >> This boiled down to two separate issues: >> - When promoting the vgic_irq->irq_lock

Re: Potential deadlock in vgic

2018-05-15 Thread Jan Glauber
On Fri, May 11, 2018 at 03:29:43PM +0100, Andre Przywara wrote: > Hi Jan, > > On 04/05/18 17:31, Jan Glauber wrote: > > On Fri, May 04, 2018 at 04:17:40PM +0100, Andre Przywara wrote: > >> Hi Jan, > >> > >> can you please test this patch with your setup, to see if it still > >> screams? That conve

Re: [PATCH 0/4] KVM: arm/arm64: Fix locking issues

2018-05-15 Thread Marc Zyngier
On 15/05/18 12:35, Paolo Bonzini wrote: > On 15/05/2018 12:26, Christoffer Dall wrote: >> On Fri, May 11, 2018 at 03:20:11PM +0100, Andre Przywara wrote: >>> Jan recently reported lockdep complaints regarding various locks in our >>> VGIC emulation [1][2]. >>> This boiled down to two separate issue

Re: [PATCH 0/4] KVM: arm/arm64: Fix locking issues

2018-05-15 Thread Paolo Bonzini
On 15/05/2018 13:54, Marc Zyngier wrote: > On 15/05/18 12:35, Paolo Bonzini wrote: >> On 15/05/2018 12:26, Christoffer Dall wrote: >>> On Fri, May 11, 2018 at 03:20:11PM +0100, Andre Przywara wrote: Jan recently reported lockdep complaints regarding various locks in our VGIC emulation [1]

Re: [PATCH] KVM: arm/arm64: fix unaligned hva start and end in handle_hva_to_gpa

2018-05-15 Thread Jia He
Hi Suzuki On 5/15/2018 4:36 PM, Suzuki K Poulose Wrote: > > Hi Jia > > On 05/15/2018 03:03 AM, Jia He wrote: >> Hi Suzuki >> >> I will merge the other thread into this, and add the necessary CC list >> >> That WARN_ON call trace is very easy to reproduce in my armv8a server after I >> start 20 g

Re: [PATCH v7 08/16] KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing

2018-05-15 Thread Dave Martin
On Tue, May 15, 2018 at 12:55:23PM +0200, Christoffer Dall wrote: > On Wed, May 09, 2018 at 05:12:57PM +0100, Dave Martin wrote: > > This patch refactors KVM to align the host and guest FPSIMD > > save/restore logic with each other for arm64. This reduces the > > number of redundant save/restore o

[PATCH v12 1/4] arm64: KVM: export the capability to set guest SError syndrome

2018-05-15 Thread Dongjiu Geng
For the arm64 RAS Extension, user space can inject a virtual-SError with specified ESR. So user space needs to know whether KVM support to inject such SError, this interface adds this query for this capability. KVM will check whether system support RAS Extension, if supported, KVM returns true to

[PATCH v12 2/4] arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS

2018-05-15 Thread Dongjiu Geng
For the migrating VMs, user space may need to know the exception state. For example, in the machine A, KVM make an SError pending, when migrate to B, KVM also needs to pend an SError. This new IOCTL exports user-invisible states related to SError. Together with appropriate user space changes, user

[PATCH v12 0/4] set VSESR_EL2 by user space and support NOTIFY_SEI notification

2018-05-15 Thread Dongjiu Geng
1. Detect whether KVM can set set guest SError syndrome 2. Support to Set VSESR_EL2 and inject SError by user space. 3. Support live migration to keep SError pending state and VSESR_EL2 value. 4. ACPI 6.1 adds support for NOTIFY_SEI as a GHES notification mechanism, so support this notification

[PATCH v12 4/4] arm64: handle NOTIFY_SEI notification by the APEI driver

2018-05-15 Thread Dongjiu Geng
Add a helper to handle the NOTIFY_SEI notification, when kernel gets the NOTIFY_SEI notification, call this helper and let APEI driver to handle this notification. Signed-off-by: Dongjiu Geng --- arch/arm64/include/asm/system_misc.h | 1 + arch/arm64/kernel/traps.c| 4 arch/ar

[PATCH v12 3/4] ACPI / APEI: Add SEI notification type support for ARMv8

2018-05-15 Thread Dongjiu Geng
ACPI 6.x adds support for NOTIFY_SEI as a GHES notification mechanism, so add new GHES notification handling functions. Expose API ghes_notify_sei() to arch code, arch code will call this API when it gets this NOTIFY_SEI. Signed-off-by: Dongjiu Geng Note: Firmware will follow the SError mask rul

Re: [PATCH] KVM: arm/arm64: fix unaligned hva start and end in handle_hva_to_gpa

2018-05-15 Thread Jia He
On 5/15/2018 8:38 PM, Jia He Wrote: > Hi Suzuki > > On 5/15/2018 4:36 PM, Suzuki K Poulose Wrote: >> >> Hi Jia >> >> On 05/15/2018 03:03 AM, Jia He wrote: >>> Hi Suzuki >>> >>> I will merge the other thread into this, and add the necessary CC list >>> >>> That WARN_ON call trace is very easy to

Re: [PATCH] KVM: arm/arm64: fix unaligned hva start and end in handle_hva_to_gpa

2018-05-15 Thread Suzuki K Poulose
Hi Jia, On 15/05/18 14:15, Jia He wrote: On 5/15/2018 8:38 PM, Jia He Wrote: Hi Suzuki On 5/15/2018 4:36 PM, Suzuki K Poulose Wrote: Hi Jia On 05/15/2018 03:03 AM, Jia He wrote: Hi Suzuki I will merge the other thread into this, and add the necessary CC list That WARN_ON call trace is

Re: [PATCH v2 4/4] KVM: arm64: Add support for PUD hugepages at stage 2

2018-05-15 Thread Catalin Marinas
On Tue, May 01, 2018 at 11:26:59AM +0100, Punit Agrawal wrote: > KVM currently supports PMD hugepages at stage 2. Extend the stage 2 > fault handling to add support for PUD hugepages. > > Addition of pud hugepage support enables additional hugepage > sizes (e.g., 1G with 4K granule) which can be u

Re: [PATCH v2 4/4] KVM: arm64: Add support for PUD hugepages at stage 2

2018-05-15 Thread Punit Agrawal
Catalin Marinas writes: > On Tue, May 01, 2018 at 11:26:59AM +0100, Punit Agrawal wrote: >> KVM currently supports PMD hugepages at stage 2. Extend the stage 2 >> fault handling to add support for PUD hugepages. >> >> Addition of pud hugepage support enables additional hugepage >> sizes (e.g., 1

Re: [PATCH v3 4/4] KVM: arm64: Add support for PUD hugepages at stage 2

2018-05-15 Thread Catalin Marinas
On Mon, May 14, 2018 at 03:43:04PM +0100, Punit Agrawal wrote: > KVM only supports PMD hugepages at stage 2. Extend the stage 2 fault > handling to add support for PUD hugepages. > > Addition of pud hugepage support enables additional hugepage > sizes (e.g., 1G with 4K granule) which can be useful

Re: [PATCH v3 4/4] KVM: arm64: Add support for PUD hugepages at stage 2

2018-05-15 Thread Suzuki K Poulose
On 05/14/2018 03:43 PM, Punit Agrawal wrote: KVM only supports PMD hugepages at stage 2. Extend the stage 2 fault handling to add support for PUD hugepages. Addition of pud hugepage support enables additional hugepage sizes (e.g., 1G with 4K granule) which can be useful on cores that support map

Re: [PATCH] KVM: arm/arm64: fix unaligned hva start and end in handle_hva_to_gpa

2018-05-15 Thread Jia He
On 5/16/2018 12:21 AM, Suzuki K Poulose Wrote: > Hi Jia, > > On 15/05/18 14:15, Jia He wrote: >> >> >> On 5/15/2018 8:38 PM, Jia He Wrote: >>> Hi Suzuki >>> >>> On 5/15/2018 4:36 PM, Suzuki K Poulose Wrote: Hi Jia On 05/15/2018 03:03 AM, Jia He wrote: > Hi Suzuki > >>