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

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

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

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

[PATCH] vfio: Enable VFIO device for powerpc

2015-07-20 Thread David Gibson
ec53500f kvm: Add VFIO device added a special KVM pseudo-device which is used to handle any necessary interactions between KVM and VFIO. Currently that device is built on x86 and ARM, but not powerpc, although powerpc does support both KVM and VFIO. This makes things awkward in userspace

[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 fan...@intel.com --- tools/kvm/include/kvm/virtio-net.h | 1 + tools/kvm/virtio/net.c | 28 2 files changed, 29 insertions(+) diff

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

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

[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

[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 andre.przyw...@arm.com ---

[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 andre.przyw...@arm.com --- arm/gic.c| 36

[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 andre.przyw...@arm.com --- include/linux/kvm.h | 5 - 1 file

[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

[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

[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 andre.przyw...@arm.com ---

[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

[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

[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

[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

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

Re: [Xen-devel] [PATCH v2 1/3] drivers/xen/preempt: use need_resched() instead of should_resched()

2015-07-20 Thread David Vrabel
On 15/07/15 10:52, Konstantin Khlebnikov wrote: This code is used only when CONFIG_PREEMPT=n and only in non-atomic context: xen_in_preemptible_hcall is set only in privcmd_ioctl_hypercall(). Thus preempt_count is zero and should_resched() is equal to need_resched(). Applied to for-linus-4.3,

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

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 fan...@intel.com --- tools/kvm/include/kvm/virtio-net.h | 1 + tools/kvm/virtio/net.c | 28

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

Re: [PATCH] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers

2015-07-20 Thread Nathan Fontenot
On 07/17/2015 05:46 AM, Thomas Huth wrote: The EPOW interrupt handler uses rtas_get_sensor(), which in turn uses rtas_busy_delay() to wait for RTAS becoming ready in case it is necessary. But rtas_busy_delay() is annotated with might_sleep() and thus may not be used by interrupts handlers like

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 shannon.z...@linaro.org 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

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 shannon.z...@linaro.org Add reset handler which

[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

[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 fan...@intel.com --- include/kvm/virtio-net.h | 1 + virtio/net.c | 50 +--- 2 files changed, 40 insertions(+),

[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

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 provide some fix