Re: [PATCH] arm64/kvm: Add generic v8 KVM target

2015-06-19 Thread Timur Tabi
On 06/17/2015 04:00 AM, Suzuki K. Poulose wrote: genericv8_target_table); kvm_register_target_sys_reg_table(KVM_ARM_TARGET_XGENE_POTENZA, genericv8_target_table); +

Re: [PATCH v2 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64

2015-06-19 Thread Marc Zyngier
On 19/06/15 00:49, Mario Smarduch wrote: On 06/18/2015 10:27 AM, Marc Zyngier wrote: On 16/06/15 22:50, Mario Smarduch wrote: After enhancing arm64 FP/SIMD exit handling, FP/SIMD exit branch is moved to guest trap handling. This keeps exiting handling flow between both architectures

[PATCH v6 11/12] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-06-19 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v3: - separated capability

[PATCH 12/12] KVM: arm/arm64: vgic: Remove useless arm-gic.h #include

2015-06-19 Thread Marc Zyngier
Back in the days, vgic.c used to have an intimate knowledge of the actual GICv2. These days, this has been abstracted away into hardware-specific backends. Remove the now useless arm-gic.h #include directive, making it clear that GICv2 specific code doesn't belong here. Signed-off-by: Marc

[PATCH 08/12] ARM: kvm: psci: fix handling of unimplemented functions

2015-06-19 Thread Marc Zyngier
From: Lorenzo Pieralisi lorenzo.pieral...@arm.com According to the PSCI specification and the SMC/HVC calling convention, PSCI function_ids that are not implemented must return NOT_SUPPORTED as return value. Current KVM implementation takes an unhandled PSCI function_id as an error and injects

[PATCH 07/12] KVM: arm64: fix misleading comments in save/restore

2015-06-19 Thread Marc Zyngier
From: Alex Bennée alex.ben...@linaro.org The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into EL2. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée alex.ben...@linaro.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com

[PATCH 01/12] ARM: KVM: Remove pointless void pointer cast

2015-06-19 Thread Marc Zyngier
From: Firo Yang fir...@gmail.com No need to cast the void pointer returned by kmalloc() in arch/arm/kvm/mmu.c::kvm_alloc_stage2_pgd(). Signed-off-by: Firo Yang fir...@gmail.com Acked-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- arch/arm/kvm/mmu.c |

[PATCH v6 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-06-19 Thread Alex Bennée
This adds support for userspace to control the HW debug registers for guest debug. In the debug ioctl we copy the IMPDEF defined number of registers into a new register set called host_debug_state. There is now a new vcpu parameter called debug_ptr which selects which register set is to copied

[PATCH 03/12] arm: KVM: force execution of HCPTR access on VM exit

2015-06-19 Thread Marc Zyngier
On VM entry, we disable access to the VFP registers in order to perform a lazy save/restore of these registers. On VM exit, we restore access, test if we did enable them before, and save/restore the guest/host registers if necessary. In this sequence, the FPEXC register is always accessed,

[PULL] KVM/ARM changes for 4.2

2015-06-19 Thread Marc Zyngier
Paolo, Marcelo, Gleb, This is the KVM/ARM pull request for 4.2. Not much this time, as what we had planned for this merge window is taking longer that expected. 4.3 should be a lot more significant. Thanks, M. The following changes since commit 3520469d65f26a1cd2f610f5d5de976f78db74fe:

[PATCH v6 12/12] KVM: arm64: add trace points for guest_debug debug

2015-06-19 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - add trace event for

[PATCH 09/12] KVM: arm: vgic: Drop useless Group0 warning

2015-06-19 Thread Marc Zyngier
If a GICv3-enabled guest tries to configure Group0, we print a warning on the console (because we don't support Group0 interrupts). This is fairly pointless, and would allow a guest to spam the console. Let's just drop the warning. Acked-by: Christoffer Dall christoffer.d...@linaro.org

[PATCH 10/12] arm/arm64: KVM: vgic: Do not save GICH_HCR / ICH_HCR_EL2

2015-06-19 Thread Marc Zyngier
The GIC Hypervisor Configuration Register is used to enable the delivery of virtual interupts to a guest, as well as to define in which conditions maintenance interrupts are delivered to the host. This register doesn't contain any information that we need to read back (the EOIcount is utterly

[PATCH 11/12] KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers

2015-06-19 Thread Marc Zyngier
Commit fd1d0ddf2ae9 (KVM: arm/arm64: check IRQ number on userland injection) rightly limited the range of interrupts userspace can inject in a guest, but failed to consider the (unlikely) case where a guest is configured with 1024 interrupts. In this case, interrupts ranging from 1020 to 1023 are

[PATCH 04/12] kvm: remove one useless check extension

2015-06-19 Thread Marc Zyngier
From: Tiejun Chen tiejun.c...@intel.com We already check KVM_CAP_IRQFD in generic once enable CONFIG_HAVE_KVM_IRQFD, kvm_vm_ioctl_check_extension_generic() | + switch (arg) { + ... + #ifdef CONFIG_HAVE_KVM_IRQFD + case KVM_CAP_IRQFD: + #endif + ... +

[PATCH v6 07/12] KVM: arm64: guest debug, add support for single-step

2015-06-19 Thread Alex Bennée
This adds support for single-stepping the guest. To do this we need to manipulate the guests PSTATE.SS and MDSCR_EL1.SS bits to trigger stepping. We take care to preserve MDSCR_EL1 and trap access to it to ensure we don't affect the apparent state of the guest. As we have to enable trapping of

[PATCH v6 08/12] KVM: arm64: re-factor hyp.S debug register code

2015-06-19 Thread Alex Bennée
This is a pre-cursor to sharing the code with the guest debug support. This replaces the big macro that fishes data out of a fixed location with a more general helper macro to restore a set of debug registers. It uses macro substitution so it can be re-used for debug control and value registers.

[PATCH v6 01/12] KVM: add comments for kvm_debug_exit_arch struct

2015-06-19 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

[PATCH v6 06/12] KVM: arm64: guest debug, add SW break point support

2015-06-19 Thread Alex Bennée
This adds support for SW breakpoints inserted by userspace. We do this by trapping all guest software debug exceptions to the hypervisor (MDCR_EL2.TDE). The exit handler sets an exit reason of KVM_EXIT_DEBUG with the kvm_debug_exit_arch structure holding the exception syndrome information. It

[PATCH v6 02/12] KVM: arm64: fix misleading comments in save/restore

2015-06-19 Thread Alex Bennée
The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into the hypervisor code. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- arch/arm64/kvm/hyp.S | 8 1 file changed, 4 insertions(+), 4

[PATCH v6 04/12] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-06-19 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée alex.ben...@linaro.org. Reviewed-by: Christoffer Dall

[PATCH v6 00/12] KVM Guest Debug support for arm64

2015-06-19 Thread Alex Bennée
Here is V6 of the KVM Guest Debug support for arm64. The changes are even more minimal than the last round which is hopefully a good indication the series is ready for merging: API/ABI Changes: - returned to using u64 for control registers - renamed

Re: [PATCH] kvmtool: Makefile: allow overriding CC and LD

2015-06-19 Thread Andre Przywara
Hi Michael, On 19/06/15 02:14, Michael Ellerman wrote: On Thu, 2015-06-18 at 16:50 +0100, Andre Przywara wrote: Currently we set CC unconditionally to ${CROSS_COMPILE}gcc, the same for LD. Allow people to override the compiler name by specifying it explicitly on the command line or via the

Re: [PATCH] kvmtool: Makefile: allow overriding CC and LD

2015-06-19 Thread Andre Przywara
Hi Paolo, On 19/06/15 10:59, Paolo Bonzini wrote: On 18/06/2015 17:50, Andre Przywara wrote: Currently we set CC unconditionally to ${CROSS_COMPILE}gcc, the same for LD. Allow people to override the compiler name by specifying it explicitly on the command line or via the environment.

Re: [PATCH] kvmtool: Makefile: allow overriding CC and LD

2015-06-19 Thread Paolo Bonzini
On 18/06/2015 17:50, Andre Przywara wrote: Currently we set CC unconditionally to ${CROSS_COMPILE}gcc, the same for LD. Allow people to override the compiler name by specifying it explicitly on the command line or via the environment. Beside calling a certain compiler binary this allows to

Re: [PATCH] kvmtool: Makefile: allow overriding CC and LD

2015-06-19 Thread Michael Ellerman
On Thu, 2015-06-18 at 16:50 +0100, Andre Przywara wrote: Currently we set CC unconditionally to ${CROSS_COMPILE}gcc, the same for LD. Allow people to override the compiler name by specifying it explicitly on the command line or via the environment. Beside calling a certain compiler binary

Re: [PULL] KVM/ARM changes for 4.2

2015-06-19 Thread Paolo Bonzini
On 19/06/2015 14:53, Marc Zyngier wrote: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.2 for you to fetch changes up to c62e631d4a8e41493c6341d8259e996ed5fc11e3: KVM: arm/arm64: vgic: Remove useless arm-gic.h #include (2015-06-18 15:50:31