[PATCHv3 0/2] Fixes for kvmtool virtio-net part

2015-07-20 Thread Fan Du
Changelog: v2: - Rebase with Will kvmtool.git tree[1] - Drop patch2 from v1, as commit f83dc816a9c7 has already fix it v3: - Remove -Wunused-variable warnings Fan Du (2): kvmtool: Introduce downscript option for virtio-net kvmtool: Restrict virtio queue number to 1 when vhost on includ

[PATCHv3 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on

2015-07-20 Thread Fan Du
vhost kernel driver does not support mutiple queue yet, Tweak queue number will fail with "--net mode=tap,vhost=1,mq=2" as below when lkvm trying to set ring kick fd for queue 2: VHOST_SET_VRING_KICK failed: No buffer space available Error on this scenario, and overide with the default one queue

[PATCHv3 1/2] kvmtool: Introduce downscript option for virtio-net

2015-07-20 Thread Fan Du
To detach tap device automatically from bridge when exiting, just like what the reverse of "script" does. Signed-off-by: Fan Du --- include/kvm/virtio-net.h | 1 + virtio/net.c | 49 2 files changed, 38 insertions(+), 12 deletions(-)

RE: [PATCH 0/3] Fixes for kvmtool virtio-net part

2015-07-20 Thread Du, Fan
>-Original Message- >From: Andre Przywara [mailto:andre.przyw...@arm.com] >Sent: Monday, July 20, 2015 10:43 PM >To: Du, Fan >Cc: kvm@vger.kernel.org; penb...@kernel.org; Will Deacon; Marc Zyngier >Subject: Re: [PATCH 0/3] Fixes for kvmtool virtio-net part > >Hi, >> >> This changset provi

[PATCH 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on

2015-07-20 Thread Fan Du
vhost kernel driver does not support mutiple queue yet, Tweak queue number will fail with "--net mode=tap,vhost=1,mq=2" as below when lkvm trying to set ring kick fd for queue 2: VHOST_SET_VRING_KICK failed: No buffer space available Error on this scenario, and overide with the default one queue

[PATCH 0/2] Fixes for kvmtool virtio-net part

2015-07-20 Thread Fan Du
This changset provide some fix and small enhancement for kvm tool when I play it for the firt time. Changelog: v2: - Rebase with Will kvmtool.git tree[1] - Drop patch2 from v1, as commit f83dc816a9c7 has already fix it [1]: https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git Fan

[PATCH 1/2] kvmtool: Introduce downscript option for virtio-net

2015-07-20 Thread Fan Du
To detach tap device automatically from bridge when exiting, just like what the reverse of "script" does. Signed-off-by: Fan Du --- include/kvm/virtio-net.h | 1 + virtio/net.c | 50 +--- 2 files changed, 40 insertions(+), 11 deletions(-)

Re: [PATCH 07/18] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

2015-07-20 Thread Shannon Zhao
On 2015/7/17 22:30, Christoffer Dall wrote: > On Mon, Jul 06, 2015 at 10:17:37AM +0800, shannon.z...@linaro.org wrote: >> From: Shannon Zhao >> >> When we use tools like perf on host, perf passes the event type and the >> id in this type category to kernel, then kernel will map them to event >>

Re: [PATCH 04/18] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register

2015-07-20 Thread Shannon Zhao
On 2015/7/17 18:21, Christoffer Dall wrote: > On Fri, Jul 17, 2015 at 04:45:44PM +0800, Shannon Zhao wrote: >> >> >> On 2015/7/17 3:55, Christoffer Dall wrote: >>> On Mon, Jul 06, 2015 at 10:17:34AM +0800, shannon.z...@linaro.org wrote: From: Shannon Zhao Add reset handler which g

Re: [PATCH 1/3] kvm-tool: Introduce downscript option

2015-07-20 Thread Andre Przywara
Hi, On 20/07/15 10:28, Fan Du wrote: > To detach tap device automatically from bridge when exiting, > just like the reverse of "script" does. > > Signed-off-by: Fan Du > --- > tools/kvm/include/kvm/virtio-net.h | 1 + > tools/kvm/virtio/net.c | 28 > 2

Re: [PATCH 07/12] util/util.c: avoid clang error on vsnprintf

2015-07-20 Thread Andre Przywara
Hi Claudio, On 20/07/15 15:28, Claudio Fontana wrote: > On 17.07.2015 18:50, Will Deacon wrote: >> On Fri, Jul 17, 2015 at 05:02:13PM +0100, Andre Przywara wrote: >>> clang by default doesn't seem to like printf calls with non-literal >>> format strings. >>> Add the proper pragma to disable this w

Re: [PATCH 0/3] Fixes for kvmtool virtio-net part

2015-07-20 Thread Andre Przywara
Hi, > > This changset provide some fix and small enhancement > for kvm tool when I play it with virtio part. have you seen the new kvmtool repository Will created, which is a stand-alone version outside of the Linux tree? https://git.kernel.org/cgit/linux/kernel/git/will/kvmtool.git/ It seems l

Re: [PATCH 07/12] util/util.c: avoid clang error on vsnprintf

2015-07-20 Thread Claudio Fontana
On 17.07.2015 18:50, Will Deacon wrote: > On Fri, Jul 17, 2015 at 05:02:13PM +0100, Andre Przywara wrote: >> clang by default doesn't seem to like printf calls with non-literal >> format strings. >> Add the proper pragma to disable this warning in the report function >> to make kvmtool compile with

[PATCH 05/14] arm: use new phandle allocation functions

2015-07-20 Thread Andre Przywara
To refer to the GIC FDT node, we used to pass the GIC phandle to most of the functions dealing with FDT nodes. Since we now have a global phandle reference, use that to refer to the GIC handle in various places and get rid of the now unneeded parameter passing. Signed-off-by: Andre Przywara ---

[PATCH 04/14] FDT: introduce global phandle allocation

2015-07-20 Thread Andre Przywara
Allocating an FDT phandle (a unique identifier) using a static variable in a static inline function defined in a header file works only if all users are in the same source file. So trying to allocate a handle from two different compilation units fails. Introduce global phandle allocation and refere

[PATCH 14/14] extend GSI IRQ routing to take a device ID

2015-07-20 Thread Andre Przywara
For ITS emulation we need the device ID along with the MSI payload and doorbell address to identify an MSI, so we need to put it in the GSI IRQ routing table too. There is a per-VM capability by which the kernel signals the need for a device ID, so check this and put the device ID into the routing

[PATCH 06/14] TEMPORARY: arm: update public headers for GICv3 ITS emulation

2015-07-20 Thread Andre Przywara
This patch is preliminary and updates the headers from a kernel with ITS emulation support. It should be replaced by a proper header update once ITS support is upstream. Contains a "hack" to support compiling on ARM, too. Signed-off-by: Andre Przywara --- arm/aarch64/include/asm/kvm.h | 3 +++ a

[PATCH 07/14] arm: allow creation of an MSI register frame region

2015-07-20 Thread Andre Przywara
The GICv3 ITS expects a separate 64K page to hold ITS registers. Add a function to reserve such a page in the guest's I/O memory and use that for the ITS vGIC type. Signed-off-by: Andre Przywara --- arm/gic.c| 36 arm/include/arm-common/gi

[PATCH 12/14] arm: setup SPI IRQ routing tables

2015-07-20 Thread Andre Przywara
Since we soon start using GSI routing on ARM platforms too, we have to setup the initial SPI routing table. Before the first call to KVM_SET_GSI_ROUTING, the kernel holds this table internally, but this is overwritten with the ioctl, so we have to explicitly set it up here. The routing is actually

[PATCH 13/14] TEMPORARY: update public headers for kvm_irq_routing_msi extension

2015-07-20 Thread Andre Przywara
This patch is preliminary and updates the headers from a kernel with extended IRQ routing support (for ARM). It should be replaced by a proper header update once IRQ routing support is upstream. Signed-off-by: Andre Przywara --- include/linux/kvm.h | 5 - 1 file changed, 4 insertions(+), 1 d

[PATCH 08/14] arm: FDT: create MSI controller DT node

2015-07-20 Thread Andre Przywara
The ARM GICv3 ITS requires a separate device tree node to describe the ITS. Add this as a child to the GIC interrupt controller node to let a guest discover and use the ITS if the user requests it. Since we now need to specify #address-cells for the GIC node, we have to add two zeroes to the interr

[PATCH 03/14] virtio: fix endianness check for vhost support

2015-07-20 Thread Andre Przywara
Currently we deny any VHOST_* functionality if the architecture supports guests with different endianness than the host. Most of the time even on those architectures the endianness of guest and host are the same, though, so we are denying the glory of VHOST needlessly. Switch from compile time dete

[PATCH 11/14] arm64: enable GICv3-ITS emulation

2015-07-20 Thread Andre Przywara
With everything in place for the ITS emulation add a new option to the --irqchip parameter to allow the user to specify --irqchip=gicv3-its to enable the ITS emulation. This will trigger creating the FDT node and an ITS register frame to tell the kernel we want ITS emulation in the guest. Signed-o

[PATCH 09/14] add kvm__check_vm_capability

2015-07-20 Thread Andre Przywara
KVM capabilities can be per-VM, in this case the ioctl should be issued on the VM file descriptor, not on the system fd. Since this feature is guarded by a (system) capability itself, wrap the call into a function of its own. Signed-off-by: Andre Przywara --- include/kvm/kvm.h | 1 + kvm.c

[PATCH 02/14] MSI-X: update GSI routing after changed MSI-X configuration

2015-07-20 Thread Andre Przywara
When we set up GSI routing to map MSIs to KVM's GSI numbers, we write the current device's MSI setup into the kernel routing table. However the device driver in the guest can use PCI configuration space accesses to change the MSI configuration (address and/or payload data). Whenever this happens af

[PATCH 00/14] kvmtool: add ITS emulation and GSI routing for ARM

2015-07-20 Thread Andre Przywara
Hi, this series teaches kvmtool how to support KVM's ITS emulation. Also (as this is somewhat related and has been co-developed) it enables GSI routing for ARM/ARM64, which allows IRQFDs to be used, for instance to use vhost_net. At the moment this is dependent on the guest using the ITS emulation

[PATCH 10/14] PCI: inject PCI device ID on MSI injection

2015-07-20 Thread Andre Przywara
The ITS emulation requires a unique device ID to be passed along the MSI payload when kvmtool wants to trigger an MSI in the guest. According to the proposed changes to the interface add the PCI bus/device/function triple to the structure passed with the ioctl. Check the respective capability befor

[PATCH 01/14] irq: move IRQ routing into irq.c

2015-07-20 Thread Andre Przywara
The current IRQ routing code in x86/irq.c is mostly implementing a generic KVM interface which other architectures may use too. Move the code to set up an MSI route into the generic irq.c file and guard it with the KVM_CAP_IRQ_ROUTING capability to return an error if the kernel does not support int

[PATCH 0/3] Fixes for kvmtool virtio-net part

2015-07-20 Thread Fan Du
Hallo This changset provide some fix and small enhancement for kvm tool when I play it with virtio part. Fan Du (3): kvm-tool: Introduce downscript option kvm-tool: Pass address of pointer to ioctl for tap kvm-tool: Restrict queue number to 1 when vhost on tools/kvm/include/kvm/virtio-net

[PATCH 3/3] kvm-tool: Restrict queue number to 1 when vhost on

2015-07-20 Thread Fan Du
vhost kernel driver does not support mutiple queue yet, Tweak queue number will fail with "--net mode=tap,vhost=1,mq=2" as below when lkvm trying to set ring kick fd for queue 2: VHOST_SET_VRING_KICK failed: No buffer space available Error on this scenario, and overide with the default one queue

[PATCH 2/3] kvm-tool: Pass address of pointer to ioctl for tap

2015-07-20 Thread Fan Du
When enable virtio tap mode as root previliege by: lkvm run --disk linux-0.2.img --kernel bzImage --network virtio lkvm spits: [1.981352] loop: module loaded [1.986039] vda: Warning: Config tap device error. Are you root? You have requested a TAP device, but creation of one has failed

[PATCH 1/3] kvm-tool: Introduce downscript option

2015-07-20 Thread Fan Du
To detach tap device automatically from bridge when exiting, just like the reverse of "script" does. Signed-off-by: Fan Du --- tools/kvm/include/kvm/virtio-net.h | 1 + tools/kvm/virtio/net.c | 28 2 files changed, 29 insertions(+) diff --git a/tools/kv

Re: [PATCH 0/2] Two fixes for dynamic micro-threading

2015-07-20 Thread David Gibson
On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote: > This series contains two fixes for the new dynamic micro-threading > code that was added recently for HV-mode KVM on Power servers. > The patches are against Alex Graf's kvm-ppc-queue branch. Please > apply. agraf, Any word on the

Re: [PATCH] RFC: vhost: actually track log eventfd file

2015-07-20 Thread Michael S. Tsirkin
Note: RFC must come within []. On Fri, Jul 17, 2015 at 03:32:03PM +0200, Marc-André Lureau wrote: > While reviewing vhost log code, I found out that log_file is never > set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet). > > Signed-off-by: Marc-André Lureau > --- > drivers/vh

Re: [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip

2015-07-20 Thread Marc Zyngier
On 19/07/15 15:05, Pavel Fedin wrote: > Hello! > >> Believe it or not, we're not only patch reviewing machines, and if you >> count the number of pending patches, you'll quickly notice that yours >> are basically noise in the grand scheme of things. >> >> So please cut us some slack. > > What do