Re: [kvmarm] [PATCH v10 06/14] KVM: ARM: Hypervisor inititalization

2012-08-24 Thread Marc Zyngier
On Fri, 24 Aug 2012 16:04:02 +0800, Lei Wen wrote: > On Thu, Aug 23, 2012 at 11:27 PM, Christoffer Dall > wrote: >> On Thu, Aug 23, 2012 at 11:08 AM, Lei Wen wrote: >>> Hi Christoffer, >>> >>> [snip] >>> diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 1dc8926..4db26cb 1006

Re: [Android-virt] [PATCH v5 05/13] ARM: KVM: Inject IRQs and FIQs from userspace

2011-12-12 Thread Marc Zyngier
On 11/12/11 20:07, Christoffer Dall wrote: > On Dec 11, 2011, at 2:48 PM, Peter Maydell wrote: > >> On 11 December 2011 19:30, Christoffer Dall >> wrote: >>> On Sun, Dec 11, 2011 at 11:03 AM, Peter Maydell >>> wrote: Removing the mask would be wrong since the irq field here is encodin

Re: [PATCH v5 12/13] ARM: KVM: Fix guest view of MPIDR

2011-12-12 Thread Marc Zyngier
On 12/12/11 17:39, Christoffer Dall wrote: > On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity wrote: >> On 12/11/2011 12:25 PM, Christoffer Dall wrote: >>> From: Marc Zyngier >>> >>> A guest may need to know which CPU it has booted on (and Linux does). >>>

Re: [Android-virt] [PATCH v5 08/13] ARM: KVM: Handle guest faults in KVM

2011-12-13 Thread Marc Zyngier
On 13/12/11 13:10, Christoffer Dall wrote: > On Tue, Dec 13, 2011 at 4:45 AM, Avi Kivity wrote: >> On 12/12/2011 09:53 PM, Christoffer Dall wrote: >>> - as far as I >>> know it's not common to have swap space on ARM architectures, but I >>> could be wrong. >> >> It will become common once you sta

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-13 Thread Marc Zyngier
On 13/12/11 13:36, Christoffer Dall wrote: > On Tue, Dec 13, 2011 at 4:37 AM, Avi Kivity wrote: >> if (new_virt_intr == IRQ | FIQ && virt_intr == FIQ) { >> /* IRQ raised, FIQ already set */ >> return; >> } >> > > hmm, so what you want to avoid here is sending an IPI to the other CPU >

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 14:57, Christoffer Dall wrote: > On Mon, Dec 19, 2011 at 1:15 AM, Antonios Motakis > wrote: >> On 12/11/2011 11:25 AM, Christoffer Dall wrote: >>> WARNING: This code is in development and guests do not fully boot on SMP >>> hosts yet. >> Hello, >> >> What would still be needed to fully

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:30, Antonios Motakis wrote: > On 12/19/2011 04:19 PM, Marc Zyngier wrote: >> On 19/12/11 14:57, Christoffer Dall wrote: >>> >>> >>> You should simply start booting a UP guest on an SMP host, see where >>> it crashes and start tracking it

Re: [Android-virt] [PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:42, Antonios Motakis wrote: > On 12/19/2011 04:40 PM, Christoffer Dall wrote: >> On Mon, Dec 19, 2011 at 10:37 AM, Marc Zyngier wrote: >>> On 19/12/11 15:30, Antonios Motakis wrote: >>>> On 12/19/2011 04:19 PM, Marc Zyngier wrote: >>>>&

Re: [Android-virt] [PATCH v5 00/13] KVM/ARM Implementation

2012-02-01 Thread Marc Zyngier
On 30/01/12 22:46, Peter Maydell wrote: > On 20 January 2012 02:59, Christoffer Dall > wrote: >> There's a new list of issues available at: >> >> https://github.com/virtualopensystems/linux-kvm-arm/issues > > Thanks for putting this up. Here's a couple more for you :-) > > * Support guest kerne

Re: [Android-virt] [PATCH v5 00/13] KVM/ARM Implementation

2012-02-01 Thread Marc Zyngier
On 01/02/12 12:20, Peter Maydell wrote: > On 1 February 2012 12:11, Marc Zyngier wrote: >> The obvious fix would be to test for the virt extensions in ID_PFR1 >> before enabling KVM, and mask out the virt extensions from the same >> register in the guest by trapping CP15-

[PATCH RFC 2/2] ARM: KVM: Add support for MMU notifiers

2012-02-09 Thread Marc Zyngier
ff-by: Marc Zyngier --- arch/arm/include/asm/kvm_asm.h |4 arch/arm/include/asm/kvm_host.h | 19 +++ arch/arm/kvm/Kconfig|3 ++- arch/arm/kvm/arm.c |4 ++-- arch/arm/kvm/interrupts.S | 23 +++ arch/arm/kvm/

[PATCH RFC 1/2] KVM: Guard mmu_notifier specific code with CONFIG_MMU_NOTIFIER

2012-02-09 Thread Marc Zyngier
In order to avoid compilation failure when KVM is not compiled in, guard the mmu_notifier specific sections with both CONFIG_MMU_NOTIFIER and KVM_ARCH_WANT_MMU_NOTIFIER, like it is being done in the rest of the KVM code. Signed-off-by: Marc Zyngier --- include/linux/kvm_host.h |4 ++-- 1

[PATCH RFC v2 1/3] KVM: Guard mmu_notifier specific code with CONFIG_MMU_NOTIFIER

2012-02-10 Thread Marc Zyngier
In order to avoid compilation failure when KVM is not compiled in, guard the mmu_notifier specific sections with both CONFIG_MMU_NOTIFIER and KVM_ARCH_WANT_MMU_NOTIFIER, like it is being done in the rest of the KVM code. Signed-off-by: Marc Zyngier --- include/linux/kvm_host.h |4 ++-- 1

[PATCH RFC v2 2/3] ARM: KVM: mark the end of the HYP mode code with __kvm_hyp_code_end

2012-02-10 Thread Marc Zyngier
Use __kvm_hyp_code_end to mark the end of the main HYP code instead of __kvm_vcpu_run_end. It's a bit cleaner as we're about to add more code to that section. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_asm.h |3 ++- arch/arm/kvm/arm.c |4 ++-- ar

[PATCH RFC v2 3/3] ARM: KVM: Add support for MMU notifiers

2012-02-10 Thread Marc Zyngier
ff-by: Marc Zyngier --- The aging ops are left unused for the moment, until I actually understand what they are used for and whether they apply to the ARM architecture. >From v1: - Fixed the brown paper bug of invalidating the hva instead of the ipa arch/arm/include/asm/kvm_asm.h |2 +

Re: [Android-virt] [PATCH RFC v2 3/3] ARM: KVM: Add support for MMU notifiers

2012-02-13 Thread Marc Zyngier
On 12/02/12 01:12, Christoffer Dall wrote: > On Sat, Feb 11, 2012 at 10:33 AM, Antonios Motakis > wrote: >> On 02/11/2012 06:35 PM, Christoffer Dall wrote: >>> >>> On Sat, Feb 11, 2012 at 7:00 AM, Antonios Motakis >>> wrote: >>>&

Re: [Android-virt] [PATCH v7 10/12] ARM: KVM: Handle guest faults in KVM

2012-03-12 Thread Marc Zyngier
On 12/03/12 06:52, Christoffer Dall wrote: > From: Christoffer Dall > > Handles the guest faults in KVM by mapping in corresponding user pages > in the 2nd stage page tables. > > Introduces new ARM-specific kernel memory types, PAGE_KVM_GUEST and > pgprot_guest variables used to map 2nd stage me

Re: [Android-virt] [PATCH v7 10/12] ARM: KVM: Handle guest faults in KVM

2012-03-12 Thread Marc Zyngier
On 12/03/12 16:23, Christoffer Dall wrote: > On Mon, Mar 12, 2012 at 11:31 AM, Marc Zyngier wrote: >> On 12/03/12 06:52, Christoffer Dall wrote: >>> From: Christoffer Dall >>> >>> Handles the guest faults in KVM by mapping in corresponding user pa

[RFC] KVM/arm64, take #4

2013-02-07 Thread Marc Zyngier
Guys, I've once more updated the branches for KVM/arm64 - kvm-arm/pre-arm64: KVM/ARM stable branches + the "cleanup" branch + some basic perf support - kvm-arm/vgic-fixes: as the name says, a couple of pending VGIC related fixes. - arm64/soc-armv8-model: Catalin Marinas' arm64 branch - kvm-arm

[PATCH 3.9-rc1 0/3] KVM/ARM core fixes for 3.9-rc1

2013-02-15 Thread Marc Zyngier
Here's a number of patches to cope with the churn that occured in kvm-next, and breaks the compilation in next-20130215. No big deal, just regular breakage... Tested on TC2. Marc Zyngier (3): ARM: KVM: fix kvm_arch_{prepare,commit}_memory_region ARM: KVM: Rename KVM_MEMORY_

[PATCH 3.9-rc1 3/3] ARM: KVM: fix compilation after removal of user_alloc from struct kvm_memory_slot

2013-02-15 Thread Marc Zyngier
morse. Signed-off-by: Marc Zyngier --- arch/arm/kvm/mmu.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index f30e131..99e07c7 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -633,11 +633,6 @@ int kvm_handle_guest_abort(struct kvm_vcpu

[PATCH 3.9-rc1 2/3] ARM: KVM: Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS

2013-02-15 Thread Marc Zyngier
Commit bbacc0c (KVM: Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS) broke KVM/ARM by changing a global #define. Apply the same change to fix the compilation breakage. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[PATCH 3.9-rc1 1/3] ARM: KVM: fix kvm_arch_{prepare,commit}_memory_region

2013-02-15 Thread Marc Zyngier
Commit f82a8cfe9 (KVM: struct kvm_memory_slot.user_alloc -> bool) broke the ARM KVM port by changing the prototype of two global functions. Apply the same change to fix the compilation breakage. Signed-off-by: Marc Zyngier --- arch/arm/kvm/arm.c | 4 ++-- 1 file changed, 2 insertions(+)

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-24 Thread Marc Zyngier
On Tue, 19 Feb 2013 18:16:53 -0800, Christoffer Dall wrote: > On Tue, Feb 19, 2013 at 12:16 PM, Scott Wood > wrote: >> We at least need the numberspace to not be architecture-specific if we >> want >> to retain the possibility of changing later -- not to mention what >> happens >> if architectu

Fixing KVM/ARM breakage in mainline

2013-02-25 Thread Marc Zyngier
05019 I've now created a branch based off mainline as of this morning, and containing these fixes: git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm/core-3.9-rc1-fixes Now the question is: who wants to merge this? The diffstat looks like this: Marc Zyngier (3):

[PATCH] ARM: KVM: add support for minimal host vs guest profiling

2013-03-04 Thread Marc Zyngier
host. Signed-off-by: Marc Zyngier --- This patch is on top of the pre-arm64 rework series posted earlier. arch/arm/include/asm/kvm_host.h | 3 ++ arch/arm/kvm/Makefile | 2 +- arch/arm/kvm/arm.c | 4 +++ arch/arm/kvm/perf.c

[PATCH 28/29] ARM: KVM: change kvm_tlb_flush_vmid to kvm_tlb_flush_vmid_ipa

2013-03-04 Thread Marc Zyngier
v8 is capable of invalidating Stage-2 by IPA, but v7 is not. Change kvm_tlb_flush_vmid() to take an IPA parameter, which is then ignored by the invalidation code (and nuke the whole TLB as it always did). This allows v8 to implement a more optimized strategy. Signed-off-by: Marc Zyngier

[PATCH 25/29] ARM: KVM: fix fault_ipa computing

2013-03-04 Thread Marc Zyngier
The ARM ARM says that HPFAR reports bits [39:12] of the faulting IPA, and we need to complement it with the bottom 12 bits of the faulting VA. This is always 12 bits, irrespective of the page size. Makes it clearer in the code. Signed-off-by: Marc Zyngier --- arch/arm/kvm/mmu.c | 9

[PATCH 21/29] ARM: KVM: allow HYP mappings to be at an offset from kernel mappings

2013-03-04 Thread Marc Zyngier
change the documentation to reflect the existence of the offset. On ARM, where we can have an identity mapping between kernel and HYP, the macros are without any effect. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_mmu.h | 8 arch/arm/kvm/mmu.c | 43

[PATCH 18/29] ARM: KVM: remove superfluous include from kvm_vgic.h

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_vgic.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h index ab97207..343744e 100644 --- a/arch/arm/include/asm/kvm_vgic.h +++ b/arch/arm/include/asm/kvm_vgic.h @@ -21,7

[PATCH 17/29] ARM: KVM: abstract most MMU operations

2013-03-04 Thread Marc Zyngier
Move low level MMU-related operations to kvm_mmu.h. This makes the MMU code reusable by the arm64 port. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_mmu.h | 58 ++ arch/arm/kvm/mmu.c | 58

[PATCH 09/29] ARM: KVM: abstract SAS decoding away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 15 +++ arch/arm/kvm/mmio.c| 17 +++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index

[PATCH 20/29] ARM: KVM: use kvm_kernel_vfp_t as an abstract type for VFP containers

2013-03-04 Thread Marc Zyngier
In order to keep the VFP allocation code common, use an abstract type for the VFP containers. Maps onto struct vfp_hard_struct on ARM. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 6 -- arch/arm/kvm/arm.c | 6 +++--- 2 files changed, 7 insertions(+), 5

[PATCH 02/29] ARM: KVM: abstract fault register accesses

2013-03-04 Thread Marc Zyngier
Instead of directly accessing the fault registers, use proper accessors so the core code can be shared. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 21 + arch/arm/include/asm/kvm_host.h| 14 -- arch/arm/kernel/asm-offsets.c | 8

[PATCH 03/29] ARM: KVM: abstract HSR_ISV away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 3c01988..9531535 100644 --- a/arch

[PATCH 16/29] ARM: KVM: move kvm_handle_wfi to handle_exit.c

2013-03-04 Thread Marc Zyngier
It has little to do in emulate.c these days... Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 1 - arch/arm/kvm/emulate.c | 16 arch/arm/kvm/handle_exit.c | 19 +++ 3 files changed, 19 insertions(+), 17 deletions

[PATCH 04/29] ARM: KVM: abstract HSR_WNR away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 9531535..236fadd 100644 --- a/arch

[PATCH 07/29] ARM: KVM: abstract external abort detection away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 603f5ea..90e92b4 100644 --- a/arch

[PATCH 15/29] ARM: KVM: move exit handler selection to a separate file

2013-03-04 Thread Marc Zyngier
The exit handler selection code cannot be shared with arm64 (two different modes, more exception classes...). Move it to a separate file (handle_exit.c). Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 3 + arch/arm/kvm/Makefile | 2 +- arch/arm/kvm/arm.c

[PATCH 10/29] ARM: KVM: abstract IL decoding away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 6 ++ arch/arm/kvm/arm.c | 3 +-- arch/arm/kvm/coproc.c | 2 +- arch/arm/kvm/mmio.c| 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm

[PATCH 12/29] ARM: KVM: abstract fault decoding away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmu.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index e3e6135..75e54ba 100644 --- a/arch

[PATCH 11/29] ARM: KVM: abstract exception class decoding away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/arm.c | 4 ++-- arch/arm/kvm/mmu.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm

[PATCH 24/29] ARM: KVM: move kvm_target_cpu to guest.c

2013-03-04 Thread Marc Zyngier
guest.c already contains some target-specific checks. Let's move kvm_target_cpu() over there so arm.c is mostly target agnostic. Signed-off-by: Marc Zyngier --- arch/arm/kvm/arm.c | 17 - arch/arm/kvm/guest.c | 17 + 2 files changed, 17 insertions(+

[PATCH 26/29] ARM: KVM: vgic: decouple alignment restriction from page size

2013-03-04 Thread Marc Zyngier
The virtual GIC is supposed to be 4kB aligned. On a 64kB page system, comparing the alignment to PAGE_SIZE is wrong. Use SZ_4K instead. Signed-off-by: Marc Zyngier --- arch/arm/kvm/vgic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm

[PATCH 29/29] ARM: KVM: Fix length of mmio access

2013-03-04 Thread Marc Zyngier
Instead of hardcoding the maximum MMIO access to be 4 bytes, compare it to sizeof(unsigned long), which will do the right thing on both 32 and 64bit systems. Same thing for sign extention. Signed-off-by: Marc Zyngier --- arch/arm/kvm/mmio.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH 22/29] ARM: KVM: fix address validation for HYP mappings

2013-03-04 Thread Marc Zyngier
. Signed-off-by: Marc Zyngier --- arch/arm/kvm/mmu.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index ead6b16..ec14269 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -200,8 +200,13 @@ static int

[PATCH 19/29] ARM: KVM: move hyp init to kvm_host.h

2013-03-04 Thread Marc Zyngier
Make the split of the pgd_ptr an implementation specific thing by moving the init call to an inline function. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_host.h | 19 +++ arch/arm/kvm/arm.c | 12 +--- 2 files changed, 20 insertions(+), 11

[PATCH 13/29] ARM: KVM: abstract HSR_EC_IABT away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmu.c | 8 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 75e54ba..2f5cc48 100644

[PATCH 00/29] ARM: KVM: pre-arm64 KVM/arm rework

2013-03-04 Thread Marc Zyngier
most welcome. Marc Zyngier (29): ARM: KVM: convert GP registers from u32 to unsigned long ARM: KVM: abstract fault register accesses ARM: KVM: abstract HSR_ISV away ARM: KVM: abstract HSR_WNR away ARM: KVM: abstract HSR_SSE away ARM: KVM: abstract HSR_SRT_{MASK,SHIFT} away ARM: KVM

[PATCH 06/29] ARM: KVM: abstract HSR_SRT_{MASK,SHIFT} away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 2a077bc..603f5ea 100644 --- a/arch

[PATCH 27/29] ARM: KVM: move include of asm/idmap.h to kvm_mmu.h

2013-03-04 Thread Marc Zyngier
Since the arm64 code doesn't have a global asm/idmap.h file, move the inclusion to asm/kvm_mmu.h. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_mmu.h | 1 + arch/arm/kvm/mmu.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/includ

[PATCH 23/29] ARM: KVM: sanitize freeing of HYP page tables

2013-03-04 Thread Marc Zyngier
Instead of trying to free everything from PAGE_OFFSET to the top of memory, use the virt_addr_valid macro to check the upper limit. Also do the same for the vmalloc region where the IO mappings are allocated. Signed-off-by: Marc Zyngier --- arch/arm/kvm/mmu.c | 44

[PATCH 14/29] ARM: KVM: move kvm_condition_valid to emulate.c

2013-03-04 Thread Marc Zyngier
This is really hardware emulation, and as such it better be with its little friends. Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 1 + arch/arm/kvm/arm.c | 45 -- arch/arm/kvm/emulate.c | 45

[PATCH 08/29] ARM: KVM: abstract S1TW abort detection away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 90e92b4..c27d9c9 100644 --- a/arch

[PATCH 01/29] ARM: KVM: convert GP registers from u32 to unsigned long

2013-03-04 Thread Marc Zyngier
On 32bit ARM, unsigned long is guaranteed to be a 32bit quantity. On 64bit ARM, it is a 64bit quantity. In order to be able to share code between the two architectures, convert the registers to be unsigned long, so the core code can be oblivious of the change. Signed-off-by: Marc Zyngier

[PATCH 05/29] ARM: KVM: abstract HSR_SSE away

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm/include/asm/kvm_emulate.h | 5 + arch/arm/kvm/mmio.c| 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 236fadd..2a077bc 100644 --- a/arch

[PATCH 01/29] arm64: KVM: define HYP and Stage-2 translation page flags

2013-03-04 Thread Marc Zyngier
Add HYP and S2 page flags, for both normal and device memory. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/pgtable-hwdef.h | 13 + arch/arm64/include/asm/pgtable.h | 13 + arch/arm64/mm/mmu.c| 6 +- 3 files changed, 31 insertions

[PATCH 00/29] Port of KVM to arm64

2013-03-04 Thread Marc Zyngier
ort has already been merged). Marc Zyngier (29): arm64: KVM: define HYP and Stage-2 translation page flags arm64: KVM: HYP mode idmap support arm64: KVM: EL2 register definitions arm64: KVM: system register definitions for 64bit guests arm64: KVM: Basic ESR_EL2 helpers and vcpu register

[PATCH 02/29] arm64: KVM: HYP mode idmap support

2013-03-04 Thread Marc Zyngier
Add the necessary infrastructure for identity-mapped HYP page tables. Idmap-ed code must be in the ".hyp.idmap.text" linker section. The rest of the HYP ends up in ".hyp.text". Signed-off-by: Marc Zyngier --- arch/arm64/kernel/vmlinux.lds.S | 10 +++ arch/arm64/kvm/id

[PATCH 03/29] arm64: KVM: EL2 register definitions

2013-03-04 Thread Marc Zyngier
Define all the useful bitfields for EL2 registers. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_arm.h | 243 +++ 1 file changed, 243 insertions(+) create mode 100644 arch/arm64/include/asm/kvm_arm.h diff --git a/arch/arm64/include/asm

[PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-04 Thread Marc Zyngier
Define the saved/restored registers for 64bit guests. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_asm.h | 68 1 file changed, 68 insertions(+) create mode 100644 arch/arm64/include/asm/kvm_asm.h diff --git a/arch/arm64/include/asm

[PATCH 05/29] arm64: KVM: Basic ESR_EL2 helpers and vcpu register access

2013-03-04 Thread Marc Zyngier
Implements helpers for dealing with the EL2 syndrome register as well as accessing the vcpu registers. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_emulate.h | 159 +++ 1 file changed, 159 insertions(+) create mode 100644 arch/arm64/include/asm

[PATCH 06/29] arm64: KVM: fault injection into a guest

2013-03-04 Thread Marc Zyngier
Implement the injection of a fault (undefined, data abort or prefetch abort) into a 64bit guest. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/inject_fault.c | 117 ++ 1 file changed, 117 insertions(+) create mode 100644 arch/arm64/kvm/inject_fault.c

[PATCH 07/29] arm64: KVM: architecture specific MMU backend

2013-03-04 Thread Marc Zyngier
Define the arm64 specific MMU backend: - HYP/kernel VA offset - S2 4/64kB definitions - S2 page table populating and flushing - icache cleaning Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_mmu.h | 126 +++ 1 file changed, 126 insertions

[PATCH 09/29] arm64: KVM: system register handling

2013-03-04 Thread Marc Zyngier
Provide 64bit system register handling, modeled after the cp15 handling for ARM. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_coproc.h | 51 ++ arch/arm64/include/uapi/asm/kvm.h | 56 +++ arch/arm64/kvm/sys_regs.c | 962 arch

[PATCH 08/29] arm64: KVM: user space interface

2013-03-04 Thread Marc Zyngier
Provide the kvm.h file that defines the user space visible interface. Signed-off-by: Marc Zyngier --- arch/arm64/include/uapi/asm/kvm.h | 112 ++ 1 file changed, 112 insertions(+) create mode 100644 arch/arm64/include/uapi/asm/kvm.h diff --git a/arch/arm64

[PATCH 22/29] arm64: KVM: define 32bit specific registers

2013-03-04 Thread Marc Zyngier
Define the 32bit specific registers (SPSRs, cp15...). Most CPU registers are directly mapped to a 64bit register (r0->x0...). Only the SPSRs have separate registers. cp15 registers are also mapped into their 64bit counterpart in most cases. Signed-off-by: Marc Zyngier --- arch/arm64/incl

[PATCH 21/29] arm64: KVM: Build system integration

2013-03-04 Thread Marc Zyngier
Signed-off-by: Marc Zyngier --- arch/arm64/Kconfig | 2 ++ arch/arm64/Makefile | 2 +- arch/arm64/kvm/Kconfig | 59 + arch/arm64/kvm/Makefile | 18 +++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644

[PATCH 20/29] arm64: KVM: PSCI implementation

2013-03-04 Thread Marc Zyngier
Wire the PSCI backend into the exit handling code. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_psci.h | 23 +++ arch/arm64/include/uapi/asm/kvm.h | 16 arch/arm64/kvm/handle_exit.c | 16

[PATCH 18/29] arm64: KVM: Plug the VGIC

2013-03-04 Thread Marc Zyngier
Shouldn't be needed - a complete duplicate from arch/arm. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_vgic.h | 156 ++ 1 file changed, 156 insertions(+) create mode 100644 arch/arm64/include/asm/kvm_vgic.h diff --git a/arch/arm64/includ

[PATCH 13/29] arm64: KVM: MMIO access backend

2013-03-04 Thread Marc Zyngier
Define the necessary structures to perform an MMIO access. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_mmio.h | 59 +++ 1 file changed, 59 insertions(+) create mode 100644 arch/arm64/include/asm/kvm_mmio.h diff --git a/arch/arm64/include/asm

[PATCH 16/29] arm64: KVM: HYP mode world switch implementation

2013-03-04 Thread Marc Zyngier
The HYP mode world switch in all its glory. Implements save/restore of host/guest registers, EL2 trapping, IPA resolution, and additional services (tlb invalidation). Signed-off-by: Marc Zyngier --- arch/arm64/kernel/asm-offsets.c | 33 ++ arch/arm64/kvm/hyp.S| 756

[PATCH 10/29] arm64: KVM: Cortex-A57 specific system registers handling

2013-03-04 Thread Marc Zyngier
Add the support code for Cortex-A57 specific system registers. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs_a57.c | 96 +++ 1 file changed, 96 insertions(+) create mode 100644 arch/arm64/kvm/sys_regs_a57.c diff --git a/arch/arm64/kvm

[PATCH 11/29] arm64: KVM: virtual CPU reset

2013-03-04 Thread Marc Zyngier
Provide the reset code for a virtual CPU booted in 64bit mode. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/reset.c | 63 ++ 1 file changed, 63 insertions(+) create mode 100644 arch/arm64/kvm/reset.c diff --git a/arch/arm64/kvm/reset.c b/arch

[PATCH 15/29] arm64: KVM: hypervisor initialization code

2013-03-04 Thread Marc Zyngier
Provide EL2 with page tables and stack, and set the vectors to point to the full blown world-switch code. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 11 + arch/arm64/kvm/hyp-init.S | 89 +++ 2 files changed, 100 insertions

[PATCH 12/29] arm64: KVM: kvm_arch and kvm_vcpu_arch definitions

2013-03-04 Thread Marc Zyngier
Provide the architecture dependent structures for VM and vcpu abstractions. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 178 ++ 1 file changed, 178 insertions(+) create mode 100644 arch/arm64/include/asm/kvm_host.h diff --git a/arch

[PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-04 Thread Marc Zyngier
Let userspace play with the guest registers. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/guest.c | 240 + 1 file changed, 240 insertions(+) create mode 100644 arch/arm64/kvm/guest.c diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c

[PATCH 17/29] arm64: KVM: Exit handling

2013-03-04 Thread Marc Zyngier
Handle the exit of a VM, decoding the exit reason from HYP mode and calling the corresponding handler. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/handle_exit.c | 119 +++ 1 file changed, 119 insertions(+) create mode 100644 arch/arm64/kvm

[PATCH 19/29] arm64: KVM: Plug the arch timer

2013-03-04 Thread Marc Zyngier
Shouldn't be needed - a complete duplicate from arch/arm. Signed-off-by: Marc Zyngier --- arch/arm/kvm/arch_timer.c | 1 + arch/arm64/include/asm/kvm_arch_timer.h | 58 + 2 files changed, 59 insertions(+) create mode 100644 arch/arm64/includ

[PATCH 23/29] arm64: KVM: 32bit GP register access

2013-03-04 Thread Marc Zyngier
Allow access to the 32bit register file through the usual API. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_emulate.h | 17 +++- arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/regmap.c | 168 +++ 3 files changed, 184

[PATCH 24/29] arm64: KVM: 32bit conditional execution emulation

2013-03-04 Thread Marc Zyngier
As conditionnal instructions can trap on AArch32, add the thinest possible emulation layer to keep 32bit guests happy. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_emulate.h | 13 ++- arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/emulate.c | 154

[PATCH 25/29] arm64: KVM: 32bit handling of coprocessor traps

2013-03-04 Thread Marc Zyngier
Provide the necessary infrastructure to trap coprocessor accesses that occur when running 32bit guests. Also wire SMC and HVC trapped in 32bit mode while were at it. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_coproc.h | 5 ++ arch/arm64/kvm/handle_exit.c| 7 ++ arch

[PATCH 26/29] arm64: KVM: 32bit coprocessor access for Cortex-A57

2013-03-04 Thread Marc Zyngier
Enable handling of 32bit coprocessor traps for Cortex-A57. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/sys_regs_a57.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/kvm/sys_regs_a57.c b/arch/arm64/kvm/sys_regs_a57.c index dcc88fe..56c0641 100644 --- a

[PATCH 27/29] arm64: KVM: 32bit specific register world switch

2013-03-04 Thread Marc Zyngier
Allow registers specific to 32bit guests to be saved/restored during the world switch. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/hyp.S | 70 1 file changed, 70 insertions(+) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index

[PATCH 28/29] arm64: KVM: 32bit guest fault injection

2013-03-04 Thread Marc Zyngier
Add fault injection capability for 32bit guests. Signed-off-by: Marc Zyngier --- arch/arm64/kvm/inject_fault.c | 79 ++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c index

[PATCH 29/29] arm64: KVM: enable initialization of a 32bit vcpu

2013-03-04 Thread Marc Zyngier
Wire the init of a 32bit vcpu by allowing 32bit modes in pstate, and providing sensible defaults out of reset state. This feature is of course conditionned by the presence of 32bit capability on the physical CPU. Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_host.h | 2 +- arch

Re: [kvmarm] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-06 Thread Marc Zyngier
On Wed, 6 Mar 2013 16:31:48 -0800, Christoffer Dall wrote: Hi Christoffer, > > Please pull these KVM/ARM fixes mostly centered around preparation for > Marc's ARMv8 KVM work. Can we please hold on that for a while? asm-offset.c is usually a candidate for merge conflicts as people start pushing

Re: [kvmarm] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-06 Thread Marc Zyngier
On Wed, 6 Mar 2013 20:40:00 -0800, Christoffer Dall wrote: > On Wed, Mar 6, 2013 at 7:54 PM, Marc Zyngier wrote: >> On Wed, 6 Mar 2013 16:31:48 -0800, Christoffer Dall >> >> wrote: >> >> Hi Christoffer, >> >>> >>> Please pull these KVM/AR

Re: [kvmarm] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-07 Thread Marc Zyngier
On Thu, 7 Mar 2013 16:09:00 -0300, Marcelo Tosatti wrote: > On Thu, Mar 07, 2013 at 07:57:23AM +0100, Marc Zyngier wrote: >> On Wed, 6 Mar 2013 20:40:00 -0800, Christoffer Dall >> >> wrote: >> > On Wed, Mar 6, 2013 at 7:54 PM, Marc Zyngier >> wrote: >

Re: [kvmarm] [PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-07 Thread Marc Zyngier
On Thu, 7 Mar 2013 11:33:12 +0100, Alexander Graf wrote: > On 05.03.2013, at 04:47, Marc Zyngier wrote: > >> Define the saved/restored registers for 64bit guests. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/include/asm/kvm_asm.h | 68 >> +++

Re: [kvmarm] [PATCH 09/29] arm64: KVM: system register handling

2013-03-07 Thread Marc Zyngier
On Thu, 7 Mar 2013 11:30:20 +0100, Alexander Graf wrote: > On 05.03.2013, at 04:47, Marc Zyngier wrote: > >> Provide 64bit system register handling, modeled after the cp15 >> handling for ARM. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64

Re: [kvmarm] [PATCH 08/29] arm64: KVM: user space interface

2013-03-07 Thread Marc Zyngier
On Thu, 7 Mar 2013 10:09:03 +0200, "Michael S. Tsirkin" wrote: > On Tue, Mar 05, 2013 at 03:47:24AM +, Marc Zyngier wrote: >> Provide the kvm.h file that defines the user space visible >> interface. >> >> Signed-off-by: Marc Zyngier >> ---

Re: [kvmarm] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-11 Thread Marc Zyngier
On 08/03/13 11:31, Gleb Natapov wrote: > On Fri, Mar 08, 2013 at 04:12:41AM +0100, Marc Zyngier wrote: >> On Thu, 7 Mar 2013 16:09:00 -0300, Marcelo Tosatti >> wrote: >>> On Thu, Mar 07, 2013 at 07:57:23AM +0100, Marc Zyngier wrote: >>>> On Wed, 6 Mar 2

Re: [kvmarm] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-11 Thread Marc Zyngier
On 08/03/13 19:26, Christoffer Dall wrote: > On Thu, Mar 7, 2013 at 7:12 PM, Marc Zyngier wrote: >> On Thu, 7 Mar 2013 16:09:00 -0300, Marcelo Tosatti >> wrote: >>> On Thu, Mar 07, 2013 at 07:57:23AM +0100, Marc Zyngier wrote: >>>> On Wed, 6 Mar 2

Re: [PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-12 Thread Marc Zyngier
On 12/03/13 13:20, Christopher Covington wrote: Hi Christopher, > Here are a few minor questions and suggestions. > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Define the saved/restored registers for 64bit guests. >> >> Signed-off-by: Marc Zyngier >&g

Re: [PATCH 06/29] arm64: KVM: fault injection into a guest

2013-03-12 Thread Marc Zyngier
On 12/03/13 13:20, Christopher Covington wrote: Hi Christopher, > I noticed you went through the trouble of defining several constants in an > earlier patch. Perhaps you could put them to use here? > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Implement the injection of

Re: [PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-12 Thread Marc Zyngier
On 12/03/13 17:31, Christopher Covington wrote: > Hi Marc, > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Let userspace play with the guest registers. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/guest.c | 240 >> +++

Re: [PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-13 Thread Marc Zyngier
On 12/03/13 22:07, Christopher Covington wrote: Hi Christopher, > On 03/12/2013 02:05 PM, Marc Zyngier wrote: >> On 12/03/13 17:31, Christopher Covington wrote: >>> Hi Marc, >>> >>> On 03/04/2013 10:47 PM, Marc Zyngier wrote: >>>> Let userspace pla

Re: [PATCH 10/29] arm64: KVM: Cortex-A57 specific system registers handling

2013-03-14 Thread Marc Zyngier
On 13/03/13 18:30, Christopher Covington wrote: Hi Christopher, > I wonder if two of these registers could be handled in a generic fashion. [...] > What's A57-specific about this MPIDR behavior? [...] > What's A57-specific about this CPACR behavior? In both cases, nothing I can think of. The

Re: [PATCH 16/29] arm64: KVM: HYP mode world switch implementation

2013-03-21 Thread Marc Zyngier
On 20/03/13 20:04, Christopher Covington wrote: > Hi Marc, > > On 03/13/2013 03:59 PM, Christopher Covington wrote: > > [...] > >> Alternatively, you could consider storing the host registers in a >> slimmed-down vcpu structure for hosts, rather than on the stack. I am actively implementing thi

  1   2   3   4   5   6   7   8   9   10   >