Re: [PATCH v2 14/17] kvm: arm64: Switch to per VM IPA limit

2018-04-13 Thread Punit Agrawal
Hi Suzuki, I haven't had a chance to look at the code but noticed one issue below. Suzuki K Poulose writes: > Now that we can manage the stage2 page table per VM, switch the > configuration details to per VM instance. We keep track of the > IPA bits, number of page table levels and the VTCR bit

Re: [PATCH v9 3/7] acpi: apei: Add SEI notification type support for ARMv8

2018-04-13 Thread gengdongjiu
James, Thanks for this mail. On 2018/4/13 0:14, James Morse wrote: > Hi gengdongjiu, > > On 12/04/18 06:00, gengdongjiu wrote: >> 2018-02-16 1:55 GMT+08:00 James Morse : >>> On 05/02/18 11:24, gengdongjiu wrote: > Is the emulated SError routed following the routing rules for > HCR_EL2

Re: [PATCH v2 12/17] kvm: arm/arm64: Expose supported physical address limit for VM

2018-04-13 Thread Peter Maydell
On 27 March 2018 at 14:15, Suzuki K Poulose wrote: > Expose the maximum physical address size supported by the host > for a VM. This could be later used by the userspace to choose the > appropriate size for a given VM. The limit is determined as the > minimum of actual CPU limit, the kernel limit

Re: [PATCH v3 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION

2018-04-13 Thread Peter Maydell
On 13 April 2018 at 09:20, Eric Auger wrote: > We introduce a new KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attribute in > KVM_DEV_ARM_VGIC_GRP_ADDR group. It allows userspace to provide the > base address and size of a redistributor region > > Compared to KVM_VGIC_V3_ADDR_TYPE_REDIST, this new attribut

[PATCH v3 12/12] KVM: arm/arm64: Bump VGIC_V3_MAX_CPUS to 512

2018-04-13 Thread Eric Auger
Let's raise the number of supported vcpus along with vgic v3 now that HW is looming with more physical CPUs. Signed-off-by: Eric Auger --- include/kvm/arm_vgic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index e5c16d1..a9a

[PATCH v3 09/12] KVM: arm/arm64: Check all vcpu redistributors are set on map_resources

2018-04-13 Thread Eric Auger
On vcpu first run, we eventually know the actual number of vcpus. This is a synchronization point to check all redistributors regions were assigned. On kvm_vgic_map_resources() we check both dist and redist were set, eventually check potential base address inconsistencies. Signed-off-by: Eric Auge

[PATCH v3 11/12] KVM: arm/arm64: Implement KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION

2018-04-13 Thread Eric Auger
Now all the internals are ready to handle multiple redistributor regions, let's allow the userspace to register them. Signed-off-by: Eric Auger --- v2 -> v3: - early exit if vgic_v3_rdist_region_from_index() fails --- virt/kvm/arm/vgic/vgic-kvm-device.c | 42 +++

[PATCH v3 10/12] KVM: arm/arm64: Add KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION

2018-04-13 Thread Eric Auger
This new attribute allows the userspace to set the base address of a reditributor region, relaxing the constraint of having all consecutive redistibutor frames contiguous. Signed-off-by: Eric Auger --- arch/arm/include/uapi/asm/kvm.h | 7 --- arch/arm64/include/uapi/asm/kvm.h | 7 ---

[PATCH v3 08/12] KVM: arm/arm64: Check vcpu redist base before registering an iodev

2018-04-13 Thread Eric Auger
As we are going to register several redist regions, vgic_register_all_redist_iodevs() may be called several times. We need to register a redist_iodev for a given vcpu only once. So let's check if the base address has already been set. Initialize this latter in kvm_vgic_vcpu_early_init(). Signed-of

[PATCH v3 07/12] KVM: arm/arm64: Adapt vgic_v3_check_base to multiple rdist regions

2018-04-13 Thread Eric Auger
We introduce a new helper to check there is no overlap between dist region (if set) and registered rdist regions. This both handles the case of legacy single rdist region (implicitly sized with the number of online vcpus) and the new case of multiple explicitly sized rdist regions. Signed-off-by:

[PATCH v3 06/12] KVM: arm/arm64: Helper to register a new redistributor region

2018-04-13 Thread Eric Auger
We introduce a new helper that creates and inserts a new redistributor region into the rdist region list. This helper both handles the case where the redistributor region size is known at registration time and the legacy case where it is not (eventually depending on the number of online vcpus). Dep

[PATCH v3 04/12] KVM: arm/arm64: Helper to locate free rdist index

2018-04-13 Thread Eric Auger
We introduce vgic_v3_rdist_free_slot to help identifying where we can place a new 2x64KB redistributor. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic/vgic-mmio-v3.c | 3 +-- virt/kvm/arm/vgic/vgic-v3.c | 17 + virt/kvm/arm/vgic/vgic.h | 11 +++ 3 files cha

[PATCH v3 05/12] KVM: arm/arm64: Revisit Redistributor TYPER last bit computation

2018-04-13 Thread Eric Auger
The TYPER of an redistributor reflects whether the rdist is the last one of the redistributor region. Let's compare the TYPER GPA against the address of the last occupied slot within the redistributor region. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic/vgic-mmio-v3.c | 7 ++- 1 file chan

[PATCH v3 03/12] KVM: arm/arm64: Replace the single rdist region by a list

2018-04-13 Thread Eric Auger
At the moment KVM supports a single rdist region. We want to support several separate rdist regions so let's introduce a list of them. This patch currently only cares about a single entry in this list as the functionality to register several redist regions is not yet there. So this only translates

[PATCH v3 00/12] KVM: arm/arm64: Allow multiple GICv3 redistributor regions

2018-04-13 Thread Eric Auger
At the moment the KVM VGICv3 only supports a single redistributor region (whose base address is set through the GICv3 kvm device KVM_DEV_ARM_VGIC_GRP_ADDR/KVM_VGIC_V3_ADDR_TYPE_REDIST). There, all the redistributors are laid out contiguously. The size of this single redistributor region is not set

[PATCH v3 02/12] KVM: arm/arm64: Document KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION

2018-04-13 Thread Eric Auger
We introduce a new KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attribute in KVM_DEV_ARM_VGIC_GRP_ADDR group. It allows userspace to provide the base address and size of a redistributor region Compared to KVM_VGIC_V3_ADDR_TYPE_REDIST, this new attribute allows to declare several separate redistributor regi

[PATCH v3 01/12] KVM: arm/arm64: Set dist->spis to NULL after kfree

2018-04-13 Thread Eric Auger
in case kvm_vgic_map_resources() fails, typically if the vgic distributor is not defined, __kvm_vgic_destroy will be called several times. Indeed kvm_vgic_map_resources() is called on first vcpu run. As a result dist->spis is freeed more than once and on the second time it causes a "kernel BUG at m