[PATCH v5 02/13] ARM: KVM: Hypervisor identity mapping

2011-12-11 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Adds support in the identity mapping feature that allows KVM to setup identity mapping for the Hyp mode with the AP[1] bit set as required by the specification and also supports freeing created sub pmd's after finished use. These two functions

[PATCH v5 03/13] ARM: KVM: Add hypervisor inititalization

2011-12-11 Thread Christoffer Dall
(hyp_pgd, start, end); - free_hyp_pmds(pgd_hyp); See the implementation for more details. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arm.h | 103 + arch/arm/include/asm/kvm_asm.h | 23 arch/arm/include/asm

[PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-11 Thread Christoffer Dall
are managed using a bitmap and assigned when creating the VM in kvm_arch_init_vm() where the 2nd stage pgd is also allocated. The table is freed in kvm_arch_destroy_vm(). Both functions are called from the main KVM code. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm

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

2011-12-11 Thread Christoffer Dall
match those used in ARM, I am yet to be convinced why this is necessary. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- Documentation/virtual/kvm/api.txt | 10 ++- arch/arm/include/asm/kvm.h|8 ++ arch/arm/include/asm/kvm_arm.h|1 + arch/arm/kvm/arm.c

[PATCH v5 06/13] ARM: KVM: World-switch implementation

2011-12-11 Thread Christoffer Dall
running in the guest. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm.h |1 arch/arm/include/asm/kvm_arm.h | 26 ++ arch/arm/include/asm/kvm_host.h |8 + arch/arm/kernel/armksyms.c |7 + arch/arm/kernel/asm-offsets.c | 33

[PATCH v5 07/13] ARM: KVM: Emulation framework and CP15 emulation

2011-12-11 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Adds a new important function in the main KVM/ARM code called handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns from guest execution. This function examines the Hyp-Syndrome-Register (HSR), which contains information telling KVM

[PATCH v5 08/13] ARM: KVM: Handle guest faults in KVM

2011-12-11 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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 memory for KVM guests. Signed-off

[PATCH v5 09/13] ARM: KVM: Handle I/O aborts

2011-12-11 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information (physical address, read/write, length, register) and forwarding reads and writes to QEMU which performs the device emulation

[PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-11 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu When the guest executes a WFI instruction the operation is trapped to KVM, which emulates the instruction in software. There is no correlation between a guest executing a WFI instruction and actually puttin the hardware into a low-power mode, since

[PATCH v5 11/13] ARM: KVM: Support SMP hosts

2011-12-11 Thread Christoffer Dall
marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_host.h |4 - arch/arm/include/asm/kvm_mmu.h |1 arch/arm/kvm/arm.c | 175 +++ arch/arm/kvm/emulate.c |2 arch

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

2011-12-11 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com A guest may need to know which CPU it has booted on (and Linux does). Now that we can run KVM on a SMP host, QEMU may be running on any CPU. In that case, directly reading MPIDR will give an inconsistent view on the guest CPU number (among other problems).

[PATCH v5 13/13] ARM: KVM: Support SMP guests

2011-12-11 Thread Christoffer Dall
This patch is a beginning attempt to support SMP guests. So far we only add locking for the second stage PGD stored on the kvm_arch struct. WARNING: This code is untested and does not yet support SMP guests. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm

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

2011-12-11 Thread Christoffer Dall
On Sun, Dec 11, 2011 at 10:18 AM, Jan Kiszka jan.kis...@web.de wrote: Just found two, maybe three nits while browsing by: On 2011-12-11 11:24, Christoffer Dall wrote: Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two

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

2011-12-11 Thread Christoffer Dall
On Sun, Dec 11, 2011 at 6:32 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 10:24, Christoffer Dall c.d...@virtualopensystems.com wrote: The following series implements KVM support for ARM processors, specifically on the Cortex A-15 platform. Still on the to-do list

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

2011-12-11 Thread Christoffer Dall
On Sun, Dec 11, 2011 at 11:03 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 15:18, Jan Kiszka jan.kis...@web.de wrote: Just found two, maybe three nits while browsing by: On 2011-12-11 11:24, Christoffer Dall wrote: +ARM uses two types of interrupt lines per CPU, ie

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

2011-12-11 Thread Christoffer Dall
On Dec 11, 2011, at 2:48 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 19:30, Christoffer Dall c.d...@virtualopensystems.com wrote: On Sun, Dec 11, 2011 at 11:03 AM, Peter Maydell peter.mayd...@linaro.org wrote: Removing the mask would be wrong since the irq field

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

2011-12-11 Thread Christoffer Dall
On Sun, Dec 11, 2011 at 3:25 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 20:07, Christoffer Dall christofferd...@christofferdall.dk wrote: Well, if it was just irq 1, then I hear you, but it would be (irq cpu_idx) 1 which I don't think is more clear. Er, what

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

2011-12-11 Thread Christoffer Dall
On Sun, Dec 11, 2011 at 5:35 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 22:12, Peter Maydell peter.mayd...@linaro.org wrote: (Actually what would be clearest would be if the ioctl took the (interrupt-target, interrupt-line-for-that-target, value-of-line) tuple as

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

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 6:06 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 11/12/11 20:07, Christoffer Dall wrote: On Dec 11, 2011, at 2:48 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 11 December 2011 19:30, Christoffer Dall c.d...@virtualopensystems.com wrote: On Sun, Dec 11

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

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:28 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:24 PM, Christoffer Dall wrote: Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two lines that can be either raised or lowered on the VCPU

Re: [Android-virt] [PATCH v5 09/13] ARM: KVM: Handle I/O aborts

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:54 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:25 PM, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:40 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:24 PM, Christoffer Dall wrote: This commit introduces the framework for guest memory management through the use of 2nd stage translation. Each VM has a pointer to a level-1 tabled (the pgd field in struct

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

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:50 AM, Avi Kivity a...@redhat.com wrote: On 12/12/2011 04:38 PM, Christoffer Dall wrote: Why don't they match?  The assignment of lines to actual pins differs, but essentially it's the same thing (otherwise we'd use a different ioctl). because

Re: [PATCH v5 07/13] ARM: KVM: Emulation framework and CP15 emulation

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 8:44 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:25 PM, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu Adds a new important function in the main KVM/ARM code called handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns

Re: [PATCH v5 10/13] ARM: KVM: Guest wait-for-interrupts (WFI) support

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:12 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:25 PM, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu When the guest executes a WFI instruction the operation is trapped to KVM, which emulates the instruction in software

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

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:30 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:25 PM, Christoffer Dall wrote: In order to support KVM on a SMP host, it is necessary to initialize the hypervisor on all CPUs, mostly by making sure each CPU gets its own hypervisor stack and runs the HYP init

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

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity a...@redhat.com wrote: On 12/11/2011 12:25 PM, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com A guest may need to know which CPU it has booted on (and Linux does). Now that we can run KVM on a SMP host, QEMU may be running on any

Re: [Android-virt] [PATCH v5 04/13] ARM: KVM: Memory virtualization setup

2011-12-12 Thread Christoffer Dall
On Mon, Dec 12, 2011 at 10:49 AM, Avi Kivity a...@redhat.com wrote: On 12/12/2011 05:25 PM, Peter Maydell wrote: On 12 December 2011 15:15, Avi Kivity a...@redhat.com wrote: We need to differentiate in how Linux-as-a-guest acts and how the cpu is supposed to work.  A guest operating system

Re: [PATCH v6 04/12] ARM: KVM: Hypervisor inititalization

2012-03-04 Thread Christoffer Dall
On Sun, Mar 4, 2012 at 8:12 PM, Rusty Russell ru...@rustcorp.com.au wrote: On Thu, 23 Feb 2012 02:32:39 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: From: Christoffer Dall c.d...@virtualopensystems.com +static void cpu_set_vector(void *vector) +{ +     unsigned long

Re: [PATCH v4] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-03-08 Thread Christoffer Dall
Any news on the status of this? On Thu, Feb 9, 2012 at 8:45 PM, Alexander Graf ag...@suse.de wrote: On 10.02.2012, at 02:40, Christoffer Dall wrote: The kvm_vcpu_kick function performs roughly the same funcitonality on most all architectures, so we shouldn't have separate copies. PowerPC

Re: [PATCH] KVM: Cleanup the kvm_print functions and introduce pr_XX wrappers

2012-03-08 Thread Christoffer Dall
Any comments on this one? On Thu, Feb 9, 2012 at 3:57 PM, Christoffer Dall c.d...@virtualopensystems.com wrote: From: Christoffer Dall c.d...@virtualopensystems.com Introduces a couple of print functions, which are essentially wrappers around standard printk functions, with a KVM: prefix

Re: [PATCH v6 02/12] ARM: KVM: Initial skeleton to compile KVM support

2012-03-11 Thread Christoffer Dall
On Thu, Feb 23, 2012 at 10:32 PM, Rusty Russell ru...@rustcorp.com.au wrote: On Thu, 23 Feb 2012 02:32:26 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: From: Christoffer Dall c.d...@virtualopensystems.com Targets KVM support for Cortex A-15 processors. Contains no real

Re: [PATCH v6 04/12] ARM: KVM: Hypervisor inititalization

2012-03-11 Thread Christoffer Dall
On Thu, Feb 23, 2012 at 11:00 PM, Rusty Russell ru...@rustcorp.com.au wrote: On Thu, 23 Feb 2012 02:32:39 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: +     /* +      * Allocate stack pages for Hypervisor-mode +      */ +     for_each_possible_cpu(cpu) +             per_cpu

[PATCH v7 00/12] KVM/ARM Implementation

2012-03-12 Thread Christoffer Dall
more CP15 accesses - Support guest WFI calls - Uses debugfs instead of /proc - Support compiling in Thumb mode Changes since v2: - Performs world-switch code - Maps guest memory using 2nd stage translation - Emulates co-processor 15 instructions - Forwards I/O faults to QEMU. --- Christoffer

[PATCH v7 01/12] KVM: Introduce __KVM_HAVE_IRQ_LINE

2012-03-12 Thread Christoffer Dall
This is a prepatory patch for the KVM/ARM implementation. KVM/ARM will use the KVM_IRQ_LINE ioctl, which is currently conditional on __KVM_HAVE_IOAPIC, but ARM obviously doesn't have any IOAPIC support and we need a separate define. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com

[PATCH v7 02/12] KVM: Guard mmu_notifier specific code with CONFIG_MMU_NOTIFIER

2012-03-12 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com 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

[PATCH v7 03/12] ARM: KVM: Initial skeleton to compile KVM support

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Targets KVM support for Cortex A-15 processors. Contains no real functionality but all the framework components, make files, header files and some tracing functionality. “Nothing to see here. Move along, move along... Most functionality is in arch

[PATCH v7 05/12] ARM: KVM: Hypervisor inititalization

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Sets up the required registers to run code in HYP-mode from the kernel. By setting the HVBAR the kernel can execute code in Hyp-mode with the MMU disabled. The HVBAR initially points to initialization code, which initializes other Hyp-mode registers

[PATCH v7 04/12] ARM: KVM: Hypervisor identity mapping

2012-03-12 Thread Christoffer Dall
to by the pgd as opposed to the non-hyp version which just clears them. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/pgtable-3level-hwdef.h |1 + arch/arm/include/asm/pgtable.h |5 +++ arch/arm/kvm/guest.c

[PATCH v7 06/12] ARM: KVM: Memory virtualization setup

2012-03-12 Thread Christoffer Dall
functions are called from the main KVM code. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_mmu.h |5 ++ arch/arm/kvm/arm.c | 65 ++--- arch/arm/kvm/mmu.c | 103

[PATCH v7 07/12] ARM: KVM: Inject IRQs and FIQs from userspace

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Userspace can inject IRQs and FIQs through the KVM_IRQ_LINE VM ioctl. This ioctl is used since the sematics are in fact two lines that can be either raised or lowered on the VCPU - the IRQ and FIQ lines. KVM needs to know which VCPU it must operate

[PATCH v7 08/12] ARM: KVM: World-switch implementation

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Provides complete world-switch implementation to switch to other guests running in non-secure modes. Includes Hyp exception handlers that capture necessary exception information and stores the information on the VCPU and KVM structures. Switching

[PATCH v7 09/12] ARM: KVM: Emulation framework and CP15 emulation

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu Adds a new important function in the main KVM/ARM code called handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns from guest execution. This function examines the Hyp-Syndrome-Register (HSR), which contains information telling KVM

[PATCH v7 10/12] ARM: KVM: Handle guest faults in KVM

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu 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 memory for KVM guests. Leverages MMU

[PATCH v7 11/12] ARM: KVM: Handle I/O aborts

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information (physical address, read/write, length, register) and forwarding reads and writes to QEMU which performs the device emulation

[PATCH v7 12/12] ARM: KVM: Guest wait-for-interrupts (WFI) support

2012-03-12 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu When the guest executes a WFI instruction the operation is trapped to KVM, which emulates the instruction in software. There is no correlation between a guest executing a WFI instruction and actually putting the hardware into a low-power mode, since

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

2012-03-12 Thread Christoffer Dall
On Mon, Mar 12, 2012 at 11:31 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 12/03/12 06:52, Christoffer Dall wrote: From: Christoffer Dall cd...@cs.columbia.edu Handles the guest faults in KVM by mapping in corresponding user pages in the 2nd stage page tables. Introduces new ARM-specific

Re: [Android-virt] [PATCH] KVM: Cleanup the kvm_print functions and introduce pr_XX wrappers

2012-03-12 Thread Christoffer Dall
On Mon, Mar 12, 2012 at 3:32 PM, Alexander Graf ag...@suse.de wrote: On 08.03.2012, at 23:45, Christoffer Dall wrote: Any comments on this one? While at it, how about you also add the PID? Otherwise it's pretty pointless to write information into the kernel log, as you still won't know

Re: [Android-virt] [PATCH v4] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-03-13 Thread Christoffer Dall
On Tue, Mar 13, 2012 at 4:34 PM, Alexander Graf ag...@suse.de wrote: On 08.03.2012, at 22:44, Christoffer Dall wrote: Any news on the status of this? On Thu, Feb 9, 2012 at 8:45 PM, Alexander Graf ag...@suse.de wrote: On 10.02.2012, at 02:40, Christoffer Dall wrote: The kvm_vcpu_kick

Re: [PATCH v7 08/12] ARM: KVM: World-switch implementation

2012-05-14 Thread Christoffer Dall
On Thu, Mar 29, 2012 at 6:49 AM, Avi Kivity a...@redhat.com wrote: On 03/28/2012 11:57 PM, Rusty Russell wrote: Should this code be dropped altogether?  Peter points out that once we add new regs, they *must* be initialized to correct reset values in case older QEMU knows nothing

Re: [PATCH 2/3] ARM: KVM: Fake up performance counters a little more precisely.

2012-05-14 Thread Christoffer Dall
On Thu, Mar 29, 2012 at 1:17 AM, Rusty Russell rusty.russ...@linaro.org wrote: Rather than just making all of c9 read-zero/write-discard, this changes it to the explicit profiling registers we need.  This is a start for the future implementation were we actually implement performance

Re: [PATCH] ARM: KVM: Check the cpuid we're being asked to emulate.

2012-05-14 Thread Christoffer Dall
On Thu, Mar 22, 2012 at 8:41 PM, Rusty Russell rusty.russ...@linaro.org wrote: As our emulation gets more sophisticated, we need to know what CPU model we're dealing with.  Particularly for some of the nastier workarounds. Let's start with Cortex A-15.  We can then test the MIDR elsewhere in

Re: [PATCH] ARM: KVM: Remove l2ctlr write.

2012-05-14 Thread Christoffer Dall
On Thu, Mar 22, 2012 at 8:40 PM, Rusty Russell ru...@rustcorp.com.au wrote: Current guests don't do this, and it's not clear what we should do if they try to turn on ECC or set various RAM latencies.  When someone does this, we'll have a better idea of what we should do about it.

Re: [PATCH] ARM: KVM: Check the cpuid we're being asked to emulate.

2012-05-20 Thread Christoffer Dall
On Wed, May 16, 2012 at 7:58 PM, Rusty Russell ru...@rustcorp.com.au wrote: On Mon, 14 May 2012 18:57:20 -0400, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Mar 22, 2012 at 8:41 PM, Rusty Russell rusty.russ...@linaro.org wrote: As our emulation gets more sophisticated, we

[PATCH v2] KVM: Cleanup the kvm_print functions and introduce pr_XX wrappers

2012-05-25 Thread Christoffer Dall
, ...) - vcpu_unimpl(vcpu, fmt, ...) Applies to kvm-next Changelog[2]: - Added PID to print functions - Renamed vcpu_pr_unimpl to vcpu_unimpl Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/x86/kvm/svm.c |6 +++-- arch/x86/kvm/vmx.c |2 +- arch/x86/kvm/x86.c

KVM/ARM: Goal: Cortex-A15 support

2011-05-05 Thread Christoffer Dall
I sent this out to the KVM/ARM mailing list, but figured KVM developers may be interested as well. Thanks, Christoffer -- Forwarded message -- From: Christoffer Dall cd...@cs.columbia.edu Date: Thu, May 5, 2011 at 7:49 PM Subject: Goal: Cortex-A15 support To: android-virt

[PATCH v3 0/8] KVM/ARM Implementation

2011-06-03 Thread Christoffer Dall
to commenting, but will keep up with this for next release version. Changes since v2: - Performs world-switch code - Maps guest memory using 2nd stage translation - Emulates co-processor 15 instructions - Forwards I/O faults to QEMU. --- Christoffer Dall (8): ARM: KVM: Initial skeleton

[PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-03 Thread Christoffer Dall
Targets KVM support for Cortex A-15 processors. Contains no real functionality but all the framework components, make files, header files and some tracing functionality. --- arch/arm/Kconfig |2 arch/arm/Makefile |1 arch/arm/include/asm/kvm.h

[PATCH v3 2/8] ARM: KVM: Hypervisor identity mapping

2011-06-03 Thread Christoffer Dall
Adds support in the identity mapping feature that allows KVM to setup identity mapping for the Hyp mode with the AP[1] bit set as required by the specification and also supports freeing created sub pmd's after finished use. --- arch/arm/include/asm/pgtable-3level-hwdef.h |1 +

[PATCH v3 3/8] ARM: KVM: Add hypervisor inititalization

2011-06-03 Thread Christoffer Dall
Sets up the required registers to run code in HYP-mode from the kernel. No major controversies, but we should consider how to deal with SMP support for hypervisor stack page. Works by setting the HVBAR the kernel can execute code in Hyp-mode with the MMU disabled which initializes other registers

[PATCH v3 4/8] ARM: KVM: Memory virtualization setup

2011-06-03 Thread Christoffer Dall
Initializes a blank level-1 translation table for the second stage translation and handles freeing it as well. --- arch/arm/include/asm/kvm_host.h |4 ++- arch/arm/include/asm/kvm_mmu.h |5 arch/arm/kvm/arm.c | 54 ++- 3 files

[PATCH v3 5/8] ARM: KVM: World-switch implementation

2011-06-03 Thread Christoffer Dall
Provides complete world-switch implementation to switch to other guests runinng in non-secure modes. Includes Hyp exception handlers that captures necessary exception information and stores the information on the VCPU and KVM structures. Only controversy may be the back-door call to __irq_svc

[PATCH v3 6/8] ARM: KVM: Emulation framework and CP15 emulation

2011-06-03 Thread Christoffer Dall
A few stub functions and support for emulating access to memory remap registers PRRR and NMRR. Provides some framework for handling trapped CP15 accesses in general. --- arch/arm/include/asm/kvm_emulate.h |7 ++ arch/arm/kvm/arm.c | 73 +++-

[PATCH v3 7/8] ARM: KVM: Handle guest faults in KVM

2011-06-03 Thread 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 memory for KVM guests. --- arch/arm/include/asm/pgtable-3level.h |9 +++

[PATCH v3 8/8] ARM: KVM: Handle I/O aborts

2011-06-03 Thread Christoffer Dall
When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information (physical address, read/write, length, register) and forwarding reads and writes to QEMU which performs the device emulation. This requires changing the general flow

Re: [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-03 Thread Christoffer Dall
thanks, I will fix this for next version. On Fri, Jun 3, 2011 at 5:53 PM, Jan Kiszka jan.kis...@siemens.com wrote: On 2011-06-03 17:31, Jan Kiszka wrote: On 2011-06-03 17:03, Christoffer Dall wrote: Targets KVM support for Cortex A-15 processors. Contains no real functionality but all

Re: [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 4:00 PM, Avi Kivity a...@redhat.com wrote: On 06/05/2011 03:52 PM, Avi Kivity wrote: (series review - please have a cover letter in the future for this stuff) Oh - you did - but in a separate thread.  Oh well. My internet router decided to reset immediately after

Re: [PATCH v3 4/8] ARM: KVM: Memory virtualization setup

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 2:41 PM, Avi Kivity a...@redhat.com wrote: On 06/03/2011 06:03 PM, Christoffer Dall wrote: Initializes a blank level-1 translation table for the second stage translation and handles freeing it as well. +       start = (unsigned long)kvm, +       end = start + sizeof

Re: [PATCH v3 4/8] ARM: KVM: Memory virtualization setup

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 5:14 PM, Avi Kivity a...@redhat.com wrote: On 06/05/2011 05:53 PM, Avi Kivity wrote: On 06/05/2011 05:50 PM, Christoffer Dall wrote: On Sun, Jun 5, 2011 at 2:41 PM, Avi Kivitya...@redhat.com  wrote:  On 06/03/2011 06:03 PM, Christoffer Dall wrote:  Initializes

Re: [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 2:36 PM, Avi Kivity a...@redhat.com wrote: On 06/03/2011 06:03 PM, Christoffer Dall wrote: Targets KVM support for Cortex A-15 processors. Contains no real functionality but all the framework components, make files, header files and some tracing functionality

Re: [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 4:58 PM, Jan Kiszka jan.kis...@web.de wrote: On 2011-06-05 16:18, Avi Kivity wrote: On 06/05/2011 05:13 PM, Jan Kiszka wrote: On 2011-06-05 14:21, Avi Kivity wrote:  On 06/03/2011 06:53 PM, Jan Kiszka wrote:     @@ -310,6 +310,7 @@ struct kvm_translation {      

Re: [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-05 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 5:14 PM, Jan Kiszka jan.kis...@web.de wrote: On 2011-06-05 17:10, Avi Kivity wrote: On 06/05/2011 05:58 PM, Jan Kiszka wrote:  Note that with KVM_SET_GSI_ROUTING (bad name for ARM...) we can even  choose if an irq line is connected to a kernel-emulated interrupt  

Re: [Android-virt] [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-10 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 6:27 PM, Alexander Graf ag...@suse.de wrote: On 05.06.2011, at 18:03, Christoffer Dall wrote: On Sun, Jun 5, 2011 at 2:36 PM, Avi Kivity a...@redhat.com wrote: On 06/03/2011 06:03 PM, Christoffer Dall wrote: [...] +if VIRTUALIZATION + +config KVM

Re: [Android-virt] [PATCH v3 1/8] ARM: KVM: Initial skeleton to compile KVM support

2011-06-10 Thread Christoffer Dall
On Fri, Jun 10, 2011 at 11:58 AM, Catalin Marinas catalin.mari...@arm.com wrote: On Fri, Jun 10, 2011 at 10:53:06AM +0100, Alexander Graf wrote: Am 10.06.2011 um 11:23 schrieb Catalin Marinas catalin.mari...@arm.com: On Fri, Jun 10, 2011 at 09:40:34AM +0100, Christoffer Dall wrote: OK, so I

Re: [PATCH v3 7/8] ARM: KVM: Handle guest faults in KVM

2011-06-11 Thread Christoffer Dall
On Sun, Jun 5, 2011 at 2:48 PM, Avi Kivity a...@redhat.com wrote: On 06/03/2011 06:04 PM, Christoffer Dall wrote: Handles the guest faults in KVM by mapping in corresponding user pages in the 2nd stage page tables. +static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa

Re: [PATCH v3 7/8] ARM: KVM: Handle guest faults in KVM

2011-06-12 Thread Christoffer Dall
 What are your thoughts about mmu notifier support? For what purpose? There is no swapping on ARM, so only case that jumps to my mind is for KSM. And I'm not quite there yet :) Really?  I imaging swapping will be needed for server workloads.  mmu notifiers are also useful for transparent

Re: [PATCH 0/4] ARM updates for kvmtool

2013-01-07 Thread Christoffer Dall
On Mon, Jan 7, 2013 at 1:14 PM, Will Deacon will.dea...@arm.com wrote: - virtio mmio fixes to deal with guest page sizes != 4k (in preparation for AArch64, which I will post separately). - .dtb dumping via the lkvm command line - Support for PSCI firmware as a

[PATCH v5 00/14] KVM/ARM Implementation

2013-01-08 Thread Christoffer Dall
more CP15 accesses - Support guest WFI calls - Uses debugfs instead of /proc - Support compiling in Thumb mode Changes since v2: - Performs world-switch code - Maps guest memory using 2nd stage translation - Emulates co-processor 15 instructions - Forwards I/O faults to QEMU. --- Christoffer

[PATCH v5 01/14] ARM: Add page table and page defines needed by KVM

2013-01-08 Thread Christoffer Dall
mappings - page_s2_device: Stage-2 device mappings (vgic access) Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/pgtable-3level.h | 18 ++ arch/arm/include/asm/pgtable.h|7 +++ arch/arm/mm

[PATCH v5 02/14] ARM: Section based HYP idmap

2013-01-08 Thread Christoffer Dall
will.dea...@arm.com Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/idmap.h|1 + arch/arm/include/asm/pgtable-3level-hwdef.h |1 + arch/arm

[PATCH v5 03/14] KVM: ARM: Initial skeleton to compile KVM support

2013-01-08 Thread Christoffer Dall
-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Rusty Russell rusty.russ...@linaro.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- Documentation/virtual/kvm/api.txt | 57 +- arch/arm/Kconfig |2

[PATCH v5 05/14] KVM: ARM: Memory virtualization setup

2013-01-08 Thread Christoffer Dall
...@redhat.com Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_asm.h |2 arch/arm/include/asm/kvm_host.h | 19 ++ arch/arm/include/asm/kvm_mmu.h |9 + arch/arm/kvm/Kconfig|1 arch/arm

[PATCH v5 06/14] KVM: ARM: Inject IRQs and FIQs from userspace

2013-01-08 Thread Christoffer Dall
From: Christoffer Dall cd...@cs.columbia.edu All interrupt injection is now based on the VM ioctl KVM_IRQ_LINE. This works semantically well for the GIC as we in fact raise/lower a line on a machine component (the gic). The IOCTL uses the follwing struct. struct kvm_irq_level { union

[PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-08 Thread Christoffer Dall
...@redhat.com Signed-off-by: Rusty Russell rusty.russ...@linaro.org Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arm.h | 51 arch/arm/include

[PATCH v5 08/14] KVM: ARM: Emulation framework and CP15 emulation

2013-01-08 Thread Christoffer Dall
University + * Authors: Christoffer Dall c.d...@virtualopensystems.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. + * + * This program is distributed

[PATCH v5 09/14] KVM: ARM: User space API for getting/setting co-proc registers

2013-01-08 Thread Christoffer Dall
. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Rusty Russell rusty.russ...@linaro.org Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- Documentation/virtual/kvm/api.txt |5 + arch/arm/include/asm/kvm_coproc.h |9 + arch/arm/include/asm/kvm_host.h |4

[PATCH v5 11/14] KVM: ARM: VFP userspace interface

2013-01-08 Thread Christoffer Dall
From: Rusty Russell rusty.russ...@linaro.org We use space #18 for floating point regs. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- Documentation/virtual/kvm/api.txt |6

[PATCH v5 14/14] KVM: ARM: Add maintainer entry for KVM/ARM

2013-01-08 Thread Christoffer Dall
Add an entry in the MAINTAINERS file for KVM/ARM. Cc: Russell King li...@arm.linux.org.uk Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- MAINTAINERS |8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fa309ab..8349bac 100644

[PATCH v5 13/14] KVM: ARM: Handle I/O aborts

2013-01-08 Thread Christoffer Dall
the physical address, but now that's the wrong thing. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Rusty Russell rusty.russ...@linaro.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm

[PATCH v5 12/14] KVM: ARM: Handle guest faults in KVM

2013-01-08 Thread Christoffer Dall
enough to remind us of this massive pain. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_asm.h |2 + arch/arm/include/asm/kvm_mmu.h | 12 +++ arch

[PATCH v5 00/12] KVM/ARM vGIC support

2013-01-08 Thread Christoffer Dall
physical addresses and instead provide the address through the KVM_SET_DEVICE_ADDRESS ioctl. - Fix level/edge bugs - Fix reboot bug: retire queued, disabled interrupts --- Christoffer Dall (2): KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl ARM: KVM: VGIC accept vcpu and dist

[PATCH v5 01/12] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2013-01-08 Thread Christoffer Dall
accesses within a certain address range or directly map a device with virtualiation extensions into the guest address space. We try to make this API slightly more generic than for our specific use, but so far only the VGIC uses this feature. Signed-off-by: Christoffer Dall c.d

[PATCH v5 02/12] ARM: KVM: Keep track of currently running vcpus

2013-01-08 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_host.h | 10 ++ arch/arm/kvm/arm.c | 30 ++ 2 files changed, 40 insertions(+) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index

[PATCH v5 03/12] ARM: gic: define GICH offsets for VGIC support

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com The GICH_* constants are defined by the GIC HW spec, and even though they only be used by KVM to begin with, define them generically in gic.h. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com

[PATCH v5 04/12] ARM: KVM: Initial VGIC infrastructure code

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Wire the basic framework code for VGIC support and the initial in-kernel MMIO support code for the VGIC, used for the distributor emulation. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com

[PATCH v5 06/12] ARM: KVM: VGIC distributor handling

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Add the GIC distributor emulation code. A number of the GIC features are simply ignored as they are not required to boot a Linux guest. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch

[PATCH v5 07/12] ARM: KVM: VGIC virtual CPU interface management

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Add VGIC virtual CPU interface code, picking pending interrupts from the distributor and stashing them in the VGIC control interface list registers. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d

[PATCH v5 08/12] ARM: KVM: vgic: retire queued, disabled interrupts

2013-01-08 Thread Christoffer Dall
). The solution is to examine already active LRs, and check the interrupt is still enabled. If not, just retire it. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/vgic.c | 30 ++ 1 file changed, 30

[PATCH v5 09/12] ARM: KVM: VGIC interrupt injection

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Plug the interrupt injection code. Interrupts can now be generated from user space. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h |8 +++ arch/arm/kvm

[PATCH v5 10/12] ARM: KVM: VGIC control interface world switch

2013-01-08 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Enable the VGIC control interface to be save-restored on world switch. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kernel/asm-offsets.c | 12 ++ arch/arm/kvm

<    1   2   3   4   5   6   7   8   9   10   >