Re: [Android-virt] Ideas wiki for GSoC 2010

2010-03-12 Thread Christoffer Dall
On Thu, Mar 11, 2010 at 1:15 PM, Avi Kivity a...@redhat.com wrote: On 03/11/2010 02:03 PM, Alexander Graf wrote: Another idea I'd have would be upstream integration (and cleanup) of the ARM KVM port: https://wiki.ncl.cs.columbia.edu/wiki/index.php/AndroidVirt:MainPage Huh, didn't even

[RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-13 Thread Christoffer Dall
with how user space (read QEMU) first builds the individual devices and later sets up the emulated platform. Comments welcome! Christoffer Dall (3): KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl KVM: ARM: Split KVM_CREATE_IRQCHIP and KVM_INIT_IRQCHIP

[RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl

2012-10-13 Thread Christoffer Dall
been provided for the emulated platform (patch is following), but before the CPU is initally run. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- Documentation/virtual/kvm/api.txt | 16 arch/arm/kvm/arm.c|1 + include/linux/kvm.h

[RFC PATCH 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-13 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

[RFC PATCH 3/3] KVM: ARM: Split KVM_CREATE_IRQCHIP and KVM_INIT_IRQCHIP

2012-10-13 Thread Christoffer Dall
on init. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h |6 ++ arch/arm/kvm/arm.c |6 ++ arch/arm/kvm/vgic.c | 40 +++ 3 files changed, 44 insertions(+), 8 deletions

[PATCH] KVM: Take kvm instead of vcpu to mmu_notifier_retry

2012-10-14 Thread Christoffer Dall
The mmu_notifier_retry is not specific to any vcpu (and never will be) so only take struct kvm as a parameter. The motivation is the ARM mmu code that needs to call this from somewhere where we long let go of the vcpu pointer. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com

Re: [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl

2012-10-17 Thread Christoffer Dall
On Wed, Oct 17, 2012 at 4:21 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 14 October 2012 01:04, Christoffer Dall c.d...@virtualopensystems.com wrote: Used to initialize the in-kernel interrupt controller. On ARM we need to map the virtual generic interrupt controller (vGIC) into Hyp

Re: [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl

2012-10-17 Thread Christoffer Dall
On Wed, Oct 17, 2012 at 4:31 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 17 October 2012 21:23, Christoffer Dall c.d...@virtualopensystems.com wrote: On Wed, Oct 17, 2012 at 4:21 PM, Peter Maydell peter.mayd...@linaro.org wrote: +for the emulated platofrm (see KVM_SET_DEVICE_ADDRESS

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-17 Thread Christoffer Dall
On Wed, Oct 17, 2012 at 4:38 PM, Alexander Graf ag...@suse.de wrote: On 10/14/2012 02:04 AM, Christoffer Dall wrote: *** warning: this RFC patch series is only compile-tested *** We need a way to specify the address at which we expect VMs to access the interrupt controller (both the emulated

Re: [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-18 Thread Christoffer Dall
On Wed, Oct 17, 2012 at 7:58 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Thu, 2012-10-18 at 09:10 +1100, Paul Mackerras wrote: With the XICS, there are two types of irqchip: a source controller and a presentation controller. There is one presentation controller per vcpu and

Re: [PATCH 0/3] KVM_VCPU_GET_REG_LIST API

2012-10-19 Thread Christoffer Dall
On Fri, Oct 19, 2012 at 2:19 AM, Rusty Russell ru...@rustcorp.com.au wrote: Rusty Russell ru...@rustcorp.com.au writes: Avi Kivity a...@redhat.com writes: On 09/05/2012 10:58 AM, Rusty Russell wrote: This is the generic part of the KVM_SET_ONE_REG/KVM_GET_ONE_REG enhancements which ARM wants,

Re: [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl

2012-10-19 Thread Christoffer Dall
On Thu, Oct 18, 2012 at 8:20 AM, Avi Kivity a...@redhat.com wrote: On 10/14/2012 02:04 AM, Christoffer Dall wrote: Used to initialize the in-kernel interrupt controller. On ARM we need to map the virtual generic interrupt controller (vGIC) into Hyp the guest's physicall address space so

Re: [RFC PATCH 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-19 Thread Christoffer Dall
On Wed, Oct 17, 2012 at 4:29 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 14 October 2012 01:04, Christoffer Dall c.d...@virtualopensystems.com wrote: On ARM (and possibly other architectures) some bits are specific to the model being emulated for the guest and user space needs a way

Re: [RFC PATCH 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-19 Thread Christoffer Dall
On Fri, Oct 19, 2012 at 4:24 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 19 October 2012 19:46, Christoffer Dall c.d...@virtualopensystems.com wrote: On Wed, Oct 17, 2012 at 4:29 PM, Peter Maydell peter.mayd...@linaro.org wrote: This doesn't say whether userspace is allowed to make

Re: [RFC PATCH 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-19 Thread Christoffer Dall
On Fri, Oct 19, 2012 at 4:27 PM, Christoffer Dall c.d...@virtualopensystems.com wrote: On Fri, Oct 19, 2012 at 4:24 PM, Peter Maydell peter.mayd...@linaro.org wrote: On 19 October 2012 19:46, Christoffer Dall c.d...@virtualopensystems.com wrote: On Wed, Oct 17, 2012 at 4:29 PM, Peter Maydell

[PATCH 0/2] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-19 Thread Christoffer Dall
performs the required mappings for a VM on the first execution of a VCPU. Christoffer Dall (2): KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl KVM: ARM: Defer parts of the vgic init until first KVM_RUN Documentation/virtual/kvm/api.txt | 37 ++ arch/arm/include/asm/kvm.h

[PATCH 1/2] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-19 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 2/2] KVM: ARM: Defer parts of the vgic init until first KVM_RUN

2012-10-19 Thread Christoffer Dall
setting global for all VMs, but this is not a requirement and when we want to emulate several boards on a single host, we need the flexibility of storing these guest addresses on a per-VM basis. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h

Re: [kvmarm] [PATCH 2/2] KVM: ARM: Defer parts of the vgic init until first KVM_RUN

2012-10-20 Thread Christoffer Dall
On Sat, Oct 20, 2012 at 6:27 AM, Marc Zyngier marc.zyng...@arm.com wrote: On Sat, 20 Oct 2012 00:14:42 -0400, Christoffer Dall c.d...@virtualopensystems.com wrote: The vgic virtual cpu and emulated distributor interfaces must be mapped at a given physical address in the guest. This address

[PATCH v2 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses

2012-10-20 Thread Christoffer Dall
aligned addresses on vgic_set_devic_address - Move vgic_cpu_base for host to vgic_hyp_init - Fix irqchip_in_kernel to be VM-specific --- Christoffer Dall (3): KVM: ARM: Check for overlaps of mapped io addresses KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl KVM: ARM: Defer parts

[PATCH v2 1/3] KVM: ARM: Check for overlaps of mapped io addresses

2012-10-20 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/mmu.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 0ab098e..e5ace0e 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -422,7 +422,7 @@ static

[PATCH v2 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-20 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 v2 3/3] KVM: ARM: Defer parts of the vgic init until first KVM_RUN

2012-10-20 Thread Christoffer Dall
setting global for all VMs, but this is not a requirement and when we want to emulate several boards on a single host, we need the flexibility of storing these guest addresses on a per-VM basis. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h

[PATCH] fixup! KVM: ARM: Check for overlaps of mapped io addresses

2012-10-20 Thread Christoffer Dall
Missed a commit of my working tree, so accidentally sent out the wrong patch. This fixes it. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/mmu.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm

[PATCH v3 00/14] KVM/ARM Implementation

2012-10-22 Thread Christoffer Dall
- 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 Dall (13): ARM: Add page table and page defines needed by KVM ARM

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

2012-10-22 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 v3 02/14] ARM: Section based HYP idmap

2012-10-22 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|5 ++ arch/arm/include/asm/pgtable-3level-hwdef.h |1 arch

[PATCH v3 03/14] ARM: Factor out cpuid implementor and part number

2012-10-22 Thread Christoffer Dall
Decoding the implementor and part number of the CPU id in the CPU ID register is needed by KVM, so we factor it out to share the code. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/cputype.h | 26

[PATCH v3 04/14] KVM: ARM: Initial skeleton to compile KVM support

2012-10-22 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 | 58 ++ arch/arm/Kconfig |2

[PATCH v3 05/14] KVM: ARM: Hypervisor inititalization

2012-10-22 Thread Christoffer Dall
); - free_hyp_pmds(); 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_arm.h | 107 ++ arch/arm/include/asm/kvm_asm.h | 20 +++ arch

[PATCH v3 06/14] KVM: ARM: Memory virtualization setup

2012-10-22 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 v3 07/14] KVM: ARM: Inject IRQs and FIQs from userspace

2012-10-22 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 v3 08/14] KVM: ARM: World-switch implementation

2012-10-22 Thread Christoffer Dall
-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 | 38 arch/arm/include/asm/kvm_host.h |9 + arch/arm/kernel/asm-offsets.c | 23

[PATCH v3 09/14] KVM: ARM: Emulation framework and CP15 emulation

2012-10-22 Thread Christoffer Dall
/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 4b9dad8..722efe3 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2012 - Virtual Open Systems and Columbia University - * Author: Christoffer Dall c.d...@virtualopensystems.com + * Authors: Rusty

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

2012-10-22 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 | 44 + arch/arm/include/asm/kvm_coproc.h |9 + arch/arm/include/asm/kvm_host.h

[PATCH v3 11/14] KVM: ARM: Demux CCSIDR in the userspace API

2012-10-22 Thread Christoffer Dall
The Cache Size Selection Register (CSSELR) selects the current Cache Size ID Register (CCSIDR). You write which cache you are interested in to CSSELR, and read the information out of CCSIDR. Which cache numbers are valid is known by reading the Cache Level ID Register (CLIDR). To export this

[PATCH v3 12/14] KVM: ARM: VFP userspace interface

2012-10-22 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 v3 14/14] KVM: ARM: Handle I/O aborts

2012-10-22 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 v3 00/13] KVM/ARM vGIC support

2012-10-22 Thread Christoffer Dall
bugs - Fix reboot bug: retire queued, disabled interrupts This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch: kvm-arm-v13-vgic --- Christoffer Dall (2): KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl ARM: KVM

[PATCH v3 01/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-10-22 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 v3 02/13] ARM: KVM: Keep track of currently running vcpus

2012-10-22 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 v3 03/13] ARM: KVM: Initial VGIC infrastructure support

2012-10-22 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Wire the basic framework code for VGIC support. Nothing to enable yet. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_host.h |7 arch/arm/include/asm

[PATCH v3 04/13] ARM: KVM: Initial VGIC MMIO support code

2012-10-22 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Wire 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 --- arch/arm/include/asm/kvm_vgic.h |6

[PATCH v3 05/13] ARM: KVM: VGIC accept vcpu and dist base addresses from user space

2012-10-22 Thread Christoffer Dall
. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_mmu.h |2 + arch/arm/include/asm/kvm_vgic.h |9 ++ arch/arm/kvm/arm.c | 16 ++ arch/arm/kvm/vgic.c | 61 +++ 4 files changed

[PATCH v3 06/13] ARM: KVM: VGIC distributor handling

2012-10-22 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 v3 07/13] ARM: KVM: VGIC virtual CPU interface management

2012-10-22 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 v3 08/13] ARM: KVM: vgic: retire queued, disabled interrupts

2012-10-22 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 v3 09/13] ARM: KVM: VGIC interrupt injection

2012-10-22 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 v3 10/13] ARM: KVM: VGIC control interface world switch

2012-10-22 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/include/asm/kvm_arm.h | 12 +++ arch/arm/kernel/asm

[PATCH v3 11/13] ARM: KVM: VGIC initialisation code

2012-10-22 Thread Christoffer Dall
marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h | 11 ++ arch/arm/kvm/arm.c | 14 ++ arch/arm/kvm/vgic.c | 237 +++ 3 files changed, 258 insertions(+), 4 deletions

[PATCH v3 12/13] ARM: KVM: vgic: reduce the number of vcpu kick

2012-10-22 Thread Christoffer Dall
of the VGIC, injecting the new interrupts. 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 | 10 ++ arch/arm/kvm/arm.c | 10 +- arch/arm/kvm/vgic.c | 10

[PATCH v3 13/13] ARM: KVM: Add VGIC configuration option

2012-10-22 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com It is now possible to select the VGIC configuration option. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/Kconfig |7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH v3 0/5] KVM/ARM Architected Timers support

2012-10-22 Thread Christoffer Dall
The following series implements support for the architected generic timers for KVM/ARM. This is an unmodified repost of the previously submitted series. This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch:

[PATCH v3 1/5] ARM: arch_timers: switch to physical timers if HYP mode is available

2012-10-22 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com If we're booted in HYP mode, it is possible that we'll run some kind of virtualized environment. In this case, it is a better to switch to the physical timers, and leave the virtual timers to guests. Signed-off-by: Marc Zyngier marc.zyng...@arm.com ---

[PATCH v3 2/5] ARM: KVM: arch_timers: Add minimal infrastructure

2012-10-22 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arch_timer.h | 45 + arch/arm/include/asm/kvm_host.h |5 arch/arm/kvm/interrupts.S |2 + arch/arm/kvm/interrupts_head.S| 19 ++ 4 files changed

[PATCH v3 4/5] ARM: KVM: arch_timers: Add timer world switch

2012-10-22 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kernel/asm-offsets.c |8 arch/arm/kvm/arm.c |3 +++ arch/arm/kvm/interrupts_head.S | 41 3 files changed, 52 insertions(+) diff --git a/arch/arm/kernel/asm-offsets.c b

[PATCH v3 5/5] ARM: KVM: arch_timers: Wire the init code and config option

2012-10-22 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com It is now possible to select CONFIG_KVM_ARM_TIMER to enable the KVM architected timer support. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/Kconfig |7 +++ arch

[PATCH v3 3/5] ARM: KVM: arch_timers: Add guest timer core support

2012-10-22 Thread Christoffer Dall
- A hrtimer we programmed earlier has fired Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arch_timer.h | 57 + arch/arm/kvm/reset.c |9 + arch/arm/kvm/timer.c

Re: [PATCH 0/3] KVM_VCPU_GET_REG_LIST API

2012-10-22 Thread Christoffer Dall
On Mon, Oct 22, 2012 at 1:45 PM, Will Deacon will.dea...@arm.com wrote: On Mon, Oct 22, 2012 at 04:09:06AM +0100, Rusty Russell wrote: Christoffer Dall c.d...@virtualopensystems.com writes: On Fri, Oct 19, 2012 at 2:19 AM, Rusty Russell ru...@rustcorp.com.au wrote: Wait, what? kvm/arm

Alignment issue with transparent huge pages

2012-10-29 Thread Christoffer Dall
Hi, I am seeing an interesting case on KVM/ARM where a user memory region is not aligned with the guest physical memory address with respect to huge page size. This clearly makes it impossible for us to leverage transparent huge pages for stage-2 mappings on ARM. The question is, if this is

[RFC PATCH 0/4] KVM: ARM: Support transparent huge pages and hugetlbfs

2012-11-02 Thread Christoffer Dall
kvm-arm-hugetlb Christoffer Dall (4): KVM: ARM: Report support of mmu notifiers to user space KVM: ARM: Fixup trace ipa printing KVM: ARM: Improve stage2_clear_pte KVM: ARM: Transparent huge pages and hugetlbfs support arch/arm/include/asm/kvm_host.h |6 +- arch/arm/kvm/arm.c

[RFC PATCH 1/4] KVM: ARM: Report support of mmu notifiers to user space

2012-11-02 Thread Christoffer Dall
This should have been added a long time ago, and is at least required for user space to take advantage of hugetlbfs. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/arm.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c

[RFC PATCH 2/4] KVM: ARM: Fixup trace ipa printing

2012-11-02 Thread Christoffer Dall
The arguments where shifted and printed a 64 bit integer as a 32 bit integer. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/trace.h |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h index

[RFC PATCH 3/4] KVM: ARM: Improve stage2_clear_pte

2012-11-02 Thread Christoffer Dall
Factor out parts of the functionality to make the code more readable and rename to unmap_stage2_range while supporting unmapping ranges in one go. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/mmu.c | 122 +++- 1

[RFC PATCH 4/4] KVM: ARM: Transparent huge pages and hugetlbfs support

2012-11-02 Thread Christoffer Dall
Support transparent huge pages in KVM/ARM. This requires quite a bit of checkint and for qemu support to take advantage of this, you need to make sure qemu allocates pages on aligned to the PMD size. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm

Re: [kvmarm] [PATCH v3 01/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-11-10 Thread Christoffer Dall
On Fri, Nov 9, 2012 at 2:51 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Fri, 2012-11-09 at 14:45 +0100, Peter Maydell wrote: On 22 October 2012 08:51, Christoffer Dall c.d...@virtualopensystems.com wrote: +struct kvm_device_address { + __u32 id; + __u64 addr

[PATCH v4 00/14] KVM/ARM Implementation

2012-11-10 Thread Christoffer Dall
- 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 Dall (13): ARM

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

2012-11-10 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 v4 02/14] ARM: Section based HYP idmap

2012-11-10 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|5 ++ arch/arm/include/asm/pgtable-3level-hwdef.h |1 arch/arm

[PATCH v4 03/14] ARM: Factor out cpuid implementor and part number

2012-11-10 Thread Christoffer Dall
Decoding the implementor and part number of the CPU id in the CPU ID register is needed by KVM, so we factor it out to share the code. Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/cputype.h | 26

[PATCH v4 04/14] KVM: ARM: Initial skeleton to compile KVM support

2012-11-10 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 | 58 ++ arch/arm/Kconfig |2

[PATCH v4 05/14] KVM: ARM: Hypervisor inititalization

2012-11-10 Thread Christoffer Dall
); - free_hyp_pmds(); 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_arm.h | 107 ++ arch/arm/include/asm/kvm_asm.h | 20 +++ arch

[PATCH v4 06/14] KVM: ARM: Memory virtualization setup

2012-11-10 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 v4 07/14] KVM: ARM: Inject IRQs and FIQs from userspace

2012-11-10 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 v4 08/14] KVM: ARM: World-switch implementation

2012-11-10 Thread Christoffer Dall
-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 | 42 arch/arm/include/asm/kvm_host.h |9 + arch/arm/kernel/asm-offsets.c | 23

[PATCH v4 09/14] KVM: ARM: Emulation framework and CP15 emulation

2012-11-10 Thread Christoffer Dall
/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 4b9dad8..722efe3 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2012 - Virtual Open Systems and Columbia University - * Author: Christoffer Dall c.d...@virtualopensystems.com + * Authors: Rusty Russell

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

2012-11-10 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 | 44 + arch/arm/include/asm/kvm_coproc.h |9 + arch/arm/include/asm/kvm_host.h

[PATCH v4 11/14] KVM: ARM: Demux CCSIDR in the userspace API

2012-11-10 Thread Christoffer Dall
The Cache Size Selection Register (CSSELR) selects the current Cache Size ID Register (CCSIDR). You write which cache you are interested in to CSSELR, and read the information out of CCSIDR. Which cache numbers are valid is known by reading the Cache Level ID Register (CLIDR). To export this

[PATCH v4 12/14] KVM: ARM: VFP userspace interface

2012-11-10 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 v4 13/14] KVM: ARM: Handle guest faults in KVM

2012-11-10 Thread Christoffer Dall
...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arm.h |9 ++ arch/arm/include/asm/kvm_asm.h |2 + arch/arm/kvm/mmu.c | 145 arch/arm/kvm/trace.h | 26 +++ 4 files changed

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

2012-11-10 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 v4 00/13] KVM/ARM vGIC support

2012-11-10 Thread Christoffer Dall
the address through the KVM_SET_DEVICE_ADDRESS ioctl. - Fix level/edge bugs - Fix reboot bug: retire queued, disabled interrupts This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch: kvm-arm-v13-vgic --- Christoffer Dall (2

[PATCH v4 01/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2012-11-10 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 v4 02/13] ARM: KVM: Keep track of currently running vcpus

2012-11-10 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 v4 03/13] ARM: KVM: Initial VGIC infrastructure support

2012-11-10 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Wire the basic framework code for VGIC support. Nothing to enable yet. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_host.h |7 arch/arm/include/asm

[PATCH v4 04/13] ARM: KVM: Initial VGIC MMIO support code

2012-11-10 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com Wire 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 --- arch/arm/include/asm/kvm_vgic.h |6

[PATCH v4 05/13] ARM: KVM: VGIC accept vcpu and dist base addresses from user space

2012-11-10 Thread Christoffer Dall
. Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_mmu.h |2 + arch/arm/include/asm/kvm_vgic.h |9 ++ arch/arm/kvm/arm.c | 16 ++ arch/arm/kvm/vgic.c | 61 +++ 4 files changed

[PATCH v4 06/13] ARM: KVM: VGIC distributor handling

2012-11-10 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 v4 07/13] ARM: KVM: VGIC virtual CPU interface management

2012-11-10 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 v4 08/13] ARM: KVM: vgic: retire queued, disabled interrupts

2012-11-10 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 v4 09/13] ARM: KVM: VGIC interrupt injection

2012-11-10 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 v4 10/13] ARM: KVM: VGIC control interface world switch

2012-11-10 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/include/asm/kvm_arm.h | 12 +++ arch/arm/kernel/asm

[PATCH v4 11/13] ARM: KVM: VGIC initialisation code

2012-11-10 Thread Christoffer Dall
marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_vgic.h | 11 ++ arch/arm/kvm/arm.c | 14 ++ arch/arm/kvm/vgic.c | 237 +++ 3 files changed, 258 insertions(+), 4 deletions

[PATCH v4 12/13] ARM: KVM: vgic: reduce the number of vcpu kick

2012-11-10 Thread Christoffer Dall
of the VGIC, injecting the new interrupts. 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 | 10 ++ arch/arm/kvm/arm.c | 10 +- arch/arm/kvm/vgic.c | 10

[PATCH v4 13/13] ARM: KVM: Add VGIC configuration option

2012-11-10 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com It is now possible to select the VGIC configuration option. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kvm/Kconfig |7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH v4 0/5] KVM/ARM Architected Timers support

2012-11-10 Thread Christoffer Dall
The following series implements support for the architected generic timers for KVM/ARM. This is an unmodified repost of the previously submitted series. This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch:

[PATCH v4 1/5] ARM: arch_timers: switch to physical timers if HYP mode is available

2012-11-10 Thread Christoffer Dall
From: Marc Zyngier marc.zyng...@arm.com If we're booted in HYP mode, it is possible that we'll run some kind of virtualized environment. In this case, it is a better to switch to the physical timers, and leave the virtual timers to guests. Signed-off-by: Marc Zyngier marc.zyng...@arm.com ---

[PATCH v4 2/5] ARM: KVM: arch_timers: Add minimal infrastructure

2012-11-10 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arch_timer.h | 45 + arch/arm/include/asm/kvm_host.h |5 arch/arm/kvm/interrupts.S |2 + arch/arm/kvm/interrupts_head.S| 19 ++ 4 files changed

[PATCH v4 3/5] ARM: KVM: arch_timers: Add guest timer core support

2012-11-10 Thread Christoffer Dall
- A hrtimer we programmed earlier has fired Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/include/asm/kvm_arch_timer.h | 57 + arch/arm/kvm/reset.c |9 + arch/arm/kvm/timer.c

[PATCH v4 4/5] ARM: KVM: arch_timers: Add timer world switch

2012-11-10 Thread Christoffer Dall
-by: Christoffer Dall c.d...@virtualopensystems.com --- arch/arm/kernel/asm-offsets.c |8 arch/arm/kvm/arm.c |3 +++ arch/arm/kvm/interrupts_head.S | 41 3 files changed, 52 insertions(+) diff --git a/arch/arm/kernel/asm-offsets.c b

  1   2   3   4   5   6   7   8   9   10   >