which phone cpu support the arm virtualization

2015-07-01 Thread young jams
Hi all I want to try kvm arm, but i cannot find a board which supports arm hardware-assist visualization. I knows there are some boards like arndale supports it, but i cannot get it. So i am wondering if there are some phones which uses qualcomm or nivida's cpu also supports it. thanksyoung

[PATCH v7 11/11] KVM: arm64: add trace points for guest_debug debug

2015-07-01 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 --- v3 - add trace event for debug access. - remove

[PATCH v7 02/11] KVM: arm64: guest debug, define API headers

2015-07-01 Thread Alex Bennée
This commit defines the API headers for guest debugging. There are two architecture specific debug structures: - kvm_guest_debug_arch, allows us to pass in HW debug registers - kvm_debug_exit_arch, signals exception and possible faulting address The type of debugging being used is controlled

[PATCH v7 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr

2015-07-01 Thread Alex Bennée
This introduces a level of indirection for the debug registers. Instead of using the sys_regs[] directly we store registers in a structure in the vcpu. The new kvm_arm_reset_debug_ptr() sets the debug ptr to the guest context. This also entails updating the sys_regs code to access this new structu

[PATCH v7 01/11] KVM: add comments for kvm_debug_exit_arch struct

2015-07-01 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 Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - add comments for other

[PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-01 Thread Alex Bennée
This adds support for userspace to control the HW debug registers for guest debug. In the debug ioctl we copy an IMPDEF registers into a new register set called host_debug_state. We use the recently introduced vcpu parameter debug_ptr to select which register set is copied into the real registers

[PATCH v7 05/11] KVM: arm64: guest debug, add SW break point support

2015-07-01 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 wil

[PATCH v7 06/11] KVM: arm64: guest debug, add support for single-step

2015-07-01 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 all

[PATCH v7 07/11] KVM: arm64: re-factor hyp.S debug register code

2015-07-01 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. It

[PATCH v7 04/11] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-07-01 Thread Alex Bennée
This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has been moved out of hyp.S and now uses the value kept in vcpu->arch.mdcr_el2. As the assembler used to previously mask and

[PATCH v7 10/11] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-07-01 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 Acked-by: Christoffer Dall --- v3: - separated capability check from previous patches - moved into arm64 s

[PATCH v7 00/11] KVM Guest Debug support for arm64

2015-07-01 Thread Alex Bennée
Here is V7 of the KVM Guest Debug support for arm64. The fixes are fairly minor aside from the re-factoring of sys_regs.c to have individual trap functions for each debug register. There is a lot of boiler plate but it does make the ugliness of the previous offset hacks go away. On top of that I'

[PATCH v7 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-07-01 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 . Reviewed-by: Christoffer Dall --- v2 - simplified form of the io

Re: [PATCH 05/10] KVM: arm/arm64: vgic: Relax vgic_can_sample_irq for edge IRQs

2015-07-01 Thread Marc Zyngier
On 01/07/15 12:58, Christoffer Dall wrote: > On Wed, Jul 01, 2015 at 10:17:52AM +0100, Marc Zyngier wrote: >> On 30/06/15 21:19, Christoffer Dall wrote: >>> On Mon, Jun 08, 2015 at 06:04:00PM +0100, Marc Zyngier wrote: We only set the irq_queued flag for level interrupts, meaning that "!v

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Steve Capper
On 1 July 2015 at 14:28, Catalin Marinas wrote: > On Wed, Jul 01, 2015 at 02:18:31PM +0100, Catalin Marinas wrote: >> On Wed, Jul 01, 2015 at 02:08:31PM +0200, Christoffer Dall wrote: >> > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c >> > index 2de9d2e..0eeb4f09 100644 >>

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

2015-07-01 Thread Christoffer Dall
On Wed, Jun 24, 2015 at 05:04:12PM -0700, Mario Smarduch wrote: > After enhancing arm64 FP/SIMD exit handling, ARMv7 VFP exit branch is moved > to guest trap handling. This allows us to keep exit handling flow between both > architectures consistent. > > Signed-off-by: Mario Smarduch > --- > arc

Re: [PATCH v3 1/2] arm64: KVM: Optimize arm64 skip 30-50% vfp/simd save/restore on exits

2015-07-01 Thread Christoffer Dall
On Wed, Jun 24, 2015 at 05:04:11PM -0700, Mario Smarduch wrote: > This patch only saves and restores FP/SIMD registers on Guest access. To do > this cptr_el2 FP/SIMD trap is set on Guest entry and later checked on exit. > lmbench, hackbench show significant improvements, for 30-50% exits FP/SIMD >

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Catalin Marinas
On Wed, Jul 01, 2015 at 02:18:31PM +0100, Catalin Marinas wrote: > On Wed, Jul 01, 2015 at 02:08:31PM +0200, Christoffer Dall wrote: > > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c > > index 2de9d2e..0eeb4f09 100644 > > --- a/arch/arm64/mm/hugetlbpage.c > > +++ b/arch/arm

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Catalin Marinas
On Wed, Jul 01, 2015 at 02:08:31PM +0200, Christoffer Dall wrote: > The current pmd_huge() and pud_huge() functions simply check if the table > bit is not set and reports the entries as huge in that case. This is > counter-intuitive as a clear pmd/pud cannot also be a huge pmd/pud, and > it is inc

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Marc Zyngier
On 01/07/15 13:08, Christoffer Dall wrote: > The current pmd_huge() and pud_huge() functions simply check if the table > bit is not set and reports the entries as huge in that case. This is > counter-intuitive as a clear pmd/pud cannot also be a huge pmd/pud, and > it is inconsistent with at least

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 01:24:34PM +0100, Steve Capper wrote: > On 1 July 2015 at 13:08, Christoffer Dall wrote: > > The current pmd_huge() and pud_huge() functions simply check if the table > > bit is not set and reports the entries as huge in that case. This is > > counter-intuitive as a clear

Re: [PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Steve Capper
On 1 July 2015 at 13:08, Christoffer Dall wrote: > The current pmd_huge() and pud_huge() functions simply check if the table > bit is not set and reports the entries as huge in that case. This is > counter-intuitive as a clear pmd/pud cannot also be a huge pmd/pud, and > it is inconsistent with a

[PATCH] arm64: Don't report clear pmds and puds as huge

2015-07-01 Thread Christoffer Dall
The current pmd_huge() and pud_huge() functions simply check if the table bit is not set and reports the entries as huge in that case. This is counter-intuitive as a clear pmd/pud cannot also be a huge pmd/pud, and it is inconsistent with at least arm and x86. To prevent others from making the sa

Re: [PATCH 05/10] KVM: arm/arm64: vgic: Relax vgic_can_sample_irq for edge IRQs

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 10:17:52AM +0100, Marc Zyngier wrote: > On 30/06/15 21:19, Christoffer Dall wrote: > > On Mon, Jun 08, 2015 at 06:04:00PM +0100, Marc Zyngier wrote: > >> We only set the irq_queued flag for level interrupts, meaning > >> that "!vgic_irq_is_queued(vcpu, irq)" is a good enough

Re: [PATCH 06/10] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 11:20:45AM +0100, Marc Zyngier wrote: > On 30/06/15 21:19, Christoffer Dall wrote: > > On Mon, Jun 08, 2015 at 06:04:01PM +0100, Marc Zyngier wrote: > >> In order to be able to feed physical interrupts to a guest, we need > >> to be able to establish the virtual-physical map

Re: [PATCH 2/2] arm/arm64: KVM: fix two build failured under STRICT_MM_TYPECHECKS

2015-07-01 Thread Marc Zyngier
On 30/06/15 18:03, Catalin Marinas wrote: > On Tue, Jun 30, 2015 at 06:04:50PM +0200, Ard Biesheuvel wrote: >> This fixes two instances where a pgprot_t is used as the operand >> of a bitwise & operation. In order to comply with STRICT_MM_TYPECHECKS, >> bitwise arithmetic on a pgprot_t should go vi

Re: [PATCH 06/10] KVM: arm/arm64: vgic: Allow dynamic mapping of physical/virtual interrupts

2015-07-01 Thread Marc Zyngier
On 30/06/15 21:19, Christoffer Dall wrote: > On Mon, Jun 08, 2015 at 06:04:01PM +0100, Marc Zyngier wrote: >> In order to be able to feed physical interrupts to a guest, we need >> to be able to establish the virtual-physical mapping between the two >> worlds. >> >> The mapping is kept in a rbtree,

Re: [PATCH v3 0/2] arm/arm64: KVM: Optimize arm64 fp/simd, saves 30-50% on exits

2015-07-01 Thread Christoffer Dall
On Wed, Jun 24, 2015 at 05:04:10PM -0700, Mario Smarduch wrote: > Currently we save/restore fp/simd on each exit. Fist patch optimizes arm64 > save/restore, we only do so on Guest access. hackbench and > several lmbench tests show anywhere from 30% to above 50% optimzation > achieved. > > In seco

Re: [PATCH 05/10] KVM: arm/arm64: vgic: Relax vgic_can_sample_irq for edge IRQs

2015-07-01 Thread Marc Zyngier
On 30/06/15 21:19, Christoffer Dall wrote: > On Mon, Jun 08, 2015 at 06:04:00PM +0100, Marc Zyngier wrote: >> We only set the irq_queued flag for level interrupts, meaning >> that "!vgic_irq_is_queued(vcpu, irq)" is a good enough predicate >> for all interrupts. >> >> This will allow us to inject e

Re: [PATCH v3 04/11] KVM: arm: common infrastructure for handling AArch32 CP14/CP15

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 03:09:35PM +0800, zichao wrote: > > > On June 30, 2015 3:43:34 AM GMT+08:00, Christoffer Dall > wrote: > >On Mon, Jun 22, 2015 at 06:41:27PM +0800, Zhichao Huang wrote: > >> As we're about to trap a bunch of CP14 registers, let's rework > >> the CP15 handling so it can b

Re: [PATCH v3 01/11] KVM: arm: plug guest debug exploit

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 03:04:00PM +0800, zichao wrote: > > > On June 29, 2015 11:49:53 PM GMT+08:00, Christoffer Dall > wrote: > >On Mon, Jun 22, 2015 at 06:41:24PM +0800, Zhichao Huang wrote: > >> Hardware debugging in guests is not intercepted currently, it means > >> that a malicious guest

Re: [PATCH 10/10] KVM: arm/arm64: vgic: Allow non-shared device HW interrupts

2015-07-01 Thread Christoffer Dall
On Wed, Jul 01, 2015 at 09:26:59AM +0100, Marc Zyngier wrote: > On 30/06/15 21:19, Christoffer Dall wrote: > > On Mon, Jun 08, 2015 at 06:04:05PM +0100, Marc Zyngier wrote: > >> So far, the only use of the HW interrupt facility is the timer, > >> implying that the active state is context-switched f

Re: [PATCH 10/10] KVM: arm/arm64: vgic: Allow non-shared device HW interrupts

2015-07-01 Thread Marc Zyngier
On 30/06/15 21:19, Christoffer Dall wrote: > On Mon, Jun 08, 2015 at 06:04:05PM +0100, Marc Zyngier wrote: >> So far, the only use of the HW interrupt facility is the timer, >> implying that the active state is context-switched for each vcpu, >> as the device is is shared across all vcpus. >> >> Th

Re: [PATCH v3 07/11] KVM: arm: add trap handlers for 64-bit debug registers

2015-07-01 Thread Zhichao Huang
On June 30, 2015 9:20:29 PM GMT+08:00, Christoffer Dall wrote: >On Mon, Jun 22, 2015 at 06:41:30PM +0800, Zhichao Huang wrote: >> Add handlers for all the 64-bit debug registers. >> >> There is an overlap between 32 and 64bit registers. Make sure that >> 64-bit registers preceding 32-bit ones.

Re: [PATCH v3 06/11] KVM: arm: add trap handlers for 32-bit debug registers

2015-07-01 Thread zichao
On June 30, 2015 5:16:41 AM GMT+08:00, Christoffer Dall wrote: >On Mon, Jun 22, 2015 at 06:41:29PM +0800, Zhichao Huang wrote: >> Add handlers for all the 32-bit debug registers. >> >> Signed-off-by: Zhichao Huang >> --- >> arch/arm/include/asm/kvm_asm.h | 12 >> arch/arm/include/asm/

Re: [PATCH v3 04/11] KVM: arm: common infrastructure for handling AArch32 CP14/CP15

2015-07-01 Thread zichao
On June 30, 2015 3:43:34 AM GMT+08:00, Christoffer Dall wrote: >On Mon, Jun 22, 2015 at 06:41:27PM +0800, Zhichao Huang wrote: >> As we're about to trap a bunch of CP14 registers, let's rework >> the CP15 handling so it can be generalized and work with multiple >> tables. >> >> Signed-off-by:

Re: [PATCH v3 01/11] KVM: arm: plug guest debug exploit

2015-07-01 Thread zichao
On June 29, 2015 11:49:53 PM GMT+08:00, Christoffer Dall wrote: >On Mon, Jun 22, 2015 at 06:41:24PM +0800, Zhichao Huang wrote: >> Hardware debugging in guests is not intercepted currently, it means >> that a malicious guest can bring down the entire machine by writing >> to the debug registers