Re: [PATCH v3] kvm tools: add support for ARMv7 processors

2012-11-23 Thread Marc Zyngier
). The virtual timers and virtual interrupt controller (VGIC) are provided by the kernel and require very little in terms of userspace code. Signed-off-by: Will Deacon will.dea...@arm.com FWIW: Tested-by: Marc Zyngier marc.zyng...@arm.com M. -- Jazz is not dead. It just smells funny

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

2012-11-23 Thread Marc Zyngier
On 23/11/12 16:17, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:46:19PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com We can inject a timer interrupt into the guest as a result of three possible events: - The virtual timer interrupt has fired while we were still

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

2012-11-23 Thread Marc Zyngier
On 23/11/12 16:30, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:46:25PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Do the necessary save/restore dance for the timers in the world switch code. In the process, allow the guest to read the physical counter, which

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

2012-11-23 Thread Marc Zyngier
On 23/11/12 17:00, Will Deacon wrote: On Fri, Nov 23, 2012 at 04:52:12PM +, Marc Zyngier wrote: On 23/11/12 16:17, Will Deacon wrote: diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c index b80256b..7463f5b 100644 --- a/arch/arm/kvm/reset.c +++ b/arch/arm/kvm/reset.c @@ -37,6

Re: [PATCH v4 03/13] ARM: KVM: Initial VGIC infrastructure support

2012-11-28 Thread Marc Zyngier
On 28/11/12 12:49, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:44:37PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Wire the basic framework code for VGIC support. Nothing to enable yet. Again, not sure how useful this patch is. Might as well merge it with code

Re: [PATCH v4 02/13] ARM: KVM: Keep track of currently running vcpus

2012-11-28 Thread Marc Zyngier
On 28/11/12 12:47, Will Deacon wrote: Just a bunch of typos in this one :) Typos? me? ;-) On Sat, Nov 10, 2012 at 03:44:30PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com When an interrupt occurs for the guest, it is sometimes necessary to find out which vcpu

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

2012-11-28 Thread Marc Zyngier
On 28/11/12 13:11, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:44:51PM +, Christoffer Dall wrote: User space defines the model to emulate to a guest and should therefore decide which addresses are used for both the virtual CPU interface directly mapped in the guest physical address space

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

2012-11-28 Thread Marc Zyngier
On 28/11/12 13:09, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:44:44PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Wire the initial in-kernel MMIO support code for the VGIC, used for the distributor emulation. [...] diff --git a/arch/arm/kvm/vgic.c b/arch

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

2012-11-28 Thread Marc Zyngier
On 28/11/12 13:21, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:44:58PM +, Christoffer Dall wrote: 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

[PATCH] kvm-tool: ARM: set interrupt priority mask in secondary boot path

2012-11-29 Thread Marc Zyngier
(0xff), and it just works. Cc: Will Deacon will.dea...@arm.com Cc: Pekka Enberg penb...@kernel.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- tools/kvm/arm/aarch32/smp-pen.S| 4 tools/kvm/arm/include/arm-common/gic.h | 2 ++ 2 files changed, 6 insertions(+) diff --git

[PATCH] kvm-tool: fix zombie reaping in guest/init.c

2012-11-29 Thread Marc Zyngier
init.c is not very kind with processes that get reparented when their own parent die, leaving them hanging around. Looking at the code, it only seem to care about its own flesh and blood. Bad init. Teach it some basic zombie reaping skills. Cc: Pekka Enberg penb...@kernel.org Signed-off-by: Marc

[PATCH v2] kvm-tool: ARM: set interrupt priority mask in secondary boot path

2012-11-30 Thread Marc Zyngier
(0xff), and it just works. Cc: Will Deacon will.dea...@arm.com Cc: Pekka Enberg penb...@kernel.org Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- v2: Changed the constant name to GIC_CPUI_PMR_MIN_PRIO, as suggested by Peter Maydell tools/kvm/arm/aarch32/smp-pen.S| 4 tools

Re: [PATCH v4 08/14] KVM: ARM: World-switch implementation

2012-12-03 Thread Marc Zyngier
On 30/11/12 18:49, Christoffer Dall wrote: On Fri, Nov 30, 2012 at 12:14 PM, Will Deacon will.dea...@arm.com wrote: On Fri, Nov 30, 2012 at 04:47:40PM +, Christoffer Dall wrote: On Fri, Nov 30, 2012 at 10:15 AM, Will Deacon will.dea...@arm.com wrote: At this point, VM1 is running and

Re: [PATCH v4 07/13] ARM: KVM: VGIC virtual CPU interface management

2012-12-03 Thread Marc Zyngier
: 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

Re: [PATCH v4 09/13] ARM: KVM: VGIC interrupt injection

2012-12-03 Thread Marc Zyngier
On 03/12/12 13:25, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:45:18PM +, Christoffer Dall wrote: 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

Re: [PATCH v4 10/13] ARM: KVM: VGIC control interface world switch

2012-12-03 Thread Marc Zyngier
On 03/12/12 13:31, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:45:25PM +, Christoffer Dall wrote: 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

Re: [PATCH v4 07/13] ARM: KVM: VGIC virtual CPU interface management

2012-12-03 Thread Marc Zyngier
On 03/12/12 14:34, Will Deacon wrote: On Mon, Dec 03, 2012 at 02:11:03PM +, Marc Zyngier wrote: On 03/12/12 13:23, Will Deacon wrote: +#define VGIC_HCR_EN(1 0) +#define VGIC_HCR_UIE (1 1) + +#define VGIC_LR_VIRTUALID (0x3ff 0) +#define VGIC_LR_PHYSID_CPUID

Re: [PATCH v4 09/13] ARM: KVM: VGIC interrupt injection

2012-12-03 Thread Marc Zyngier
On 03/12/12 19:13, Christoffer Dall wrote: On Mon, Dec 3, 2012 at 9:21 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 03/12/12 13:25, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:45:18PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Plug the interrupt injection

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

2012-12-05 Thread Marc Zyngier
On 05/12/12 10:58, Russell King - ARM Linux wrote: On Wed, Dec 05, 2012 at 10:43:58AM +, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:45:39PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com If we have level interrupts already programmed to fire on a vcpu

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

2012-12-05 Thread Marc Zyngier
On 05/12/12 12:29, Russell King - ARM Linux wrote: On Wed, Dec 05, 2012 at 12:17:57PM +, Marc Zyngier wrote: On 05/12/12 10:58, Russell King - ARM Linux wrote: On Wed, Dec 05, 2012 at 10:43:58AM +, Will Deacon wrote: On Sat, Nov 10, 2012 at 03:45:39PM +, Christoffer Dall wrote

[RFC] KVM on arm64

2012-12-19 Thread Marc Zyngier
As I'm about to go in turkey mode for a few days, I thought it would be good to let people have a taste of KVM on arm64. At least for those who are not following the same path... So this is the first public drop of KVM/arm64. It supports: - arm and arm64 guests - SMP host and guest - 4kB and 64kB

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

2012-08-24 Thread Marc Zyngier
On Fri, 24 Aug 2012 16:04:02 +0800, Lei Wen adrian.w...@gmail.com wrote: On Thu, Aug 23, 2012 at 11:27 PM, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Aug 23, 2012 at 11:08 AM, Lei Wen adrian.w...@gmail.com wrote: Hi Christoffer, [snip] diff --git a/arch/arm/kvm/init.S

Re: [PATCH 01/15] ARM: add mem_type prot_pte accessor

2012-09-20 Thread Marc Zyngier
On 18/09/12 22:53, Christoffer Dall wrote: On Tue, Sep 18, 2012 at 5:04 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Sat, Sep 15, 2012 at 11:34:36AM -0400, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com The KVM hypervisor mmu code requires access

RE: [PATCH 01/10] ARM: KVM: Keep track of currently running vcpus

2012-09-20 Thread Marc Zyngier
...@lists.infradead.org; kvm...@lists.cs.columbia.edu Subject: [PATCH 01/10] ARM: KVM: Keep track of currently running vcpus From: Marc Zyngier marc.zyng...@arm.com When an interrupt occurs for the guest, it is sometimes necessary to find out which vcpu was running at that point. Keep track

Re: [kvmarm] [PATCH 10/15] KVM: ARM: World-switch implementation

2012-09-25 Thread Marc Zyngier
On Tue, 25 Sep 2012 18:15:50 +0100, Peter Maydell peter.mayd...@linaro.org wrote: On 25 September 2012 18:00, Will Deacon will.dea...@arm.com wrote: On Sat, Sep 15, 2012 at 04:35:33PM +0100, Christoffer Dall wrote: ENTRY(__kvm_tlb_flush_vmid) + hvc #0 @ Switch

Re: [PATCH 06/15] KVM: ARM: Initial skeleton to compile KVM support

2012-09-27 Thread Marc Zyngier
On 27/09/12 15:13, Will Deacon wrote: On Wed, Sep 26, 2012 at 02:43:14AM +0100, Christoffer Dall wrote: On 09/25/2012 11:20 AM, Will Deacon wrote: +static inline u32 *vcpu_pc(struct kvm_vcpu *vcpu) +{ + return vcpu_reg(vcpu, 15); +} If you stick a struct pt_regs into struct

Re: [kvmarm] [PATCH 13/15] KVM: ARM: Handle guest faults in KVM

2012-09-27 Thread Marc Zyngier
On 27/09/12 04:11, Min-gyu Kim wrote: -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Christoffer Dall Sent: Tuesday, September 25, 2012 9:39 PM To: Min-gyu Kim Cc: kvm@vger.kernel.org; linux-arm-ker...@lists.infradead.org;

Re: [kvmarm] [PATCH 06/15] KVM: ARM: Initial skeleton to compile KVM support

2012-10-01 Thread Marc Zyngier
On Sun, 30 Sep 2012 15:21:54 -0400, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Sep 27, 2012 at 10:13 AM, Will Deacon will.dea...@arm.com wrote: I think Marc (CC'd) had a go at this with some success. great, if this improves the code, then I suggest someone rebases an

Re: [PATCH v2 08/10] ARM: KVM: VGIC initialisation code

2012-10-02 Thread Marc Zyngier
On Tue, 2 Oct 2012 10:24:13 +0100, Will Deacon will.dea...@arm.com wrote: On Mon, Oct 01, 2012 at 10:14:26AM +0100, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Add the init code for the hypervisor, the virtual machine, and the virtual CPUs. An interrupt handler is also

Re: [kvmarm] [PATCH v2 06/14] KVM: ARM: Memory virtualization setup

2012-10-09 Thread Marc Zyngier
Sent: Monday, October 01, 2012 6:11 PM To: kvm@vger.kernel.org; linux-arm-ker...@lists.infradead.org; kvm...@lists.cs.columbia.edu Cc: Marc Zyngier Subject: [PATCH v2 06/14] KVM: ARM: Memory virtualization setup +static void stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache

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

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

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

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

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

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

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

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:30, Antonios Motakis wrote: On 12/19/2011 04:19 PM, Marc Zyngier wrote: On 19/12/11 14:57, Christoffer Dall wrote: You should simply start booting a UP guest on an SMP host, see where it crashes and start tracking it down. For the time being, I've yet to see UP guest crashing

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

2011-12-19 Thread Marc Zyngier
On 19/12/11 15:42, Antonios Motakis wrote: On 12/19/2011 04:40 PM, Christoffer Dall wrote: On Mon, Dec 19, 2011 at 10:37 AM, Marc Zyngiermarc.zyng...@arm.com wrote: On 19/12/11 15:30, Antonios Motakis wrote: On 12/19/2011 04:19 PM, Marc Zyngier wrote: On 19/12/11 14:57, Christoffer Dall

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2012-02-13 Thread Marc Zyngier
:22 PM, Marc Zyngier wrote: +ENTRY(__kvm_tlb_flush_vmid) + hvc #0 @ Switch to Hyp mode + push{r2, r3} + ldrdr2, r3, [r0, #KVM_VTTBR] + mcrrp15, 6, r2, r3, c2 @ Write VTTBR + isb + mcr p15, 0, r0, c8, c7, 0

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

2011-12-12 Thread Marc Zyngier
On 11/12/11 20:07, Christoffer Dall wrote: On Dec 11, 2011, at 2:48 PM, Peter Maydell 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

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

2011-12-12 Thread Marc Zyngier
On 12/12/11 17:39, Christoffer Dall wrote: On Mon, Dec 12, 2011 at 9:32 AM, Avi Kivity 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

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

2012-03-12 Thread Marc Zyngier
On 12/03/12 06:52, Christoffer Dall wrote: From: Christoffer Dall 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

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

2012-03-12 Thread Marc Zyngier
On 12/03/12 16:23, Christoffer Dall wrote: On Mon, Mar 12, 2012 at 11:31 AM, Marc Zyngier 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

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

2013-01-09 Thread Marc Zyngier
On Wed, 9 Jan 2013 15:11:39 +, Peter Maydell peter.mayd...@linaro.org wrote: On 9 January 2013 14:58, Alexander Graf ag...@suse.de wrote: Yeah, that was the basic idea. Considering that the patch set hasn't been going in for another 2 months after that discussion indicates that this isn't

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

2013-01-09 Thread Marc Zyngier
On 09/01/13 15:56, Alexander Graf wrote: On 09.01.2013, at 16:50, Marc Zyngier wrote: On Wed, 9 Jan 2013 16:28:03 +0100, Alexander Graf ag...@suse.de wrote: On 09.01.2013, at 16:22, Marc Zyngier wrote: On Wed, 9 Jan 2013 15:11:39 +, Peter Maydell peter.mayd...@linaro.org wrote

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

2013-01-09 Thread Marc Zyngier
On Wed, 9 Jan 2013 16:28:03 +0100, Alexander Graf ag...@suse.de wrote: On 09.01.2013, at 16:22, Marc Zyngier wrote: On Wed, 9 Jan 2013 15:11:39 +, Peter Maydell peter.mayd...@linaro.org wrote: On 9 January 2013 14:58, Alexander Graf ag...@suse.de wrote: Yeah, that was the basic idea

Re: [kvmarm] [PATCH v5.1 0/2] KVM: ARM: Rename KVM_SET_DEVICE_ADDRESS

2013-01-10 Thread Marc Zyngier
On Thu, 10 Jan 2013 10:17:09 +, Peter Maydell peter.mayd...@linaro.org wrote: On 9 January 2013 22:30, Alexander Graf ag...@suse.de wrote: In fact, in this particular case one could merge all of the patches except for the particular ioctl implementation and just give the respective

[PATCH v2 0/2] KVM/ARM implementation of PSCI

2013-01-10 Thread Marc Zyngier
function - One mask fits all - Use wait_event_interruptible instead of the open coded version Marc Zyngier (2): ARM: KVM: move one-time init to its own function ARM: KVM: Power State Coordination Interface implementation Documentation/virtual/kvm/api.txt | 4 ++ arch/arm/include/asm/kvm_emulate.h

[PATCH v2 1/2] ARM: KVM: move one-time init to its own function

2013-01-10 Thread Marc Zyngier
As more code to be run only once per vcpu is expected, move the VGIC init code into a separate function. Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- arch/arm/include/asm/kvm_host.h | 3 +++ arch/arm/kvm/arm.c | 33 +++-- 2 files changed, 26

[PATCH v2 2/2] ARM: KVM: Power State Coordination Interface implementation

2013-01-10 Thread Marc Zyngier
or HVC to execute a PSCI function. Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- Documentation/virtual/kvm/api.txt | 4 ++ arch/arm/include/asm/kvm_emulate.h | 5 +++ arch/arm/include/asm/kvm_host.h| 2 +- arch/arm/include/asm/kvm_psci.h| 23 ++ arch/arm/include/uapi/asm

KVM/arm64 updates

2013-01-10 Thread Marc Zyngier
Guys, I've updated the branches for KVM/arm64, renaming them all to keep the interested parties on their toes. We now have: - kvm-arm/psci: kvm-arm-master + the KVM/PSCI implementation - kvm-arm/pre-arm64: the above + the cleanup branch - arm64/soc-armv8-model: Catalin Marinas' arm64 branch -

Re: [PATCH v2 2/2] ARM: KVM: Power State Coordination Interface implementation

2013-01-11 Thread Marc Zyngier
On 11/01/13 17:12, Russell King - ARM Linux wrote: On Thu, Jan 10, 2013 at 04:06:45PM +, Marc Zyngier wrote: +int kvm_psci_call(struct kvm_vcpu *vcpu) +{ +unsigned long psci_fn = *vcpu_reg(vcpu, 0) ~((u32) 0); +unsigned long val; + +switch (psci_fn) { +case

Re: [kvmarm] [PATCH v2 2/2] ARM: KVM: Power State Coordination Interface implementation

2013-01-11 Thread Marc Zyngier
On 11/01/13 17:33, Christoffer Dall wrote: On Fri, Jan 11, 2013 at 12:24 PM, Marc Zyngier marc.zyng...@arm.com wrote: On 11/01/13 17:12, Russell King - ARM Linux wrote: On Thu, Jan 10, 2013 at 04:06:45PM +, Marc Zyngier wrote: +int kvm_psci_call(struct kvm_vcpu *vcpu) +{ +unsigned

Re: [kvmarm] [PATCH v2 2/2] ARM: KVM: Power State Coordination Interface implementation

2013-01-11 Thread Marc Zyngier
On 11/01/13 17:48, Christoffer Dall wrote: On Fri, Jan 11, 2013 at 12:43 PM, Marc Zyngier marc.zyng...@arm.com wrote: On 11/01/13 17:33, Christoffer Dall wrote: On Fri, Jan 11, 2013 at 12:24 PM, Marc Zyngier marc.zyng...@arm.com wrote: On 11/01/13 17:12, Russell King - ARM Linux wrote: On Thu

Re: [PATCH v5 3/4] ARM: KVM: arch_timers: Add timer world switch

2013-01-14 Thread Marc Zyngier
On 14/01/13 15:21, Will Deacon wrote: On Tue, Jan 08, 2013 at 06:43:27PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Do the necessary save/restore dance for the timers in the world switch code. In the process, allow the guest to read the physical counter, which

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

2013-01-15 Thread Marc Zyngier
marc.zyng...@arm.com Cc: Will Deacon will.dea...@arm.com Signed-off-by: Christoffer Dall c.d...@virtualopensystems.com Acked-by: Marc Zyngier marc.zyng...@arm.com diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c index 25daa07..5c1bcf5 100644 --- a/arch/arm/kvm/vgic.c +++ b

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

2013-01-15 Thread Marc Zyngier
On 14/01/13 22:02, Christoffer Dall wrote: On Mon, Jan 14, 2013 at 10:42 AM, Will Deacon will.dea...@arm.com wrote: On Tue, Jan 08, 2013 at 06:42:11PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Add VGIC virtual CPU interface code, picking pending interrupts from

Re: [PATCH v5 2/4] ARM: KVM: arch_timers: Add guest timer core support

2013-01-15 Thread Marc Zyngier
On 14/01/13 19:19, Christoffer Dall wrote: On Mon, Jan 14, 2013 at 10:18 AM, Will Deacon will.dea...@arm.com wrote: On Tue, Jan 08, 2013 at 06:43:20PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Add some the architected timer related infrastructure, and support

Re: [PATCH v5 3/4] ARM: KVM: arch_timers: Add timer world switch

2013-01-15 Thread Marc Zyngier
On 14/01/13 22:08, Christoffer Dall wrote: On Mon, Jan 14, 2013 at 12:51 PM, Marc Zyngier marc.zyng...@arm.com wrote: On 14/01/13 15:21, Will Deacon wrote: On Tue, Jan 08, 2013 at 06:43:27PM +, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Do the necessary save/restore

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

2013-01-15 Thread Marc Zyngier
On 15/01/13 13:18, Gleb Natapov wrote: On Tue, Jan 08, 2013 at 01:40:05PM -0500, Christoffer Dall wrote: 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

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

2013-01-15 Thread Marc Zyngier
On 15/01/13 13:34, Gleb Natapov wrote: On Tue, Jan 15, 2013 at 01:29:40PM +, Marc Zyngier wrote: On 15/01/13 13:18, Gleb Natapov wrote: On Tue, Jan 08, 2013 at 01:40:05PM -0500, Christoffer Dall wrote: When the guest accesses I/O memory this will create data abort exceptions

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

2013-01-15 Thread Marc Zyngier
On 15/01/13 14:27, Gleb Natapov wrote: On Tue, Jan 15, 2013 at 01:46:04PM +, Marc Zyngier wrote: On 15/01/13 13:34, Gleb Natapov wrote: On Tue, Jan 15, 2013 at 01:29:40PM +, Marc Zyngier wrote: On 15/01/13 13:18, Gleb Natapov wrote: On Tue, Jan 08, 2013 at 01:40:05PM -0500

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

2013-01-16 Thread Marc Zyngier
On 16/01/13 15:29, Christoffer Dall wrote: [...] diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h index 1ace491..f9d1977 100644 --- a/arch/arm/include/asm/kvm_vgic.h +++ b/arch/arm/include/asm/kvm_vgic.h @@ -33,6 +33,7 @@ #define VGIC_NR_PRIVATE_IRQS

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

2013-01-16 Thread Marc Zyngier
On Wed, 16 Jan 2013 11:13:08 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Wed, Jan 16, 2013 at 11:09 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 16/01/13 15:29, Christoffer Dall wrote: [...] diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm

Re: [PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation

2013-01-17 Thread Marc Zyngier
On 16/01/13 17:59, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Implement the PSCI specification (ARM DEN 0022A) to control virtual CPUs being powered on or off. PSCI/KVM is detected using the KVM_CAP_ARM_PSCI capability. A virtual CPU can now be initialized

Re: [PATCH v6 13/15] KVM: ARM: Handle I/O aborts

2013-01-17 Thread Marc Zyngier
to run the VCPU must check if there's a pending MMIO load and perform the write after userspace has made the data available. Reviewed-by: Will Deacon will.dea...@arm.com Reviewed-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Marc Zyngier

Re: [kvmarm] [PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation

2013-01-21 Thread Marc Zyngier
On Sun, 20 Jan 2013 18:35:51 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Jan 17, 2013 at 10:55 AM, Marc Zyngier marc.zyng...@arm.com wrote: On 16/01/13 17:59, Christoffer Dall wrote: From: Marc Zyngier marc.zyng...@arm.com Implement the PSCI specification (ARM DEN

Re: [kvmarm] [PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation

2013-01-21 Thread Marc Zyngier
On Mon, 21 Jan 2013 09:50:18 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Mon, Jan 21, 2013 at 5:04 AM, Marc Zyngier marc.zyng...@arm.com wrote: On Sun, 20 Jan 2013 18:35:51 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Thu, Jan 17, 2013 at 10:55 AM, Marc

Re: [kvmarm] [PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation

2013-01-21 Thread Marc Zyngier
On Mon, 21 Jan 2013 12:54:22 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Mon, Jan 21, 2013 at 12:43 PM, Marc Zyngier marc.zyng...@arm.com wrote: On Mon, 21 Jan 2013 09:50:18 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: On Mon, Jan 21, 2013 at 5:04 AM, Marc

[RFC] KVM/arm64, take #3

2013-01-22 Thread Marc Zyngier
Guys, I've once more updated the branches for KVM/arm64 - kvm-arm/pre-arm64: kvm-arm-master as of today + the cleanup branch + some basic perf support - arm64/soc-armv8-model: Catalin Marinas' arm64 branch - arm64/psci: Implementation of PSCI for the above - arm64/perf: host/guest

Re: [kvmarm] [RFC] KVM/arm64, take #3

2013-01-23 Thread Marc Zyngier
to have verxpress support. There is no need for a platforms directory any more. The vexpress support is now just a configuration option. Thanks, Pranav Cheers, M. On 23 January 2013 00:32, Marc Zyngier marc.zyng...@arm.commailto:marc.zyng...@arm.com wrote: Guys, I've once more

Re: [kvmarm] [GIT PULL] KVM/ARM core implementation

2013-01-24 Thread Marc Zyngier
On Wed, 23 Jan 2013 14:22:23 -0500, Christoffer Dall c.d...@virtualopensystems.com wrote: Hi Will, I've prepared a stable branch for you, for-will/kvm/core, based on your stable perf branch. Since the last patch series, I've addressed the reviewer comments, and rev'ed KVM_CAP_ARM_PSCI to

[RFC] KVM/arm64, take #4

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

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

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

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

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

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

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

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

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

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

2013-02-24 Thread Marc Zyngier
On Tue, 19 Feb 2013 18:16:53 -0800, Christoffer Dall cd...@cs.columbia.edu wrote: On Tue, Feb 19, 2013 at 12:16 PM, Scott Wood scottw...@freescale.com wrote: We at least need the numberspace to not be architecture-specific if we want to retain the possibility of changing later -- not to

Fixing KVM/ARM breakage in mainline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   3   4   5   6   7   8   9   10   >