Re: [RFC PATCH 0/6] ARM64: KVM: PMU infrastructure support

2015-01-13 Thread Anup Patel
On Mon, Jan 12, 2015 at 12:41 AM, Christoffer Dall wrote: > On Tue, Dec 30, 2014 at 11:19:13AM +0530, Anup Patel wrote: >> (dropping previous conversation for easy reading) >> >> Hi Marc/Christoffer, >> >> I tried implementing PMU context-switch via C code >> in EL1 mode and in atomic context with

Re: [ÞATCH v2] kvmtool, mips: Support more than 256 MB guest memory

2015-01-13 Thread Chen, Tiejun
On 2015/1/13 18:19, Andreas Herrmann wrote: Two guest memory regions need to be defined and two "mem=" parameters need to be passed to guest kernel to support more than 256 MB. Cc: Chen, Tiejun Looks fine to me. Thanks Tiejun Signed-off-by: Andreas Herrmann --- tools/kvm/mips/include/kv

RE: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-13 Thread Wu, Feng
> -Original Message- > From: Radim Kr?má? [mailto:rkrc...@redhat.com] > Sent: Wednesday, January 14, 2015 12:17 AM > To: Wu, Feng > Cc: Paolo Bonzini; t...@linutronix.de; mi...@redhat.com; h...@zytor.com; > x...@kernel.org; g...@kernel.org; dw...@infradead.org; j...@8bytes.org; > alex.wil

Re: [PATCH RESEND v15 07/10] KVM: arm: page logging 2nd stage fault handling

2015-01-13 Thread Mario Smarduch
On 01/12/2015 09:49 AM, Christoffer Dall wrote: > On Mon, Jan 12, 2015 at 08:27:03AM -0800, Mario Smarduch wrote: >> On 01/11/2015 06:00 AM, Christoffer Dall wrote: >>> On Fri, Jan 09, 2015 at 08:17:20PM -0800, Mario Smarduch wrote: This patch adds support for 2nd stage page fault handling whi

Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

2015-01-13 Thread Luis R. Rodriguez
On Mon, Dec 15, 2014 at 02:58:26PM +, Stefano Stabellini wrote: > On Tue, 9 Dec 2014, Luis R. Rodriguez wrote: > > From: "Luis R. Rodriguez" > > > > This lets you build a kernel which can support xen dom0 > > or xen guests by just using: > > > >make xenconfig > > > > on both x86 and arm

Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

2015-01-13 Thread Julien Grall
Hello Luis, On 13/01/15 19:03, Luis R. Rodriguez wrote: >>> diff --git a/kernel/configs/xen.config b/kernel/configs/xen.config >>> new file mode 100644 >>> index 000..d2ec010 >>> --- /dev/null >>> +++ b/kernel/configs/xen.config >>> @@ -0,0 +1,30 @@ >>> +# generic config >>> +CONFIG_XEN=y >>>

Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

2015-01-13 Thread Luis R. Rodriguez
On Tue, Jan 13, 2015 at 11:13 AM, Julien Grall wrote: > Stefano had some comments on this patch. See: > > http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01531.html I see now sorry about that, will address and respin. Luis -- To unsubscribe from this list: send the line "unsubscr

Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

2015-01-13 Thread Luis R. Rodriguez
On Mon, Dec 15, 2014 at 11:58:34AM +, Julien Grall wrote: > Hello Luis, > > On 09/12/14 23:35, Luis R. Rodriguez wrote: > > From: "Luis R. Rodriguez" > > > > This lets you build a kernel which can support xen dom0 > > or xen guests by just using: > > > >make xenconfig > > > > on both x

Re: [PATCH RESEND v15 07/10] KVM: arm: page logging 2nd stage fault handling

2015-01-13 Thread Mario Smarduch
On 01/12/2015 11:43 AM, Christoffer Dall wrote: > On Mon, Jan 12, 2015 at 11:04:45AM -0800, Mario Smarduch wrote: > > [...] > >> @@ -1059,12 +1104,35 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, >> phys_addr_t fault_ipa, >> if (is_error_pfn(pfn)) >>

[PATCH v2 1/3] arm/arm64: KVM: Use set/way op trapping to track the state of the caches

2015-01-13 Thread Marc Zyngier
Trying to emulate the behaviour of set/way cache ops is fairly pointless, as there are too many ways we can end-up missing stuff. Also, there is some system caches out there that simply ignore set/way operations. So instead of trying to implement them, let's convert it to VA ops, and use them as a

[PATCH v2 0/3] arm/arm64: KVM: Random selection of cache related fixes

2015-01-13 Thread Marc Zyngier
This small series fixes a number of issues that Christoffer and I have been trying to nail down for a while, having to do with the host dying under load (swapping), and also with the way we deal with caches in general (and with set/way operation in particular): - The first one changes the way we h

[PATCH v2 3/3] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Marc Zyngier
When handling a fault in stage-2, we need to resync I$ and D$, just to be sure we don't leave any old cache line behind. That's very good, except that we do so using the *user* address. Under heavy load (swapping like crazy), we may end up in a situation where the page gets mapped in stage-2 while

[PATCH v2 2/3] arm/arm64: KVM: Invalidate data cache on unmap

2015-01-13 Thread Marc Zyngier
Let's assume a guest has created an uncached mapping, and written to that page. Let's also assume that the host uses a cache-coherent IO subsystem. Let's finally assume that the host is under memory pressure and starts to swap things out. Before this "uncached" page is evicted, we need to make sur

[PATCH v6 0/4] irqfd support for arm/arm64

2015-01-13 Thread Eric Auger
This patch series enables irqfd on arm and arm64. Irqfd framework enables to inject a virtual IRQ into a guest upon an eventfd trigger. User-side uses KVM_IRQFD VM ioctl to provide KVM with a kvm_irqfd struct that associates a VM, an eventfd, a virtual IRQ number (aka. the gsi). When an actor sign

[PATCH v6 2/4] KVM: introduce kvm_arch_intc_initialized

2015-01-13 Thread Eric Auger
Introduce __KVM_HAVE_ARCH_INTC_INITIALIZED define and associated kvm_arch_intc_initialized function. This latter allows to test whether the virtual interrupt controller is initialized and ready to accept virtual IRQ injection. On some architectures, the virtual interrupt controller is dynamically i

[PATCH v6 3/4] KVM: arm/arm64: implement kvm_arch_intc_initialized and use it in irqfd

2015-01-13 Thread Eric Auger
On arm/arm64 the VGIC is dynamically instantiated and it is useful to expose its state, especially for irqfd setup. This patch defines __KVM_HAVE_ARCH_INTC_INITIALIZED and implements kvm_arch_intc_initialized. The new function can now be used by irqfd to check whether the virtual interrupt contro

[PATCH v6 1/4] KVM: arm/arm64: unset CONFIG_HAVE_KVM_IRQCHIP

2015-01-13 Thread Eric Auger
CONFIG_HAVE_KVM_IRQCHIP is needed to support IRQ routing (along with irq_comm.c and irqchip.c usage). This is not the case for arm/arm64 currently. This patch unsets the flag for both arm and arm64. Signed-off-by: Eric Auger Acked-by: Christoffer Dall Acked-by: Will Deacon --- arch/arm/kvm/Kc

[PATCH v6 4/4] KVM: arm/arm64: add irqfd support

2015-01-13 Thread Eric Auger
This patch enables irqfd on arm/arm64. Both irqfd and resamplefd are supported. Injection is implemented in vgic.c without routing. This patch enables CONFIG_HAVE_KVM_EVENTFD and CONFIG_HAVE_KVM_IRQFD. KVM_CAP_IRQFD is now advertised. KVM_CAP_IRQFD_RESAMPLE capability automatically is advertised

Re: [v3 13/26] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2015-01-13 Thread Radim Kr?má?
2015-01-13 00:27+, Wu, Feng: > > On 09/01/2015 15:54, Radim Krčmář wrote: > > > There are two points relevant to this patch in new KVM's implementation, > > > ("KVM: x86: amend APIC lowest priority arbitration", > > > https://lkml.org/lkml/2015/1/9/362) > > > > > > 1) lowest priority depends o

Re: [PATCH 3/4] arm/arm64: KVM: Flush caches to memory on unmap

2015-01-13 Thread Marc Zyngier
On 13/01/15 13:47, Christoffer Dall wrote: > On Mon, Jan 12, 2015 at 09:13:52PM +0100, Christoffer Dall wrote: >> On Mon, Jan 12, 2015 at 11:15:34AM +, Marc Zyngier wrote: >>> On 11/01/15 12:30, Christoffer Dall wrote: On Fri, Jan 09, 2015 at 02:35:49PM +, Marc Zyngier wrote: > On

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Christoffer Dall
On Tue, Jan 13, 2015 at 01:41:03PM +, Peter Maydell wrote: > On 13 January 2015 at 13:35, Christoffer Dall > wrote: > > Wouldn't a guest (and I believe Linux does this) reserve ASID 0 for > > additional cores and use ASID 1+++ for itself? > > If the guest reserves an ASID for "MMU disabled" t

Re: [PATCH 3/4] arm/arm64: KVM: Flush caches to memory on unmap

2015-01-13 Thread Christoffer Dall
On Mon, Jan 12, 2015 at 09:13:52PM +0100, Christoffer Dall wrote: > On Mon, Jan 12, 2015 at 11:15:34AM +, Marc Zyngier wrote: > > On 11/01/15 12:30, Christoffer Dall wrote: > > > On Fri, Jan 09, 2015 at 02:35:49PM +, Marc Zyngier wrote: > > >> On 09/01/15 12:30, Christoffer Dall wrote: > >

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Peter Maydell
On 13 January 2015 at 13:35, Christoffer Dall wrote: > Wouldn't a guest (and I believe Linux does this) reserve ASID 0 for > additional cores and use ASID 1+++ for itself? If the guest reserves an ASID for "MMU disabled" then yes, that would work. The question of course is whether all guests do t

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Christoffer Dall
On Tue, Jan 13, 2015 at 12:12:41PM +, Peter Maydell wrote: > On 13 January 2015 at 12:04, Christoffer Dall > wrote: > > Additionally, I haven't been able to think of a reasonable guest > > scenario where this breaks. Once the guest turns on its MMU it should > > deal with the necessary icache

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Peter Maydell
On 13 January 2015 at 12:04, Christoffer Dall wrote: > Additionally, I haven't been able to think of a reasonable guest > scenario where this breaks. Once the guest turns on its MMU it should > deal with the necessary icache invalidation itself (I think), so we're > really talking about situation

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Christoffer Dall
On Tue, Jan 13, 2015 at 11:38:54AM +, Marc Zyngier wrote: > On 12/01/15 20:10, Christoffer Dall wrote: > > On Mon, Jan 12, 2015 at 09:58:30AM +, Marc Zyngier wrote: > >> On 11/01/15 18:38, Christoffer Dall wrote: > >>> On Sun, Jan 11, 2015 at 06:27:35PM +, Peter Maydell wrote: > On

Re: [PATCH 4/4] arm/arm64: KVM: use kernel mapping to perform invalidation on page fault

2015-01-13 Thread Marc Zyngier
On 12/01/15 20:10, Christoffer Dall wrote: > On Mon, Jan 12, 2015 at 09:58:30AM +, Marc Zyngier wrote: >> On 11/01/15 18:38, Christoffer Dall wrote: >>> On Sun, Jan 11, 2015 at 06:27:35PM +, Peter Maydell wrote: On 11 January 2015 at 17:58, Christoffer Dall wrote: > On Sun, J

[ÞATCH v2] kvmtool, mips: Support more than 256 MB guest memory

2015-01-13 Thread Andreas Herrmann
Two guest memory regions need to be defined and two "mem=" parameters need to be passed to guest kernel to support more than 256 MB. Cc: Chen, Tiejun Signed-off-by: Andreas Herrmann --- tools/kvm/mips/include/kvm/kvm-arch.h | 10 + tools/kvm/mips/kvm.c | 36