Re: [RFC PATCH] perf/kvm: Guest Symbol Resolution for powerpc

2015-06-17 Thread Hemant Kumar
Hi Arnaldo, On 06/16/2015 09:08 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Jun 16, 2015 at 08:20:53AM +0530, Hemant Kumar escreveu: perf kvm {record|report} is used to record and report the performance profile of any workload on a guest. From the host, we can collect guest kernel statistics

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 06:47:18PM +0200, Paolo Bonzini wrote: On 17/06/2015 18:41, Michael S. Tsirkin wrote: On Wed, Jun 17, 2015 at 06:38:25PM +0200, Paolo Bonzini wrote: On 17/06/2015 18:34, Michael S. Tsirkin wrote: On Wed, Jun 17, 2015 at 06:31:32PM +0200, Paolo Bonzini wrote:

Re: 32-bit fp/simd race - never mind :)

2015-06-17 Thread Mario Smarduch
I have been looking at it for too long, my concepts got twisted. On 06/17/2015 07:56 PM, Mario Smarduch wrote: Maybe I've been looking at this code too long, but it appears that on __kvm_vcpu_return we save/restore fp/simd registers and then change to hyp role. In between if we get an

Re: [PATCH v2 12/13] KVM: x86: add SMM to the MMU role, support SMRAM address space

2015-06-17 Thread Xiao Guangrong
On 06/17/2015 04:18 PM, Paolo Bonzini wrote: On 09/06/2015 06:01, Xiao Guangrong wrote: On 05/28/2015 01:05 AM, Paolo Bonzini wrote: This is now very simple to do. The only interesting part is a simple trick to find the right memslot in gfn_to_rmap, retrieving the address space from the

Re: [PATCH v2 09/13] KVM: x86: pass kvm_mmu_page to gfn_to_rmap

2015-06-17 Thread Xiao Guangrong
On 06/17/2015 04:15 PM, Paolo Bonzini wrote: On 09/06/2015 05:28, Xiao Guangrong wrote: -rmapp = gfn_to_rmap(kvm, sp-gfn, PT_PAGE_TABLE_LEVEL); +slots = kvm_memslots(kvm); +slot = __gfn_to_memslot(slots, sp-gfn); +rmapp = __gfn_to_rmap(sp-gfn, PT_PAGE_TABLE_LEVEL, slot);

32-bit fp/simd race

2015-06-17 Thread Mario Smarduch
Maybe I've been looking at this code too long, but it appears that on __kvm_vcpu_return we save/restore fp/simd registers and then change to hyp role. In between if we get an interrupt vCPU may be migrated to another CPU? Or am I missing something? Thanks, - Mario -- To unsubscribe from this

Re: [PATCH v2] arm: KVM: force execution of HCPTR access on VM exit

2015-06-17 Thread Vikram Sethi
Hi Marc, this version of the patch works for me. Tested-by: Vikram Sethi vikr...@codeaurora.org Thanks, Vikram On 06/17/15 04:27, Marc Zyngier wrote: On VM entry, we disable access to the VFP registers in order to perform a lazy save/restore of these registers. On VM exit, we restore access,

Re: [kvm:queue 94/94] mtrr.c:undefined reference to `__udivdi3'

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 19:02, kbuild test robot wrote: tree: git://git.kernel.org/pub/scm/virt/kvm/kvm.git queue head: 3b1a15b8db95eff1bcd9303057c9415f650c6331 commit: 3b1a15b8db95eff1bcd9303057c9415f650c6331 [94/94] KVM: MTRR: do not map huge page for non-consistent range config:

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 18:30:02 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 06:09:21PM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 17:38:40 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 05:12:57PM +0200, Igor Mammedov wrote: On

Re: [PATCH 0/2] KVM: PPC: Book3S HV: Dynamic micro-threading/split-core

2015-06-17 Thread Laurent Vivier
[I resend my message because MLs have refused the first one in HTML] On 28/05/2015 07:17, Paul Mackerras wrote: This patch series provides a way to use more of the capacity of each processor core when running guests configured with threads=1, 2 or 4 on a POWER8 host with HV KVM, without having

Re: [PATCH 0/2] KVM: PPC: Book3S HV: Dynamic micro-threading/split-core

2015-06-17 Thread Laurent Vivier
[I resend my message because MLs have refused the first one in HTML] On 28/05/2015 07:17, Paul Mackerras wrote: This patch series provides a way to use more of the capacity of each processor core when running guests configured with threads=1, 2 or 4 on a POWER8 host with HV KVM, without having

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 18:47:18 +0200 Paolo Bonzini pbonz...@redhat.com wrote: On 17/06/2015 18:41, Michael S. Tsirkin wrote: On Wed, Jun 17, 2015 at 06:38:25PM +0200, Paolo Bonzini wrote: On 17/06/2015 18:34, Michael S. Tsirkin wrote: On Wed, Jun 17, 2015 at 06:31:32PM +0200, Paolo

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 12:46:09 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:37:42PM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 12:11:09 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 10:54:21AM +0200, Igor Mammedov wrote: On

Re: [PATCH 1/2] KVM: fix checkpatch.pl errors in kvm/async_pf.h

2015-06-17 Thread Paolo Bonzini
On 16/06/2015 13:33, Kevin Mulvey wrote: fix brace spacing Signed-off-by: Kevin Mulvey kmul...@linux.com --- virt/kvm/async_pf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/async_pf.h b/virt/kvm/async_pf.h index e7ef6447..ec4cfa2 100644 ---

Re: [PATCH 07/10] KVM: arm/arm64: vgic: Allow HW interrupts to be queued to a guest

2015-06-17 Thread Marc Zyngier
Hi Eric, On 17/06/15 12:51, Eric Auger wrote: Hi Marc, On 06/08/2015 07:04 PM, Marc Zyngier wrote: To allow a HW interrupt to be injected into a guest, we lookup the guest virtual interrupt in the irq_phys_map rbtree, and if we have a match, encode both interrupts in the LR. We also mark

Re: [PATCH 0/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 08:31:23 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:19:15AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:16:07 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Jun 16, 2015 at 06:33:34PM +0200, Igor Mammedov wrote:

Re: [PATCH] KVM: nSVM: Check for NRIPS support before updating control field

2015-06-17 Thread Paolo Bonzini
On 11/06/2015 08:05, Bandan Das wrote: If hardware doesn't support DecodeAssist - a feature that provides more information about the intercept in the VMCB, KVM decodes the instruction and then updates the next_rip vmcb control field. However, NRIP support itself depends on cpuid

[PATCH v3 09/10] arm: add support for supplying GICv3 redistributor addresses

2015-06-17 Thread Andre Przywara
Instead of the GIC virtual CPU interface an emulated GICv3 needs to have accesses to its emulated redistributors trapped in the guest. Add code to tell the kernel about the mapping if a GICv3 emulation was requested by the user. This contains some defines which are not (yet) in the (32 bit)

[PATCH v3 05/10] arm: finish VGIC initialisation explicitly

2015-06-17 Thread Andre Przywara
Since Linux 3.19-rc1 there is a new API to explicitly initialise the in-kernel GIC emulation by a userland KVM device call. Use that to tell the kernel we are finished with the GIC initialisation, since the automatic GIC init will only be provided as a legacy functionality in the future.

[PATCH v3 01/10] AArch64: Reserve two 64k pages for GIC CPU interface

2015-06-17 Thread Andre Przywara
From: Marc Zyngier marc.zyng...@arm.com On AArch64 system with a GICv2, the GICC range can be aligned to the last 4k block of a 64k page, ending up straddling two 64k pages. In order not to conflict with the distributor mapping, allocate two 64k pages to the CPU interface. Signed-off-by: Marc

[PATCH v3 02/10] AArch{32,64}: use KVM_CREATE_DEVICE co to instanciate the GIC

2015-06-17 Thread Andre Przywara
From: Marc Zyngier marc.zyng...@arm.com As of 3.14, KVM/arm supports the creation/configuration of the GIC through a more generic device API, which is now the preferred way to do so. Plumb the new API in, and allow the old code to be used as a fallback. [Andre: Rename some functions on the way

[PATCH v3 06/10] arm: simplify MMIO dispatching

2015-06-17 Thread Andre Przywara
Currently we separate any incoming MMIO request into one of the ARM memory map regions and take care to spare the GIC. It turns out that this is unnecessary, as we only have one special region (the IO port area in the first 64 KByte). The MMIO rbtree takes care about unhandled MMIO ranges, so we

[PATCH v3 03/10] irq: add irq__get_nr_allocated_lines

2015-06-17 Thread Andre Przywara
From: Marc Zyngier marc.zyng...@arm.com The ARM GIC emulation needs to be told the number of interrupts it has to support. As commit 1c262fa1dc7bc (kvm tools: irq: make irq__alloc_line generic) made the interrupt counter private, add a new accessor returning the number of interrupt lines we've

[PATCH v3 10/10] arm: use new irqchip parameter to create different vGIC types

2015-06-17 Thread Andre Przywara
Currently we unconditionally create a virtual GICv2 in the guest. Add a --irqchip= parameter to let the user specify a different GIC type for the guest. For now we the only other supported type is GICv3. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- arm/aarch64/arm-cpu.c

[PATCH v3 07/10] limit number of VCPUs on demand

2015-06-17 Thread Andre Przywara
Currently the ARM GIC checks the number of VCPUs against a fixed limit, which is GICv2 specific. Don't pretend we know better than the kernel and let's get rid of that explicit check. Instead be more relaxed about KVM_CREATE_VCPU failing with EINVAL, which is the way the kernel communicates having

[PATCH v3 00/10] kvmtool: arm64: GICv3 guest support

2015-06-17 Thread Andre Przywara
Hi, a new version of the GICv3 support series for kvmtool. I got rid of passing the number of redistributors around kvmtool. The new patch 06/10 simplifies ARM's MMIO dispatching, so that we no longer need to know the GIC size at this point. The FDT code uses base and size values now directly

[PATCH v3 08/10] arm: prepare for instantiating different IRQ chip devices

2015-06-17 Thread Andre Przywara
Extend the vGIC handling code to potentially deal with different IRQ chip devices instead of hard-coding the GICv2 in. We extend most vGIC functions to take a type parameter, but still put GICv2 in at the top for the time being. Signed-off-by: Andre Przywara andre.przyw...@arm.com ---

[PATCH v3 04/10] AArch{32,64}: dynamically configure the number of GIC interrupts

2015-06-17 Thread Andre Przywara
From: Marc Zyngier marc.zyng...@arm.com In order to reduce the memory usage of large guests (as well as improve performance), tell KVM about the number of interrupts we require. To avoid synchronization with the various device creation, use a late_init callback to compute the GIC configuration.

Re: [PATCH 07/10] KVM: arm/arm64: vgic: Allow HW interrupts to be queued to a guest

2015-06-17 Thread Eric Auger
Hi Marc, On 06/08/2015 07:04 PM, Marc Zyngier wrote: To allow a HW interrupt to be injected into a guest, we lookup the guest virtual interrupt in the irq_phys_map rbtree, and if we have a match, encode both interrupts in the LR. We also mark the interrupt as active at the host distributor

Re: [PATCH 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-06-17 Thread Eric Auger
On 06/08/2015 07:03 PM, Marc Zyngier wrote: Now that struct vgic_lr supports the LR_HW bit and carries a hwirq field, we can encode that information into the list registers. This patch provides implementations for both GICv2 and GICv3. Signed-off-by: Marc Zyngier marc.zyng...@arm.com ---

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 13:51:56 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 01:48:03PM +0200, Igor Mammedov wrote: So far it's kernel limitation and this patch fixes crashes that users see now, with the rest of patches enabling performance not to regress.

Re: [PATCH v3 00/18] x86/tsc: Clean up rdtsc helpers

2015-06-17 Thread Borislav Petkov
On Tue, Jun 16, 2015 at 05:35:48PM -0700, Andy Lutomirski wrote: My sincere apologies for the spam. I send an unholy mixture of the real patch set and an old poorly split-up patch set, and the result is incomprehensible. Here's what I meant to send. After the some recent threads about

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-17 Thread Pavel Fedin
Hello! Yes, I am about to get a v2 ready, but mostly with some fixes. If you want to work on top of it, I can push a WIP branch to my repo. Thank you but no need to hurry up. I am busy with other things too. And, anyway, i work on top of my own branch here. As Marc mentioned before, this

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 01:48:03PM +0200, Igor Mammedov wrote: So far it's kernel limitation and this patch fixes crashes that users see now, with the rest of patches enabling performance not to regress. When I say regression I refer to an option to limit the array size again after

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 12:00:56AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:14:20 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Jun 16, 2015 at 06:33:37PM +0200, Igor Mammedov wrote: since commit 1d4e7e3 kvm: x86: increase user memory slots to 509 it became

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 08:34:26 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:00:56AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:14:20 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Jun 16, 2015 at 06:33:37PM +0200, Igor Mammedov wrote:

Re: [PATCH v3 17/18] x86/kvm/tsc: Drop extra barrier and use rdtsc_ordered in kvmclock

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 02:36, Andy Lutomirski wrote: __pvclock_read_cycles had an unnecessary barrier. Get rid of that barrier and clean up the code by just using rdtsc_ordered(). Cc: Paolo Bonzini pbonz...@redhat.com Cc: Radim Krcmar rkrc...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com

Re: [PATCH v2 12/13] KVM: x86: add SMM to the MMU role, support SMRAM address space

2015-06-17 Thread Paolo Bonzini
On 09/06/2015 06:01, Xiao Guangrong wrote: On 05/28/2015 01:05 AM, Paolo Bonzini wrote: This is now very simple to do. The only interesting part is a simple trick to find the right memslot in gfn_to_rmap, retrieving the address space from the spte role word. The same trick is used in

Re: [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference

2015-06-17 Thread Paolo Bonzini
On 09/06/2015 04:16, Wanpeng Li wrote: So in the end the patched vcpu_scan_ioapic becomes if (kvm_apic_hw_enabled(vcpu-arch.apic)) s/kvm_apic_hw_enabled(vcpu-arch.apic)/!kvm_apic_hw_enabled(vcpu-arch.apic) Right, thanks for the correction. Paolo -- To unsubscribe from this list:

Re: [PATCH v2 09/13] KVM: x86: pass kvm_mmu_page to gfn_to_rmap

2015-06-17 Thread Paolo Bonzini
On 09/06/2015 05:28, Xiao Guangrong wrote: -rmapp = gfn_to_rmap(kvm, sp-gfn, PT_PAGE_TABLE_LEVEL); +slots = kvm_memslots(kvm); +slot = __gfn_to_memslot(slots, sp-gfn); +rmapp = __gfn_to_rmap(sp-gfn, PT_PAGE_TABLE_LEVEL, slot); Why @sp is not available here? Because the

Re: [PATCH 0/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 12:19:15AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:16:07 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Jun 16, 2015 at 06:33:34PM +0200, Igor Mammedov wrote: Series extends vhost to support upto 509 memory regions, and adds some

Re: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event

2015-06-17 Thread Andreas Herrmann
On Tue, Jun 16, 2015 at 06:17:14PM +0100, Will Deacon wrote: On Mon, Jun 15, 2015 at 12:49:45PM +0100, Andreas Herrmann wrote: W/o dedicated endianess it's impossible to find reliably a match e.g. in kernel/virt/kvm/eventfd.c ioeventfd_in_range. Hmm, but shouldn't this be the endianness of

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 09:28:02AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 08:34:26 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:00:56AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:14:20 +0200 Michael S. Tsirkin m...@redhat.com wrote:

Re: [PATCH 0/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 09:33:57AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 08:31:23 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:19:15AM +0200, Igor Mammedov wrote: On Tue, 16 Jun 2015 23:16:07 +0200 Michael S. Tsirkin m...@redhat.com wrote:

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-17 Thread Pavel Fedin
PING! The discussion has suddenly stopped... What is our status? Is ITS v2 patch being developed, or what? And do we have some conclusion on irqfd ? Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia -Original Message- From:

[PATCH 0/3] kvmtool: fixes for PowerPC

2015-06-17 Thread Andre Przywara
Hello, some patches to fix at least the build of the new kvmtool for PowerPC. I could only compile test it so far, so I'd be grateful if people more familiar with that architecture can have a look and maybe even test it on actual machines. Cheers, Andre. Andre Przywara (3): powerpc: implement

[PATCH 2/3] powerpc: use default endianness for converting guest/init

2015-06-17 Thread Andre Przywara
For converting the guest/init binary into an object file, we call the linker binary, setting the endianness to big endian explicitly when compiling kvmtool for powerpc. This breaks if the compiler is actually targetting little endian (which is true for the Debian port, for instance). Remove the

[PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Andre Przywara
The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this header file directly. Signed-off-by: Andre Przywara

[PATCH 2/3] powerpc: use default endianness for converting guest/init

2015-06-17 Thread Andre Przywara
For converting the guest/init binary into an object file, we call the linker binary, setting the endianness to big endian explicitly when compiling kvmtool for powerpc. This breaks if the compiler is actually targetting little endian (which is true for the Debian port, for instance). Remove the

[PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Andre Przywara
The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this header file directly. Signed-off-by: Andre Przywara

[PATCH 0/3] kvmtool: fixes for PowerPC

2015-06-17 Thread Andre Przywara
Hello, some patches to fix at least the build of the new kvmtool for PowerPC. I could only compile test it so far, so I'd be grateful if people more familiar with that architecture can have a look and maybe even test it on actual machines. Cheers, Andre. Andre Przywara (3): powerpc: implement

[PATCH 1/3] powerpc: implement barrier primitives

2015-06-17 Thread Andre Przywara
Instead of referring to the Linux header including the barrier macros, copy over the rather simple implementation for the PowerPC barrier instructions kvmtool uses. This fixes build for powerpc. Signed-off-by: Andre Przywara andre.przyw...@arm.com --- Hi, I just took what kvmtool seems to have

[PATCH v2] arm: KVM: force execution of HCPTR access on VM exit

2015-06-17 Thread Marc Zyngier
On VM entry, we disable access to the VFP registers in order to perform a lazy save/restore of these registers. On VM exit, we restore access, test if we did enable them before, and save/restore the guest/host registers if necessary. In this sequence, the FPEXC register is always accessed,

Re: [PATCH v3 01/18] x86/tsc: Inline native_read_tsc and remove __native_read_tsc

2015-06-17 Thread Borislav Petkov
On Tue, Jun 16, 2015 at 05:35:49PM -0700, Andy Lutomirski wrote: In cdc7957d1954 (x86: move native_read_tsc() offline), native_read_tsc was moved out of line, presumably for some now-obsolete vDSO-related reason. Undo it. The entire rdtsc, shl, or sequence is only 11 bytes, and calls via

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 10:54:21AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 09:39:06 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 09:28:02AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 08:34:26 +0200 Michael S. Tsirkin m...@redhat.com wrote:

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 12:11:09 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 10:54:21AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 09:39:06 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 09:28:02AM +0200, Igor Mammedov wrote: On

RE: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-17 Thread Pavel Fedin
Hello! Hmmm. You may not have noticed it, but we're actually all are quite busy at the moment (hint, we're at -rc8, and the next merge window is about to open). Ok ok, i do not mind of course. :) Just i expected at least some, quick reply. It's like talking to a person while he/she

Re: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 08:17:49AM +0100, Andreas Herrmann wrote: On Tue, Jun 16, 2015 at 06:17:14PM +0100, Will Deacon wrote: On Mon, Jun 15, 2015 at 12:49:45PM +0100, Andreas Herrmann wrote: W/o dedicated endianess it's impossible to find reliably a match e.g. in

Re: [PATCH v3 04/18] x86/tsc: Replace rdtscll with native_read_tsc

2015-06-17 Thread Borislav Petkov
On Tue, Jun 16, 2015 at 05:35:52PM -0700, Andy Lutomirski wrote: Now that the read_tsc paravirt hook is gone, rdtscll() is just a wrapper around native_read_tsc(). Unwrap it. Signed-off-by: Andy Lutomirski l...@kernel.org --- arch/x86/boot/compressed/aslr.c | 2 +-

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
On Wed, 17 Jun 2015 09:39:06 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 09:28:02AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 08:34:26 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 12:00:56AM +0200, Igor Mammedov wrote: On

[PATCH] arm64/kvm: Add generic v8 KVM target

2015-06-17 Thread Suzuki K. Poulose
From: Suzuki K. Poulose suzuki.poul...@arm.com This patch adds a generic ARM v8 KVM target cpu type for use by the new CPUs which eventualy ends up using the common sys_reg table. For backward compatibility the existing targets have been preserved. Any new target CPU that can be covered by

Re: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-17 Thread Marc Zyngier
On 17/06/15 10:21, Pavel Fedin wrote: PING! The discussion has suddenly stopped... What is our status? Is ITS v2 patch being developed, or what? And do we have some conclusion on irqfd ? Hmmm. You may not have noticed it, but we're actually all are quite busy at the moment (hint, we're at

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 12:37:42PM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 12:11:09 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 10:54:21AM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 09:39:06 +0200 Michael S. Tsirkin m...@redhat.com wrote:

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-17 Thread Alexander Graf
On 17.06.15 12:15, Will Deacon wrote: On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: Instead of referring to the Linux header including the barrier macros, copy over the rather simple implementation for the PowerPC barrier instructions kvmtool uses. This fixes build for

Re: IRQFD support with GICv3 ITS (WAS: RE: [PATCH 00/13] arm64: KVM: GICv3 ITS emulation)

2015-06-17 Thread Andre Przywara
Здравствуй Pavel, On 06/17/2015 10:21 AM, Pavel Fedin wrote: PING! The discussion has suddenly stopped... What is our status? Is ITS v2 patch being developed, or what? Yes, I am about to get a v2 ready, but mostly with some fixes. If you want to work on top of it, I can push a WIP branch

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 08:34, Michael S. Tsirkin wrote: Also - 509? userspace memory slots in terms of KVM, I made it match KVM's allotment of memory slots for userspace side. Maybe KVM has its reasons for this #. Nice power of two (512) - number of reserved slots required by Intel's

Re: [PATCH v3 02/18] x86/msr/kvm: Remove vget_cycles()

2015-06-17 Thread Borislav Petkov
On Tue, Jun 16, 2015 at 05:35:50PM -0700, Andy Lutomirski wrote: The only caller was kvm's read_tsc. The only difference between vget_cycles and native_read_tsc was that vget_cycles returned zero instead of crashing on TSC-less systems. KVM's already checks vclock_mode before calling that

Re: [PATCH v3 03/18] x86/tsc/paravirt: Remove the read_tsc and read_tscp paravirt hooks

2015-06-17 Thread Borislav Petkov
+ paravirt list. On Tue, Jun 16, 2015 at 05:35:51PM -0700, Andy Lutomirski wrote: We've had read_tsc and read_tscp paravirt hooks since the very beginning of paravirt, i.e., d3561b7fa0fb ([PATCH] paravirt: header and stubs for paravirtualisation). AFAICT the only paravirt guest

Re: [PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:50AM +0100, Andre Przywara wrote: The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this

Re: [PATCH 3/3] powerpc: add hvcall.h header from Linux

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:50AM +0100, Andre Przywara wrote: The powerpc code uses some PAPR hypercalls, of which we need the hypercall number. Copy the macro definition parts from the kernel's (private) hvcall.h file and remove the extra tricks formerly used to be able to include this

Re: [PATCH 1/3] powerpc: implement barrier primitives

2015-06-17 Thread Will Deacon
On Wed, Jun 17, 2015 at 10:43:48AM +0100, Andre Przywara wrote: Instead of referring to the Linux header including the barrier macros, copy over the rather simple implementation for the PowerPC barrier instructions kvmtool uses. This fixes build for powerpc. Signed-off-by: Andre Przywara

Re: [PATCH 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:53, Eric Auger wrote: On 06/08/2015 07:03 PM, Marc Zyngier wrote: Now that struct vgic_lr supports the LR_HW bit and carries a hwirq field, we can encode that information into the list registers. This patch provides implementations for both GICv2 and GICv3. Signed-off-by:

Re: [PATCH v3 06/10] arm: simplify MMIO dispatching

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:21, Andre Przywara wrote: Currently we separate any incoming MMIO request into one of the ARM memory map regions and take care to spare the GIC. It turns out that this is unnecessary, as we only have one special region (the IO port area in the first 64 KByte). The MMIO rbtree

Re: [PATCH v3 08/10] arm: prepare for instantiating different IRQ chip devices

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:21, Andre Przywara wrote: Extend the vGIC handling code to potentially deal with different IRQ chip devices instead of hard-coding the GICv2 in. We extend most vGIC functions to take a type parameter, but still put GICv2 in at the top for the time being. Signed-off-by: Andre

Re: [PATCH v3 09/10] arm: add support for supplying GICv3 redistributor addresses

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:22, Andre Przywara wrote: Instead of the GIC virtual CPU interface an emulated GICv3 needs to have accesses to its emulated redistributors trapped in the guest. Add code to tell the kernel about the mapping if a GICv3 emulation was requested by the user. This contains some

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 15:13, Michael S. Tsirkin wrote: Considering userspace can be malicious, I guess yes. I don't think it's a valid concern in this case, setting limit back from 509 to 64 will not help here in any way, userspace still can create as many vhost instances as it needs to

[PATCH v2 0/6] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
Ref to prefious version discussion: [PATCH 0/5] vhost: support upto 509 memory regions http://www.spinics.net/lists/kvm/msg117654.html Chagelog v1-v2: * fix spelling errors * move vhost: support upto 509 memory regions to the end of queue * move kvfree() form 1/6 to 2/6 where it belongs

Re: [PATCH 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-06-17 Thread Peter Maydell
On 17 June 2015 at 12:53, Eric Auger eric.au...@linaro.org wrote: shouldn't we test somewhere that the hwirq is between 16 and 1019. Not directly related, but that reminds me that I noticed the other day that we have VGIC_MAX_IRQS = 1024 (and use that as a guard on how many irqs we let userspace

Re: [PATCH v3 10/10] arm: use new irqchip parameter to create different vGIC types

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:22, Andre Przywara wrote: Currently we unconditionally create a virtual GICv2 in the guest. Add a --irqchip= parameter to let the user specify a different GIC type for the guest. For now we the only other supported type is GICv3. Superfluous we. Also, spelling out the expected

[PATCH v2 2/6] vhost: extend memory regions allocation to vmalloc

2015-06-17 Thread Igor Mammedov
with large number of memory regions we could end up with high order allocations and kmalloc could fail if host is under memory pressure. Considering that memory regions array is used on hot path try harder to allocate using kmalloc and if it fails resort to vmalloc. It's still better than just

[PATCH v2 3/6] vhost: add per VQ memory region caching

2015-06-17 Thread Igor Mammedov
that brings down translate_desc() cost to around 210ns if accessed descriptors are from the same memory region. Signed-off-by: Igor Mammedov imamm...@redhat.com --- that's what netperf/iperf workloads were during testing. --- drivers/vhost/vhost.c | 16 +--- drivers/vhost/vhost.h |

Re: [PATCH v3 17/18] x86/kvm/tsc: Drop extra barrier and use rdtsc_ordered in kvmclock

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 09:47, Paolo Bonzini wrote: On 17/06/2015 02:36, Andy Lutomirski wrote: __pvclock_read_cycles had an unnecessary barrier. Get rid of that barrier and clean up the code by just using rdtsc_ordered(). Cc: Paolo Bonzini pbonz...@redhat.com Cc: Radim Krcmar

Re: [PATCH v3 02/18] x86/msr/kvm: Remove vget_cycles()

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 02:35, Andy Lutomirski wrote: The only caller was kvm's read_tsc. The only difference between vget_cycles and native_read_tsc was that vget_cycles returned zero instead of crashing on TSC-less systems. KVM's already checks vclock_mode before calling that function, so the

Re: [PATCH 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-06-17 Thread Marc Zyngier
On 17/06/15 14:21, Peter Maydell wrote: On 17 June 2015 at 12:53, Eric Auger eric.au...@linaro.org wrote: shouldn't we test somewhere that the hwirq is between 16 and 1019. Not directly related, but that reminds me that I noticed the other day that we have VGIC_MAX_IRQS = 1024 (and use that

Re: [PATCH v3 06/10] arm: simplify MMIO dispatching

2015-06-17 Thread Andre Przywara
Hi Marc, On 06/17/2015 01:48 PM, Marc Zyngier wrote: On 17/06/15 12:21, Andre Przywara wrote: Currently we separate any incoming MMIO request into one of the ARM memory map regions and take care to spare the GIC. It turns out that this is unnecessary, as we only have one special region (the

[PATCH v2 5/6] vhost: add 'translation_cache' module parameter

2015-06-17 Thread Igor Mammedov
by default translation of virtqueue descriptors is done with caching enabled, but caching will add only extra cost in cases of trashing workload where majority descriptors are translated to different memory regions. So add an option to allow exclude cache miss cost for such cases. Performance

[PATCH v2 1/6] vhost: use binary search instead of linear in find_region()

2015-06-17 Thread Igor Mammedov
For default region layouts performance stays the same as linear search i.e. it takes around 210ns average for translate_desc() that inlines find_region(). But it scales better with larger amount of regions, 235ns BS vs 300ns LS with 55 memory regions and it will be about the same values when

Re: [PATCH v3 00/18] x86/tsc: Clean up rdtsc helpers

2015-06-17 Thread Paolo Bonzini
On 17/06/2015 13:11, Borislav Petkov wrote: peterz reminded me that I'm lazy actually and don't reply to each patch :) So, I like it, looks good, nice cleanup. It boots on my guest here - I haven't done any baremetal testing though. Let's give people some more time to look at it... Same

Re: [PATCH 1/2] kvm/x86: Hyper-V based guest crash data handling

2015-06-17 Thread Paolo Bonzini
On 11/06/2015 15:18, Denis V. Lunev wrote: From: Andrey Smetanin asmeta...@virtuozzo.com Windows 2012 guests can notify hypervisor about occurred guest crash (Windows bugcheck(BSOD)) by writing specific Hyper-V msrs. This patch does handling of this MSR's by KVM and sending notification to

[PATCH v2 4/6] vhost: translate_desc: optimization for desc.len region size

2015-06-17 Thread Igor Mammedov
when translating descriptors they are typically less than memory region that holds them and translated into 1 iov entry, so it's not nessesary to check remaining length twice and calculate used length and next address in such cases. replace a remaining length and 'size' increment branches with a

Re: [PATCH v3 07/10] limit number of VCPUs on demand

2015-06-17 Thread Andre Przywara
On 06/17/2015 01:53 PM, Marc Zyngier wrote: On 17/06/15 12:21, Andre Przywara wrote: Currently the ARM GIC checks the number of VCPUs against a fixed limit, which is GICv2 specific. Don't pretend we know better than the kernel and let's get rid of that explicit check. Instead be more relaxed

Re: [PATCH v3 07/10] limit number of VCPUs on demand

2015-06-17 Thread Marc Zyngier
On 17/06/15 12:21, Andre Przywara wrote: Currently the ARM GIC checks the number of VCPUs against a fixed limit, which is GICv2 specific. Don't pretend we know better than the kernel and let's get rid of that explicit check. Instead be more relaxed about KVM_CREATE_VCPU failing with EINVAL,

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 02:23:39PM +0200, Igor Mammedov wrote: On Wed, 17 Jun 2015 13:51:56 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Jun 17, 2015 at 01:48:03PM +0200, Igor Mammedov wrote: So far it's kernel limitation and this patch fixes crashes that users see now,

[PATCH v2 6/6] vhost: support upto 509 memory regions

2015-06-17 Thread Igor Mammedov
since commit 1d4e7e3 kvm: x86: increase user memory slots to 509 it became possible to use a bigger amount of memory slots, which is used by memory hotplug for registering hotplugged memory. However QEMU crashes if it's used with more than ~60 pc-dimm devices and vhost-net since host kernel in

Re: [PATCH 2/2] qemu/kvm: kvm guest crash event handling

2015-06-17 Thread Paolo Bonzini
On 11/06/2015 15:18, Denis V. Lunev wrote: From: Andrey Smetanin asmeta...@virtuozzo.com KVM Hyper-V based guests can notify hypervisor about occurred guest crash. This patch does handling of KVM crash event by sending to libvirt guest panic event that allows to gather guest crash dump by

Re: [PATCH v3 06/10] arm: simplify MMIO dispatching

2015-06-17 Thread Marc Zyngier
On 17/06/15 14:49, Andre Przywara wrote: Hi Marc, On 06/17/2015 01:48 PM, Marc Zyngier wrote: On 17/06/15 12:21, Andre Przywara wrote: Currently we separate any incoming MMIO request into one of the ARM memory map regions and take care to spare the GIC. It turns out that this is

Re: [PATCH 3/5] vhost: support upto 509 memory regions

2015-06-17 Thread Michael S. Tsirkin
On Wed, Jun 17, 2015 at 03:20:44PM +0200, Paolo Bonzini wrote: On 17/06/2015 15:13, Michael S. Tsirkin wrote: Considering userspace can be malicious, I guess yes. I don't think it's a valid concern in this case, setting limit back from 509 to 64 will not help here in any way,

Re: [PATCH 10/10] KVM: arm/arm64: vgic: Allow non-shared device HW interrupts

2015-06-17 Thread Eric Auger
Hi Marc, On 06/08/2015 07:04 PM, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each vcpu, as the device is is shared across all vcpus. s/is// This does not work for a device that has been assigned to

Re: [PATCH 10/10] KVM: arm/arm64: vgic: Allow non-shared device HW interrupts

2015-06-17 Thread Marc Zyngier
On 17/06/15 16:11, Eric Auger wrote: Hi Marc, On 06/08/2015 07:04 PM, Marc Zyngier wrote: So far, the only use of the HW interrupt facility is the timer, implying that the active state is context-switched for each vcpu, as the device is is shared across all vcpus. s/is// This does not work

Re: [PATCH 08/10] KVM: arm/arm64: vgic: Add vgic_{get,set}_phys_irq_active

2015-06-17 Thread Eric Auger
Reviewed-by: Eric Auger eric.au...@linaro.org On 06/08/2015 07:04 PM, Marc Zyngier wrote: In order to control the active state of an interrupt, introduce a pair of accessors allowing the state to be set/queried. This only affects the logical state, and the HW state will only be applied at

  1   2   >