[PATCH v7 00/12] KVM/ARM Implementation

2012-03-11 Thread Christoffer Dall
ndles 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. --- Christ

[PATCH v7 01/12] KVM: Introduce __KVM_HAVE_IRQ_LINE

2012-03-11 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 --- arch/ia64/includ

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

2012-03-11 Thread Christoffer Dall
From: 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

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

2012-03-11 Thread Christoffer Dall
From: 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. “Nothing to see here. Move along, move along..." Most functionality is in arch/arm/kvm/* or arc

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

2012-03-11 Thread Christoffer Dall
From: Christoffer Dall 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 and enables the MMU

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

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

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

2012-03-11 Thread Christoffer Dall
functions are called from the main KVM code. Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_mmu.h |5 ++ arch/arm/kvm/arm.c | 65 ++--- arch/arm/kvm/mmu.c | 103 3 files changed, 165

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

2012-03-11 Thread Christoffer Dall
From: Christoffer Dall 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 on and whether the FIQ

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

2012-03-11 Thread Christoffer Dall
From: Christoffer Dall 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 to Hyp mode is done

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

2012-03-11 Thread Christoffer Dall
From: Christoffer Dall 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 what caused the exit

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

2012-03-11 Thread Christoffer Dall
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 memory for KVM guests. Leverages MMU notifiers on KVM/ARM

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

2012-03-11 Thread Christoffer Dall
From: 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. Certain classes of

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

2012-03-11 Thread Christoffer Dall
From: Christoffer Dall 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 a KVM guest is

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 wrote: > 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. >> >> Introduc

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 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

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 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 wrote: >>> >>> On 10.02.2012, at 02:40, Chris

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 Date: Thu, May 5, 2011 at 7:49 PM Subject: Goal: Cortex-A15 support To: android-virt Cc: Catalin Marinas For

[PATCH v3 0/8] KVM/ARM Implementation

2011-06-03 Thread Christoffer Dall
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 to

[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 + arch/arm/include

[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 change

[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 (the

[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 +++- arch/arm/kvm/arm_emul

[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 +++ arch/a

[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 somew

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 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

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 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 sending the

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 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

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 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 Kivity  wrote: >>> >  On 06/03/2011 06:03 PM, Christoffer D

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 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 fil

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 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 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 wrote: > > On 05.06.2011, at 18:03, Christoffer Dall wrote: > > On Sun, Jun 5, 2011 at 2:36 PM, Avi Kivity wrote: > > On 06/03/2011 06:03 PM, Christoffer Dall wrote: > > > [...] > > +if VIRTUALIZATION > > + &

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 wrote: > On Fri, Jun 10, 2011 at 10:53:06AM +0100, Alexander Graf wrote: >> Am 10.06.2011 um 11:23 schrieb Catalin Marinas : >> > On Fri, Jun 10, 2011 at 09:40:34AM +0100, Christoffer Dall wrote: >> >> OK, so I look

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 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

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 f

Re: randconfig errors

2013-02-15 Thread Christoffer Dall
On Fri, Feb 15, 2013 at 2:22 PM, Marc Zyngier wrote: > On 15/02/13 19:16, Christoffer Dall wrote: >> On Fri, Feb 15, 2013 at 1:47 PM, Marc Zyngier wrote: >>> On Fri, 15 Feb 2013 19:22:37 +0100, Marc Zyngier >>> wrote: >>>> On Fri, 15 Feb 2013

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

2013-02-18 Thread Christoffer Dall
On Mon, Feb 18, 2013 at 3:01 PM, Scott Wood wrote: > On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: >> >> Copying Christoffer since ARM has in kernel irq chip too. >> >> On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: >> > Currently, devices that are emulated inside KVM are configured

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

2013-02-18 Thread Christoffer Dall
On Wed, Feb 13, 2013 at 9:49 PM, Scott Wood wrote: > Currently, devices that are emulated inside KVM are configured in a > hardcoded manner based on an assumption that any given architecture > only has one way to do it. If there's any need to access device state, > it is done through inflexible o

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

2013-02-18 Thread Christoffer Dall
On Mon, Feb 18, 2013 at 4:53 PM, Scott Wood wrote: > On 02/18/2013 06:44:20 PM, Christoffer Dall wrote: >> >> On Wed, Feb 13, 2013 at 9:49 PM, Scott Wood >> wrote: >> > index 0350e0d..dbaf012 100644 >> > --- a/include/linux/kvm_host.h >> > +++ b

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

2013-02-19 Thread Christoffer Dall
On Tue, Feb 19, 2013 at 4:24 AM, Gleb Natapov wrote: > On Mon, Feb 18, 2013 at 05:01:40PM -0600, Scott Wood wrote: >> On 02/18/2013 06:21:59 AM, Gleb Natapov wrote: >> >Copying Christoffer since ARM has in kernel irq chip too. >> > >> >On Wed, Feb 13, 2013 at 11:49:15PM -0600, Scott Wood wrote: >>

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

2013-02-19 Thread Christoffer Dall
On Tue, Feb 19, 2013 at 12:16 PM, Scott Wood wrote: > On 02/18/2013 11:50:44 PM, Christoffer Dall wrote: >> >> On Mon, Feb 18, 2013 at 4:53 PM, Scott Wood >> wrote: >> > On 02/18/2013 06:44:20 PM, Christoffer Dall wrote: >> >> >> >> On Wed,

Re: [PATCH v7 00/11] QEMU: Support KVM on ARM

2013-03-06 Thread Christoffer Dall
On Tue, Feb 26, 2013 at 05:40:10PM +, Peter Maydell wrote: > KVM ARM support has just hit Linus' kernel tree, so we can > finally commit this series to QEMU. Since all the patches got > reviewed last time round this should be ready to commit. > I plan to commit this via arm-devs.next. > > NB:

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

2013-03-06 Thread Christoffer Dall
On Tue, Mar 05, 2013 at 02:42:54AM +, Marc Zyngier wrote: > This patch series is reworking KVM/arm in order to prepare the code > to be shared with the upcoming KVM/arm64. > > Nothing major here, just a lot of accessors, small cleanups and fixes > to make the code useable on arm64. > > This c

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

2013-03-06 Thread Christoffer Dall
xes for you to fetch changes up to f42798c6898bf1e536673e798d263e492355162f: ARM: KVM: Fix length of mmio access (2013-03-06 16:01:51 -0800) -------- Christoffer Dall (1): KVM: ARM: Reintroduce trace_kvm_hvc Jonghwan Choi (1):

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

2013-03-06 Thread Christoffer Dall
On Tue, Mar 05, 2013 at 03:18:00AM +, Marc Zyngier wrote: > In order to be able to correctly profile what is happening on the > host, we need to be able to identify when we're running on the guest, > and log these events differently. > > Perf offers a simple way to register callbacks into KVM.

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

2013-03-06 Thread Christoffer Dall
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/ARM fixes mostly centered around preparation for >> Marc's ARMv8 KVM work. > &

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

2013-03-07 Thread Christoffer Dall
On Thu, Mar 7, 2013 at 10:40 AM, Gleb Natapov 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] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-07 Thread Christoffer Dall
On Thu, Mar 7, 2013 at 11:09 AM, 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] [GIT PULL v2] KVM/ARM Fixes for 3.9-rc1

2013-03-08 Thread Christoffer Dall
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 2013 20:40:00 -0800, Christoffer Dall >>> >>> wrote: >

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

2013-03-11 Thread Christoffer Dall
On Mon, Mar 11, 2013 at 3:38 AM, Marc Zyngier wrote: > 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:2

Re: [kvmarm] [PATCH 3/3] ARM: EXYNOS5250: Register architected timers

2013-03-13 Thread Christoffer Dall
On Wed, Mar 13, 2013 at 5:59 PM, Alexander Graf wrote: > When running on an exynos 5250 SoC, we don't initialize the architected > timers. The chip however supports architected timers. > > When we don't initialize them, KVM will try to access them and run into > NULL pointer dereferences attemptin

Another question

2013-03-26 Thread Christoffer Dall
Hi guys, I have an x86 question that I really hope you can help with: Running the kvm-unit-tests on x86, I see a quite large difference between I/O from the kernel, and I/O user (around 6,000 cycles) on two separate platforms. This is probably expected, but what is the explanation? If I correlat

Re: [PATCH 1/7] ARM: KVM: simplify HYP mapping population

2013-04-03 Thread Christoffer Dall
On Tue, Apr 02, 2013 at 02:25:09PM +0100, Marc Zyngier wrote: > The way we populate HYP mappings is a bit convoluted, to say the least. > Passing a pointer around to keep track of the current PFN is quite > odd, and we end-up having two different PTE accessors for no good > reason. > > Simplify th

Re: [PATCH 2/7] ARM: KVM: fix HYP mapping limitations around zero

2013-04-03 Thread Christoffer Dall
On Tue, Apr 02, 2013 at 02:25:10PM +0100, Marc Zyngier wrote: > The current code for creating HYP mapping doesn't like to wrap > around zero, which prevents from mapping anything into the last > page of the virtual address space. > > It doesn't take much effort to remove this limitation, making >

Re: [PATCH 3/7] ARM: KVM: move to a KVM provided HYP idmap

2013-04-03 Thread Christoffer Dall
On Tue, Apr 02, 2013 at 02:25:11PM +0100, Marc Zyngier wrote: > After the HYP page table rework, it is pretty easy to let the KVM > code provide its own idmap, rather than expecting the kernel to > provide it. It takes actually less code to do so. > > Signed-off-by: Marc Zyngier > --- > arch/arm

Re: [PATCH 4/7] ARM: KVM: enforce page alignment for identity mapped code

2013-04-03 Thread Christoffer Dall
On Wed, Apr 03, 2013 at 11:00:39AM +0100, Marc Zyngier wrote: > On 03/04/13 10:50, Will Deacon wrote: > > On Tue, Apr 02, 2013 at 02:25:12PM +0100, Marc Zyngier wrote: > >> We're about to move to a init procedure where we rely on the > >> fact that the init code fits in a single page. Make sure we

Re: [PATCH 5/7] ARM: KVM: parametrize HYP page table freeing

2013-04-03 Thread Christoffer Dall
ry(hyp_pgd, KERN_TO_HYP(addr)); > + kfree(hyp_pgd); > + } > + > mutex_unlock(&kvm_hyp_pgd_mutex); > } > > @@ -741,7 +745,7 @@ int kvm_mmu_init(void) > > return 0; > out: > - kfree(hyp_pgd); > + free_hyp_pgds(); > return err; > } > > -- > 1.8.1.4 > > Acked-by: Christoffer Dall -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 6/7] ARM: KVM: switch to a dual-step HYP init code

2013-04-03 Thread Christoffer Dall
On Tue, Apr 02, 2013 at 02:25:14PM +0100, Marc Zyngier wrote: > Our HYP init code suffers from two major design issues: > - it cannot support CPU hotplug, as we tear down the idmap very early > - it cannot perform a TLB invalidation when switching from init to > runtime mappings, as pages are man

Re: [PATCH 6/7] ARM: KVM: switch to a dual-step HYP init code

2013-04-03 Thread Christoffer Dall
On Wed, Apr 03, 2013 at 11:38:30AM +0100, Marc Zyngier wrote: > On 03/04/13 11:07, Will Deacon wrote: > > On Tue, Apr 02, 2013 at 02:25:14PM +0100, Marc Zyngier wrote: > >> Our HYP init code suffers from two major design issues: > >> - it cannot support CPU hotplug, as we tear down the idmap very e

Re: [PATCH 7/7] ARM: KVM: perform HYP initilization for hotplugged CPUs

2013-04-03 Thread Christoffer Dall
gic_hyp_init(); > @@ -963,6 +972,12 @@ int kvm_arch_init(void *opaque) > if (err) > goto out_err; > > + err = register_cpu_notifier(&hyp_init_cpu_nb); > + if (err) { > + kvm_err("Cannot register HYP init CPU notifier (%d)\n", err); > + goto out_err; > + } > + > kvm_coproc_table_init(); > return 0; > out_err: > -- > 1.8.1.4 > > Acked-by: Christoffer Dall -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 0/7] ARM: KVM: Revamping the HYP init code for fun and profit

2013-04-03 Thread Christoffer Dall
On Tue, Apr 02, 2013 at 02:25:08PM +0100, Marc Zyngier wrote: > Over the past few weeks, I've gradually realized how broken our HYP > idmap code is. Badly broken. > > The main problem is about supporting CPU hotplug. Imagine a CPU being > initialized normally, running VMs, and then being powered d

Re: [PATCH 4/7] ARM: KVM: enforce page alignment for identity mapped code

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 3:47 AM, Marc Zyngier wrote: > On 04/04/13 00:15, Christoffer Dall wrote: >> On Wed, Apr 03, 2013 at 11:00:39AM +0100, Marc Zyngier wrote: >>> On 03/04/13 10:50, Will Deacon wrote: >>>> On Tue, Apr 02, 2013 at 02:25:12PM +0100, Marc Zyngier wr

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-04 Thread Christoffer Dall
[...] >> >> to give us some idea how much performance we would gain from each >> >> approach? Thoughput should be completely unaffected anyway, since virtio >> >> just coalesces kicks internally. >> > >> > Latency is dominated by the scheduling latency. >> > This means virtio-net is not the best

Re: [PATCH 5/7] kvm/arm: Fix missing include build error

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: > Include linux/cpu.h in kvm/arm.c. Fixes build errors like > these with ARCH=arm64: > > arch/arm/kvm/arm.c: error: ‘CPU_STARTING_FROZEN’ undeclared > > Signed-off-by: Geoff Levand > --- > arch/arm/kvm/arm.c |1 + > 1 file changed, 1 inser

Re: [PATCH 0/7] KVM minor fixups

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: > Hi Marcelo, > > These are a few fixups I found when running sparse and building Marc's 64 bit > ARM tree. Please consider for 3.10. "running sparse" - what does this mean? -Christoffer -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH 6/7] kvm/arm: Make force_vm_exit static

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: > The routine force_vm_exit() is not referenced outside kvm/arm.c, > so make it have static linkage. > > Signed-off-by: Geoff Levand > --- > arch/arm/include/asm/kvm_host.h |1 - > arch/arm/kvm/arm.c |2 +- > 2 files change

Re: [PATCH 7/7] kvm/arm: Remove unused kvm_arch_set_memory_region

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: > Remove the unused and empty routine kvm_arch_set_memory_region(). > > Signed-off-by: Geoff Levand > --- > arch/arm/kvm/arm.c |8 > 1 file changed, 8 deletions(-) > > diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c > index 86

Re: [PATCH 0/7] KVM minor fixups

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 4:57 PM, Geoff Levand wrote: > Hi Christoffer, > > On Thu, 2013-04-04 at 16:53 -0700, Christoffer Dall wrote: >> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: >> > Hi Marcelo, >> > >> > These are a few fixups I found

Re: [PATCH 5/7] kvm/arm: Fix missing include build error

2013-04-04 Thread Christoffer Dall
On Thu, Apr 4, 2013 at 5:04 PM, Geoff Levand wrote: > Hi Christoffer, > > On Thu, 2013-04-04 at 16:51 -0700, Christoffer Dall wrote: >> On Thu, Apr 4, 2013 at 4:33 PM, Geoff Levand wrote: >> > Include linux/cpu.h in kvm/arm.c. Fixes build errors like >> > thes

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-07 Thread Christoffer Dall
On Sun, Apr 7, 2013 at 12:41 AM, Michael S. Tsirkin wrote: > On Thu, Apr 04, 2013 at 04:32:01PM -0700, Christoffer Dall wrote: >> [...] >> >> >> >> to give us some idea how much performance we would gain from each >> >> >> approach? Thou

[GIT PULL] KVM/ARM Minor fixes for 3.9

2013-04-15 Thread Christoffer Dall
Hi Marcelo and Gleb, The following changes since commit 41ef2d5678d83af030125550329b6ae8b74618fa: Linux 3.9-rc7 (2013-04-14 17:45:16 -0700) are available in the git repository at: git://github.com/columbia/linux-kvm-arm.git kvm-arm-fixes-for-3.9 for you to fetch changes up to b03e1d4f253f2

Re: [PATCH] KVM: ARM: Fix kvm_vm_ioctl_irq_line

2013-04-16 Thread Christoffer Dall
t; + bool line_status) > { > u32 irq = irq_level->irq; > unsigned int irq_type, vcpu_idx, irq_num; > -- > 1.6.0.2 > Acked-by: Christoffer Dall -- To unsubscribe from this list: send the line "unsubscribe kvm" in the bod

Re: [GIT PULL] KVM/ARM Minor fixes for 3.9

2013-04-16 Thread Christoffer Dall
On Tue, Apr 16, 2013 at 2:03 PM, Marcelo Tosatti wrote: > On Mon, Apr 15, 2013 at 01:52:15AM -0700, Christoffer Dall wrote: >> Hi Marcelo and Gleb, >> >> The following changes since commit 41ef2d5678d83af030125550329b6ae8b74618fa: >> >> Linux 3.9-rc7 (201

[GIT PULL v2] KVM/ARM Minor fixes for 3.9

2013-04-16 Thread Christoffer Dall
The following changes since commit 31880c37c11e28cb81c70757e38392b42e695dc6: Linux 3.9-rc6 (2013-04-07 20:49:54 -0700) are available in the git repository at: git://github.com/columbia/linux-kvm-arm.git kvm-arm-fixes-3.9 for you to fetch changes up to 865499ea90d399e0682bcce3ae7af2427763369

Re: [GIT PULL v2] KVM/ARM Minor fixes for 3.9

2013-04-17 Thread Christoffer Dall
On Wed, Apr 17, 2013 at 3:45 AM, Gleb Natapov wrote: > Marcelo has sent pull request yesterday and Linus pulled it > already. Sorry if I was not clear. Generally specking we should not wait > so late into the release to send fixes to Linus, exceptions happen of > course. I know, the reason everyt

Re: [GIT PULL v2] KVM/ARM Minor fixes for 3.9

2013-04-17 Thread Christoffer Dall
On Wed, Apr 17, 2013 at 4:08 AM, Alexander Graf wrote: > > On 17.04.2013, at 13:05, Christoffer Dall wrote: > >> On Wed, Apr 17, 2013 at 3:45 AM, Gleb Natapov wrote: >>> Marcelo has sent pull request yesterday and Linus pulled it >>> already. Sorry if I was

[PATCH] ARM: KVM: fix unbalanced get_cpu() in access_dcsw

2013-04-17 Thread Christoffer Dall
f-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/coproc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 4ea9a98..7bed755 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -79,11 +79,11

KVM/ARM in next

2013-04-20 Thread Christoffer Dall
Hi Stephen, I'm maintaining the KVM/ARM implementation, which was merged during the 3.9 merge window. I'd like for you to pull changes from my kvm-arm-next branch at git://github.com/columbia/linux-kvm-arm.git into linux-next. The merge procedure for this tree is typically through the kvm tree,

[PATCH] KVM: ARM: Fix API documentation for ONE_REG encoding

2013-04-22 Thread Christoffer Dall
Unless I'm mistaken, the size field was encoded 4 bits off and a wrong value was used for 64-bit FP registers. Signed-off-by: Christoffer Dall --- Documentation/virtual/kvm/api.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/virtua

Re: [PATCH v3 03/32] arm64: KVM: HYP mode idmap support

2013-04-23 Thread Christoffer Dall
On Mon, Apr 8, 2013 at 9:17 AM, Marc Zyngier wrote: > 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/kern

Re: [PATCH v3 07/32] arm64: KVM: fault injection into a guest

2013-04-23 Thread Christoffer Dall
ev/null > +++ b/arch/arm64/kvm/inject_fault.c > @@ -0,0 +1,118 @@ > +/* > + * Fault injection for 64bit guests. > + * > + * Copyright (C) 2012,2013 - ARM Ltd > + * Author: Marc Zyngier > + * > + * Based on arch/arm/kvm/emulate.c > + * Copyright (C) 2012 -

Re: [PATCH v3 08/32] arm64: KVM: architecture specific MMU backend

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:10PM +0100, Marc Zyngier wrote: > Define the arm64 specific MMU backend: > - HYP/kernel VA offset > - S2 4/64kB definitions > - S2 page table populating and flushing > - icache cleaning > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > ar

Re: [PATCH v3 11/32] arm64: KVM: CPU specific system registers handling

2013-04-23 Thread Christoffer Dall
kvm/sys_regs_generic_v8.c > >> @@ -0,0 +1,85 @@ > >> +/* > >> + * Copyright (C) 2012,2013 - ARM Ltd > >> + * Author: Marc Zyngier > >> + * > >> + * Based on arch/arm/kvm/coproc_a15.c: > >> + * Copyright (C) 2012 - Virtual Open Systems a

Re: [PATCH v3 15/32] arm64: KVM: guest one-reg interface

2013-04-23 Thread Christoffer Dall
gt; + * Copyright (C) 2012,2013 - ARM Ltd > + * Author: Marc Zyngier > + * > + * Derived from arch/arm/kvm/guest.c: > + * Copyright (C) 2012 - Virtual Open Systems and Columbia University > + * Author: Christoffer Dall > + * > + * This program is free software; you can redis

Re: [PATCH v3 17/32] arm64: KVM: HYP mode world switch implementation

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:19PM +0100, Marc Zyngier wrote: > 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). > > Reviewed-by: Christopher Covington > Signed-off-by: Mar

Re: [PATCH v3 19/32] arm64: KVM: Plug the VGIC

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:21PM +0100, Marc Zyngier wrote: > Add support for the in-kernel GIC emulation. The include file > is a complete duplicate of the 32bit one - something to fix > at one point. seems like something that should be fixed sooner as opposed to later... Is it hard? > > Revi

Re: [PATCH v3 20/32] arm64: KVM: Plug the arch timer

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:22PM +0100, Marc Zyngier wrote: > Add support for the in-kernel timer emulation. The include file > is a complete duplicate of the 32bit one - something to fix > at one point. again, I'd really like to see this fixed before we merge the code... > > Reviewed-by: Chri

Re: [PATCH v3 24/32] arm64: KVM: 32bit GP register access

2013-04-23 Thread Christoffer Dall
handle_exit.o > kvm-$(CONFIG_KVM_ARM_HOST) += guest.o reset.o sys_regs.o > sys_regs_generic_v8.o > > diff --git a/arch/arm64/kvm/regmap.c b/arch/arm64/kvm/regmap.c > new file mode 100644 > index 000..bbc6ae3 > --- /dev/null > +++ b/arch/arm64/kvm/regmap.c > @@ -0

Re: [PATCH v3 25/32] arm64: KVM: 32bit conditional execution emulation

2013-04-23 Thread Christoffer Dall
p-init.o handle_exit.o > kvm-$(CONFIG_KVM_ARM_HOST) += guest.o reset.o sys_regs.o > sys_regs_generic_v8.o > > diff --git a/arch/arm64/kvm/emulate.c b/arch/arm64/kvm/emulate.c > new file mode 100644 > index 000..01d4713 > --- /dev/null > +++ b/arch/arm64/kvm/emulate.

Re: [PATCH v3 10/32] arm64: KVM: system register handling

2013-04-23 Thread Christoffer Dall
64_SYSREG_OP2_SHIFT 0 > + > /* KVM_IRQ_LINE irq field index values */ > #define KVM_ARM_IRQ_TYPE_SHIFT 24 > #define KVM_ARM_IRQ_TYPE_MASK 0xff > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > new file mode 100644 > index 000..9df3b32 > --- /dev/nul

Re: [PATCH v3 26/32] arm64: KVM: 32bit handling of coprocessor traps

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:28PM +0100, Marc Zyngier wrote: > 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. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc

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

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:31PM +0100, Marc Zyngier wrote: > Add fault injection capability for 32bit guests. looks ok, but seems we are duplicating some functionality here, but I realize it may not be that easy to share due to different define names for things like PSR_X_BIT... Did you look f

Re: [PATCH v3 30/32] arm64: KVM: enable initialization of a 32bit vcpu

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:32PM +0100, Marc Zyngier wrote: > 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 conditioned by the presence of 32bit > capability on the physical CPU, and is checked

Re: [PATCH v3 31/32] arm64: KVM: userspace API documentation

2013-04-23 Thread Christoffer Dall
On Mon, Apr 08, 2013 at 05:17:33PM +0100, Marc Zyngier wrote: > Unsurprisingly, the arm64 userspace API is extremely similar to > the 32bit one, the only significant difference being the ONE_REG > register mapping. > > Signed-off-by: Marc Zyngier > --- > Documentation/virtual/kvm/api.txt | 55 >

Re: [PATCH v3 00/32] Port of KVM to arm64

2013-04-23 Thread Christoffer Dall
don't have the necessary docs, but from what I can gather this looks pretty good, so, assuming you address the comments I gave (especially at the least clearly commenting on the index into the kvm_regs struct): Acked-by: Christoffer Dall -Christoffer > > As we do not have a 64bi

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

2013-04-23 Thread Christoffer Dall
On Mon, Mar 25, 2013 at 1:19 AM, Marc Zyngier wrote: > Hi Alex, > > 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 Zyng

Re: [PATCH v3 07/32] arm64: KVM: fault injection into a guest

2013-04-24 Thread Christoffer Dall
On Wed, Apr 24, 2013 at 3:04 AM, Marc Zyngier wrote: > On 23/04/13 23:57, Christoffer Dall wrote: >> On Mon, Apr 08, 2013 at 05:17:09PM +0100, Marc Zyngier wrote: >>> Implement the injection of a fault (undefined, data abort or >>> prefetch abort) into a 64bit

Re: [PATCH v3 08/32] arm64: KVM: architecture specific MMU backend

2013-04-24 Thread Christoffer Dall
On Wed, Apr 24, 2013 at 4:10 AM, Will Deacon wrote: > On Wed, Apr 24, 2013 at 12:03:10PM +0100, Marc Zyngier wrote: >> On 23/04/13 23:58, Christoffer Dall wrote: >> > I noticed that this doesn't do any cache cleaning. Are the MMU page >> > table walks guarantee

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