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

2012-11-12 Thread Dong Aisheng
On Sat, Nov 10, 2012 at 04:44:44PM +0100, 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. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Signed-off-by: Christoffer Dall

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

2012-11-12 Thread Dong Aisheng
On Sat, Nov 10, 2012 at 04:44:51PM +0100, Christoffer Dall wrote: [...] +int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr) +{ + int r = 0; + struct vgic_dist *vgic = kvm-arch.vgic; + + if (addr ~KVM_PHYS_MASK) + return -E2BIG; + + if (addr

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

2012-11-12 Thread Dong Aisheng
On Sat, Nov 10, 2012 at 04:44:58PM +0100, Christoffer Dall wrote: [...] @@ -141,7 +519,98 @@ struct mmio_range *find_matching_range(const struct mmio_range *ranges, */ bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, struct kvm_exit_mmio *mmio) { - return

[RFC PATCH 02/16] kvm tools: only enable LTO if supported by GCC

2012-11-12 Thread Will Deacon
Commit 99423f12db2a (kvm tools: enable LTO) unconditionally enabled link-time-optimisations when building kvmtool. Unfortunately, passing -flto to a GCC without support for the option, results in a fatal build error: cc1: error: LTO support has not been enabled in this configuration This patch

[RFC PATCH 04/16] kvm tools: specify compiler by name when overriding make default

2012-11-12 Thread Will Deacon
GNU make defaults $(CC) to cc, which breaks compilation when we try to execute $(CROSS_COMPILE)-cc. This patch copies what the top-level kernel Makefile does, by specifying gcc directly when overriding the $CC environment variable. Signed-off-by: Will Deacon will.dea...@arm.com ---

[RFC PATCH 01/16] kvm tools: include arch uapi/asm directories in include path

2012-11-12 Thread Will Deacon
Architectures such as ARM and powerpc place asm/kvm.h under arch/$ARCH/include/uapi/asm, so ensure that this is part of the C include path. Signed-off-by: Will Deacon will.dea...@arm.com --- tools/kvm/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[RFC PATCH 10/16] kvm tools: virtio-mmio: use subsys_id instead of pci device ID

2012-11-12 Thread Will Deacon
The virtio MMIO code attempts to map PCI device IDs to virtio MMIO device IDs by subtracting 0x1000 and adding 1, however this conversion only works for NET and BLK devices. This patch uses the subsys_id (which is actually the virtio device ID for virtio-mmio devices) instead of the PCI device ID

[RFC PATCH 16/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Will Deacon
This patch adds initial support for ARMv7 processors (more specifically, Cortex-A15) to kvmtool. Everything is driven by FDT, including dynamic generation of virtio nodes for MMIO devices (PCI is not used due to lack of a suitable host-bridge). The virtual timers and virtual interrupt controller

[RFC PATCH 03/16] kvm tools: avoid linking dynamically against libbfd

2012-11-12 Thread Will Deacon
Linking dynamically against libbfd results in a non-portable application binary and is generally frowned upon by distributions: Debian forbids it explicitly and on Gentoo, it results in a failure at run-time: ./lkvm: error while loading shared libraries: libbfd-2.22.so: cannot open shared

[RFC PATCH 11/16] kvm tools: virtio: add dummy set_size_vq implementations

2012-11-12 Thread Will Deacon
When a guest kernel initialises a virtio device using an MMIO transport, it attempts to set the size of the virtual queue. For devices that expect a PCI transport, this is not the case and, as such, our console, 9p and rng virtio devices do not set a pointer for this function and subsequently

[RFC PATCH 14/16] kvm tools: teach guest_flat_to_host about memory banks starting above 0

2012-11-12 Thread Will Deacon
Running a guest with multiple banks of memory based above 0 causes the guest_flat_to_host address conversion to fail, as it is assumed that guest memory addresses are offset linearly from 0. This patch changes the translation function so that the kvm_mem_bank structures registered by

[RFC PATCH 12/16] kvm tools: allow arch to specify default virtio transport

2012-11-12 Thread Will Deacon
Some architectures may provide only a restricted PCI implementation and therefore prefer MMIO as the transport for virtio devices. This patch allows the arch backend to specify the default virtio transport. Some devices (e.g. net) allow the transport to be overriden by the user and are left alone

[RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm

2012-11-12 Thread Will Deacon
When registering memory banks for a guest, it is useful to keep the range information around for translating between guest and host address spaces. This patch adds a list of kvm_mem_bank structures to struct kvm, which is updated when a new bank is registered. Signed-off-by: Will Deacon

[RFC PATCH 08/16] kvm tools: add generic device registration mechanism

2012-11-12 Thread Will Deacon
PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture code to construct device tree nodes. For MMIO devices, there is no such utility. Rather than invent a similar mechanism for MMIO, this patch creates a

[RFC PATCH 15/16] kvm tools: provide a mechanism for translating host to guest addresses

2012-11-12 Thread Will Deacon
When generating a device tree for a guest, it is useful to have a helper for converting host addresses to guest addresses in order to populate the device nodes correctly. This patch adds such a helper, following a similar implementation to the reverse translation function that already exists.

[RFC PATCH 09/16] kvm tools: make _FDT macro usable by other architectures

2012-11-12 Thread Will Deacon
The _FDT macro is useful when generating device trees for a guest, so make it available to other architectures. Signed-off-by: Will Deacon will.dea...@arm.com --- tools/kvm/include/kvm/fdt.h | 26 ++ tools/kvm/powerpc/include/kvm/kvm-arch.h | 11

[RFC PATCH 05/16] kvm tools: don't bother including linux/compiler.h

2012-11-12 Thread Will Deacon
linux/compiler.h will never give us a definition for __compiler_offsetof because __KERNEL__ isn't defined, so just use the simple definition that we have already. This patch removes the redundant code. Signed-off-by: Will Deacon will.dea...@arm.com --- tools/kvm/include/linux/stddef.h |6

[RFC PATCH 06/16] kvm tools: don't pass -Wcast-align to the compiler

2012-11-12 Thread Will Deacon
GCC 4.7 with -Wcast-align will warn for code like the following: bar = (struct foo *)(char *)(0); which is exactly the sort of code generated by container_of. In combination with -Werror, this breaks the build. This patch removes the option from the kvmtool Makefile. Signed-off-by:

[RFC PATCH 07/16] kvm tools: die if init_list__init returns failure

2012-11-12 Thread Will Deacon
If init_list__init returns failure when initialising kvm tool, we can't rely on our structures being fully initialised, so die rather than try to continue and fail gracefully later on. This prevents a SEGV when kvm is not available on the host: Error: '/dev/kvm' not found. Please make sure

[RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Will Deacon
Hello, This patch series adds support for ARMv7 processors (Cortex-A15) to kvm tool. The majority of the series consists of small changes in preparation for ARM support, which is added by the final patch. I can try to split this up further, but given that there is no current support for ARM, the

Re: [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Christoffer Dall
On Mon, Nov 12, 2012 at 6:57 AM, Will Deacon will.dea...@arm.com wrote: Hello, This patch series adds support for ARMv7 processors (Cortex-A15) to kvm tool. The majority of the series consists of small changes in preparation for ARM support, which is added by the final patch. I can try to

Re: [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Will Deacon
Hi Christoffer, On Mon, Nov 12, 2012 at 12:18:57PM +, Christoffer Dall wrote: On Mon, Nov 12, 2012 at 6:57 AM, Will Deacon will.dea...@arm.com wrote: Hello, This patch series adds support for ARMv7 processors (Cortex-A15) to kvm tool. The majority of the series consists of small

Re: [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Christoffer Dall
On Mon, Nov 12, 2012 at 7:27 AM, Will Deacon will.dea...@arm.com wrote: Hi Christoffer, On Mon, Nov 12, 2012 at 12:18:57PM +, Christoffer Dall wrote: On Mon, Nov 12, 2012 at 6:57 AM, Will Deacon will.dea...@arm.com wrote: Hello, This patch series adds support for ARMv7 processors

KVM call agenda for 2012-11-12

2012-11-12 Thread Juan Quintela
Hi Please send in any agenda topics you are interested in. Later, Juan. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: graphics card pci passthrough success report

2012-11-12 Thread Vince Scott
Lennert Buytenhek buytenh at wantstofly.org writes: Hi! Some time ago already, we got graphics card pci passthrough working on a friend's computer, an ASRock Z68 Extreme4 Gen3 based PC with an Intel i7-2600, running on a Linux 3.2 kernel, with two Gigabyte GV-R677SL-1GD (AMD Radeon HD

Re: SR-IOV problem with Intel 82599EB (not enough MMIO resources for SR-IOV)

2012-11-12 Thread Don Dutile
On 11/09/2012 10:26 AM, Bjorn Helgaas wrote: [+ linux-pci, Yinghai] On Thu, Nov 8, 2012 at 8:59 PM, Jason Gaopkill.2...@gmail.com wrote: The BIOS in your machine doesn't support SR-IOV. You'll need to ask the manufacturer for a BIOS upgrade, if in fact one is available. Sometimes they're

Re: Fix lapic time counter read for periodic mode

2012-11-12 Thread Marcelo Tosatti
On Sun, Nov 11, 2012 at 01:25:28PM +0100, Christian Ehrhardt wrote: Hi, there is a bug in the emulation of the lapic time counter. In particular what we are seeing is that the time counter of a periodic lapic timer in the guest reads as zero 99% of the time. The patch below fixes that.

Re: KVM call agenda for 2012-11-12

2012-11-12 Thread Marcelo Tosatti
On Mon, Nov 12, 2012 at 01:58:38PM +0100, Juan Quintela wrote: Hi Please send in any agenda topics you are interested in. Later, Juan. It would be good to have a status report on qemu-kvm compatibility (the remaining TODO items are with Anthony). They are: - qemu-kvm 1.2 machine type. -

Re: [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Christoffer Dall
On Mon, Nov 12, 2012 at 7:52 AM, Christoffer Dall c.d...@virtualopensystems.com wrote: On Mon, Nov 12, 2012 at 7:27 AM, Will Deacon will.dea...@arm.com wrote: Hi Christoffer, On Mon, Nov 12, 2012 at 12:18:57PM +, Christoffer Dall wrote: On Mon, Nov 12, 2012 at 6:57 AM, Will Deacon

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-12 Thread Marcelo Tosatti
On Mon, Nov 05, 2012 at 05:59:26PM +0800, Xiao Guangrong wrote: Do not drop large spte until it can be insteaded by small pages so that the guest can happliy read memory through it The idea is from Avi: | As I mentioned before, write-protecting a large spte is a good idea, | since it moves

Re: [PATCH 2/5] KVM: MMU: simplify mmu_set_spte

2012-11-12 Thread Marcelo Tosatti
On Mon, Nov 05, 2012 at 08:10:08PM +0800, Xiao Guangrong wrote: In order to detecting spte remapping, we can simply check whether the spte has already been pointing to the pfn even if the spte is not the last spte for middle spte is pointing to the kernel pfn which can not be mapped to

Re: [PATCH 2/3] s390: Virtual channel subsystem support.

2012-11-12 Thread Marcelo Tosatti
Hi Cornelia, On Wed, Oct 31, 2012 at 05:24:47PM +0100, Cornelia Huck wrote: Provide a mechanism for qemu to provide fully virtual subchannels to the guest. In the KVM case, this relies on the kernel's css support for I/O and machine check interrupt handling. The !KVM case handles interrupts

[GIT PULL] KVM fixes for 3.7-rc5

2012-11-12 Thread Marcelo Tosatti
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive a correction for user triggerable oops Petr Matousek (1): KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461) arch/x86/kvm/cpuid.h |3 +++ arch/x86/kvm/x86.c |

Re: [PATCH v11] kvm: notify host when the guest is panicked

2012-11-12 Thread Marcelo Tosatti
On Fri, Nov 09, 2012 at 03:17:39PM -0500, Sasha Levin wrote: On Mon, Nov 5, 2012 at 8:58 PM, Hu Tao hu...@cn.fujitsu.com wrote: But in the case of panic notification, more dependency means more chances of failure of panic notification. Say, if we use a virtio device to do panic

Re: [PATCH v3 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-12 Thread zhangyanfei
Hello Marcelo, Do you have any comments about this version? Thanks Zhang 于 2012年10月31日 11:30, zhangyanfei 写道: Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted. But,

Re: [RFC PATCH 08/16] kvm tools: add generic device registration mechanism

2012-11-12 Thread Sasha Levin
On 11/12/2012 06:57 AM, Will Deacon wrote: PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture code to construct device tree nodes. For MMIO devices, there is no such utility. Rather than invent a

Re: [RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm

2012-11-12 Thread Sasha Levin
On 11/12/2012 06:57 AM, Will Deacon wrote: When registering memory banks for a guest, it is useful to keep the range information around for translating between guest and host address spaces. This patch adds a list of kvm_mem_bank structures to struct kvm, which is updated when a new bank is

Re: [RFC PATCH 14/16] kvm tools: teach guest_flat_to_host about memory banks starting above 0

2012-11-12 Thread Sasha Levin
On 11/12/2012 06:57 AM, Will Deacon wrote: Running a guest with multiple banks of memory based above 0 causes the guest_flat_to_host address conversion to fail, as it is assumed that guest memory addresses are offset linearly from 0. This patch changes the translation function so that the

Re: [rfc net-next v6 2/3] virtio_net: multiqueue support

2012-11-12 Thread Michael S. Tsirkin
On Mon, Nov 05, 2012 at 11:38:39AM +1030, Rusty Russell wrote: @@ -924,11 +1032,10 @@ static void virtnet_get_ringparam(struct net_device *dev, { struct virtnet_info *vi = netdev_priv(dev); - ring-rx_max_pending = virtqueue_get_vring_size(vi-rvq); - ring-tx_max_pending =

Re: [RFC PATCH 05/16] kvm tools: don't bother including linux/compiler.h

2012-11-12 Thread Pekka Enberg
On Mon, 12 Nov 2012, Will Deacon wrote: linux/compiler.h will never give us a definition for __compiler_offsetof because __KERNEL__ isn't defined, so just use the simple definition that we have already. This patch removes the redundant code. Signed-off-by: Will Deacon will.dea...@arm.com

Re: [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Pekka Enberg
On Mon, 12 Nov 2012, Will Deacon wrote: This patch series adds support for ARMv7 processors (Cortex-A15) to kvm tool. The majority of the series consists of small changes in preparation for ARM support, which is added by the final patch. I can try to split this up further, but given that there

Re: [RFC PATCH 16/16] kvm tools: add support for ARMv7 processors

2012-11-12 Thread Pekka Enberg
On Mon, 12 Nov 2012, Will Deacon wrote: This patch adds initial support for ARMv7 processors (more specifically, Cortex-A15) to kvmtool. Everything is driven by FDT, including dynamic generation of virtio nodes for MMIO devices (PCI is not used due to lack of a suitable host-bridge). The

Re: Fix lapic time counter read for periodic mode

2012-11-12 Thread Christian Ehrhardt
Hi, thanks for your reply. On Mon, Nov 12, 2012 at 07:32:37PM -0200, Marcelo Tosatti wrote: there is a bug in the emulation of the lapic time counter. In particular what we are seeing is that the time counter of a periodic lapic timer in the guest reads as zero 99% of the time. The patch