Re: FreeBSD-amd64 fails to start with SMP on quemu-kvm

2013-01-16 Thread Artur Samborski
W dniu 17.01.2013 07:37, Gleb Natapov pisze: On Wed, Jan 16, 2013 at 04:42:38PM +0200, Michael S. Tsirkin wrote: First test: - kvm.git kernel - 2 kvm guest running: - Linux (in idle) - Freebsd-amd64 (high load, about 7 -- continuous FreeBSD world and kernel build) - KVM host hangs

Re: [PATCH 0/4] KVM: Clean up and optimize __kvm_set_memory_region() - part1

2013-01-16 Thread Gleb Natapov
On Thu, Jan 17, 2013 at 11:20:43AM +0800, Xiao Guangrong wrote: > On 01/17/2013 03:07 AM, Marcelo Tosatti wrote: > > On Fri, Jan 11, 2013 at 06:25:18PM +0900, Takuya Yoshikawa wrote: > >> Patches 1 to 3 are trivial. > >> > >> Patch 4 is the main cause of the increased lines, but I think the new > >

[vfio:vfio-vga 4/5] drivers/vfio/pci/vfio_pci_rdwr.c:191 vfio_pci_legacy_mem_rw() warn: consider using resource_size() here

2013-01-16 Thread Dan Carpenter
Hi Alex, FYI, there are new smatch warnings show up in tree: git://github.com/awilliam/linux-vfio.git vfio-vga head: 2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d commit: c5b7a5a85fa477e70497c513f2acda50eea73bf7 [4/5] vfio-pci: Add support for legacy MMIO & I/O port towards VGA support New smatc

[vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'

2013-01-16 Thread Dan Carpenter
Hi Alex, FYI, there are new smatch warnings show up in tree: git://github.com/awilliam/linux-vfio.git vfio-vga head: 2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d commit: f4d38f216ef420595d12f74b256b3961eb4c3c14 [3/5] vfio-pci: Cleanup BAR access New smatch warnings: drivers/vfio/pci/vfio_pci_rd

Re: [PATCH] Bugfix for kvm/s390.

2013-01-16 Thread Gleb Natapov
On Tue, Jan 15, 2013 at 11:17:28AM +0100, Cornelia Huck wrote: > Hi, > > here's another s390 bugfix for kvm-next. Please apply. > Applied, thanks. > Cong Ding (1): > KVM: s390: kvm/sigp.c: fix memory leakage > > arch/s390/kvm/sigp.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-)

Re: FreeBSD-amd64 fails to start with SMP on quemu-kvm

2013-01-16 Thread Gleb Natapov
On Wed, Jan 16, 2013 at 04:42:38PM +0200, Michael S. Tsirkin wrote: > > > First test: > > > > > > - kvm.git kernel > > > - 2 kvm guest running: > > >- Linux (in idle) > > >- Freebsd-amd64 (high load, about 7 -- continuous FreeBSD world > > > and kernel build) > > > - KVM host hangs afte

RE: [PATCH] KVM: VMX: enable acknowledge interupt on vmexit

2013-01-16 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-01-17: > On Thu, Jan 17, 2013 at 01:36:36AM +, Zhang, Yang Z wrote: >> Gleb Natapov wrote on 2013-01-16: >>> On Wed, Jan 16, 2013 at 05:00:48PM +0800, Yang Zhang wrote: From: Yang Zhang The "acknowledge interrupt on exit" feature controls processor be

Re: [PATCH] virtio-spec: set mac address by a new vq command

2013-01-16 Thread Amos Kong
On Wed, Jan 16, 2013 at 11:22:23AM +0200, Michael S. Tsirkin wrote: > On Wed, Jan 16, 2013 at 10:13:28AM +0100, Stefan Hajnoczi wrote: > > On Wed, Jan 16, 2013 at 03:33:24PM +0800, ak...@redhat.com wrote: > > > +\change_inserted -1930653948 1358320004 > > > +The command VIRTIO_NET_CTRL_MAC_ADDR_SET

Re: [PATCH] KVM: VMX: enable acknowledge interupt on vmexit

2013-01-16 Thread Gleb Natapov
On Thu, Jan 17, 2013 at 01:36:36AM +, Zhang, Yang Z wrote: > Gleb Natapov wrote on 2013-01-16: > > On Wed, Jan 16, 2013 at 05:00:48PM +0800, Yang Zhang wrote: > >> From: Yang Zhang > >> > >> The "acknowledge interrupt on exit" feature controls processor behavior > >> for external interrupt ac

Re: [Qemu-devel] [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-16 Thread Amos Kong
On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > ak...@redhat.com writes: > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t > > cmd, > > { > > struct virtio_net_ctrl_mac mac_data; > > > > +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET && elem->ou

Re: [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'

2013-01-16 Thread Alex Williamson
On Thu, 2013-01-17 at 09:21 +0800, Fengguang Wu wrote: > Hi Alex, > > FYI, there are new smatch warnings show up in > > tree: git://github.com/awilliam/linux-vfio.git vfio-vga Thanks for the bug report. I never would have expected but reports from an unadvertised branch but it's a really cool

Re: [PATCH 0/4] KVM: Clean up and optimize __kvm_set_memory_region() - part1

2013-01-16 Thread Xiao Guangrong
On 01/17/2013 03:07 AM, Marcelo Tosatti wrote: > On Fri, Jan 11, 2013 at 06:25:18PM +0900, Takuya Yoshikawa wrote: >> Patches 1 to 3 are trivial. >> >> Patch 4 is the main cause of the increased lines, but I think the new >> code makes it easier to understand why each condition in >> __kvm_set_memo

Re: [PATCH v5 03/14] KVM: ARM: Initial skeleton to compile KVM support

2013-01-16 Thread Rusty Russell
Russell King - ARM Linux writes: > On Wed, Jan 16, 2013 at 01:26:01PM +1030, Rusty Russell wrote: >> Christoffer Dall writes: >> >> > On Mon, Jan 14, 2013 at 11:24 AM, Russell King - ARM Linux >> > wrote: >> >> On Tue, Jan 08, 2013 at 01:38:55PM -0500, Christoffer Dall wrote: >> >>> + /* -E

Re: [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-16 Thread Rusty Russell
ak...@redhat.com writes: > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t > cmd, > { > struct virtio_net_ctrl_mac mac_data; > > +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET && elem->out_num == 2 && > +elem->out_sg[1].iov_len == ETH_ALEN) { > +/*

RE: [PATCH] KVM: VMX: enable acknowledge interupt on vmexit

2013-01-16 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-01-16: > On Wed, Jan 16, 2013 at 05:00:48PM +0800, Yang Zhang wrote: >> From: Yang Zhang >> >> The "acknowledge interrupt on exit" feature controls processor behavior >> for external interrupt acknowledgement. When this control is set, the >> processor acknowledges the

RE: [PATCH v11 3/3] x86, apicv: add virtual interrupt delivery support

2013-01-16 Thread Zhang, Yang Z
Previous patch is stale. Resend the new patch. The only change is clear EOI and SELF-IPI reg in msr bitmap when vid is enabled. From: Yang Zhang Virtual interrupt delivery avoids KVM to inject vAPIC interrupts manually, which is fully taken care of by the hardware. This

[kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'

2013-01-16 Thread Fengguang Wu
Hi Alex, FYI, there are new smatch warnings show up in tree: git://github.com/awilliam/linux-vfio.git vfio-vga head: 2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d commit: f4d38f216ef420595d12f74b256b3961eb4c3c14 [3/5] vfio-pci: Cleanup BAR access New smatch warnings: drivers/vfio/pci/vfio_pci_r

[kbuild] [vfio:vfio-vga 4/5] drivers/vfio/pci/vfio_pci_rdwr.c:191 vfio_pci_legacy_mem_rw() warn: consider using resource_size() here

2013-01-16 Thread Fengguang Wu
Hi Alex, FYI, there are new smatch warnings show up in tree: git://github.com/awilliam/linux-vfio.git vfio-vga head: 2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d commit: c5b7a5a85fa477e70497c513f2acda50eea73bf7 [4/5] vfio-pci: Add support for legacy MMIO & I/O port towards VGA support New smat

RE: Guest performance is reduced after live migration

2013-01-16 Thread Mark Petersen
I used lmbench, and even simple test shows the difference here. Simple read/writes (but not open/close?) seem to take much longer. Perhaps this over simplifies things, but it's repeatable. Any thoughts? Other tests that might be interesting? ubuntu-12.04 - first boot =

Re: [PATCH v6 1/3] KVM: x86: clean up reexecute_instruction

2013-01-16 Thread Xiao Guangrong
Ping, ping, ping.. :( Sent from my iPhone On Jan 13, 2013, at 23:44, Xiao Guangrong wrote: > Little cleanup for reexecute_instruction, also use gpa_to_gfn in > retry_instruction > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/x86.c | 13 ++--- > 1 files changed, 6 inserti

Locking problem in KVM (or MM)

2013-01-16 Thread Stephen Hemminger
Lockdep splat, appears to be KVM related with 3.8-rc1 [24428.429305] [24428.429308] = [24428.429309] [ INFO: possible recursive locking detected ] [24428.429312] 3.8.0-rc1-net-next+ #4 Tainted: GW [24428.429312] --

qemu-kvm-0.12.1.2-2.209.el6.x86_64 no F12 guest creation?

2013-01-16 Thread Tory M Blue
So I updated a few of my boxen to "qemu-kvm-0.12.1.2-2.209" on CentOs 6.2 and when trying to create F12 guests (ya I understand it's old) stops during it's checking dependencies and or when it's starting to process selinux (which was a bug in kickstart at some point in the past). If I kickstart

Re: KVM: Questions and comments on make_all_cpus_request

2013-01-16 Thread Gleb Natapov
On Tue, Jan 15, 2013 at 07:43:40PM -0500, Christoffer Dall wrote: > Hi KVM guys, > > I've had a bit of challenges figuring out the exact functinality and > synchronization of vcpu->requests and friends. In lack of a better > method, I wrote some comments as a patch. > > I think this code really

Re: [PATCH 0/4] KVM: Clean up and optimize __kvm_set_memory_region() - part1

2013-01-16 Thread Marcelo Tosatti
On Fri, Jan 11, 2013 at 06:25:18PM +0900, Takuya Yoshikawa wrote: > Patches 1 to 3 are trivial. > > Patch 4 is the main cause of the increased lines, but I think the new > code makes it easier to understand why each condition in > __kvm_set_memory_region() is there. > > If you don't agree with pa

Re: KVM: Questions and comments on make_all_cpus_request

2013-01-16 Thread Marcelo Tosatti
On Tue, Jan 15, 2013 at 07:43:40PM -0500, Christoffer Dall wrote: > Hi KVM guys, > > I've had a bit of challenges figuring out the exact functinality and > synchronization of vcpu->requests and friends. In lack of a better > method, I wrote some comments as a patch. > > I think this code really

[RESEND PATCH v6 09/15] KVM: ARM: User space API for getting/setting co-proc registers

2013-01-16 Thread Christoffer Dall
The following three ioctls are implemented: - KVM_GET_REG_LIST - KVM_GET_ONE_REG - KVM_SET_ONE_REG Now we have a table for all the cp15 registers, we can drive a generic API. The register IDs carry the following encoding: ARM registers are mapped using the lower 32 bits. The upper 16 of t

[PATCH v6 3/4] ARM: KVM: arch_timers: Add timer world switch

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Do the necessary save/restore dance for the timers in the world switch code. In the process, allow the guest to read the physical counter, which is useful for its own clock_event_device. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --

[PATCH v6 4/4] ARM: KVM: arch_timers: Wire the init code and config option

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier It is now possible to select CONFIG_KVM_ARM_TIMER to enable the KVM architected timer support. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/Kconfig |8 arch/arm/kvm/Makefile |1 + arch/arm/kvm/arm.c

[PATCH v6 2/4] ARM: KVM: arch_timers: Add guest timer core support

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Add some the architected timer related infrastructure, and support timer interrupt injection, which can happen as a resultof three possible events: - The virtual timer interrupt has fired while we were still executing the guest - The timer interrupt hasn't fired, but it expi

[PATCH v6 1/4] ARM: arch_timers: switch to physical timers if HYP mode is available

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier If we're booted in HYP mode, it is possible that we'll run some kind of virtualized environment. In this case, it is a better to switch to the physical timers, and leave the virtual timers to guests. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier --- arch/arm/kernel/a

[PATCH v6 0/4] KVM/ARM Architected Timers support

2013-01-16 Thread Christoffer Dall
The following series implements support for the architected generic timers for KVM/ARM. This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch: kvm-arm-v16-vgic-timers Changes since v5: - Renamed sync_{to,from} to {flush,sync}_hwst

[PATCH v6 13/13] ARM: KVM: Add VGIC configuration option

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier It is now possible to select the VGIC configuration option. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/Kconfig |8 1 file changed, 8 insertions(+) diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kcon

[PATCH v6 12/13] ARM: KVM: VGIC initialisation code

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Add the init code for the hypervisor, the virtual machine, and the virtual CPUs. An interrupt handler is also wired to allow the VGIC maintenance interrupts, used to deal with level triggered interrupts and LR underflows. A CPU hotplug notifier is registered to disable/enable

[PATCH v6 11/13] ARM: KVM: VGIC control interface world switch

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Enable the VGIC control interface to be save-restored on world switch. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kernel/asm-offsets.c | 12 ++ arch/arm/kvm/interrupts_head.S | 74 +

[PATCH v6 10/13] ARM: KVM: VGIC interrupt injection

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Plug the interrupt injection code. Interrupts can now be generated from user space. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_vgic.h |8 +++ arch/arm/kvm/arm.c | 55 +++--

[PATCH v6 07/13] ARM: KVM: VGIC distributor handling

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Add the GIC distributor emulation code. A number of the GIC features are simply ignored as they are not required to boot a Linux guest. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_vgic.h | 82 + ar

[PATCH v6 08/13] ARM: KVM: VGIC virtual CPU interface management

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Add VGIC virtual CPU interface code, picking pending interrupts from the distributor and stashing them in the VGIC control interface list registers. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_vgic.h |

[PATCH v6 09/13] ARM: KVM: vgic: retire queued, disabled interrupts

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier An interrupt may have been disabled after being made pending on the CPU interface (the classic case is a timer running while we're rebooting the guest - the interrupt would kick as soon as the CPU interface gets enabled, with deadly consequences). The solution is to examine al

[PATCH v6 06/13] ARM: KVM: VGIC accept vcpu and dist base addresses from user space

2013-01-16 Thread Christoffer Dall
User space defines the model to emulate to a guest and should therefore decide which addresses are used for both the virtual CPU interface directly mapped in the guest physical address space and for the emulated distributor interface, which is mapped in software by the in-kernel VGIC support. Revi

[PATCH v6 05/13] ARM: KVM: Initial VGIC infrastructure code

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Wire the basic framework code for VGIC support and the initial in-kernel MMIO support code for the VGIC, used for the distributor emulation. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/kvm_host.h |8 ++

[PATCH v6 04/13] ARM: gic: define GICH offsets for VGIC support

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier The GICH_* constants are defined by the GIC HW spec, and even though they only be used by KVM to begin with, define them generically in gic.h. Reviewed-by: Will Deacon Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/hardware/gic.h | 2

[PATCH v6 03/13] ARM: KVM: Keep track of currently running vcpus

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier When an interrupt occurs for the guest, it is sometimes necessary to find out which vcpu was running at that point. Keep track of which vcpu is being run in kvm_arch_vcpu_ioctl_run(), and allow the data to be retrieved using either: - kvm_arm_get_running_vcpu(): returns the vc

[PATCH v6 02/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl

2013-01-16 Thread Christoffer Dall
On ARM (and possibly other architectures) some bits are specific to the model being emulated for the guest and user space needs a way to tell the kernel about those bits. An example is mmio device base addresses, where KVM must know the base address for a given device to properly emulate mmio acce

[PATCH v6 01/13] ARM: gic: add missing distributor defintions

2013-01-16 Thread Christoffer Dall
Add missing register map offsets for the distributor and rename GIC_DIST_ACTIVE_BIT to GIC_DIST_ACTIVE_SET to be consistent. Cc: Marc Zyniger Reviewed-by: Will Deacon Signed-off-by: Christoffer Dall --- arch/arm/include/asm/hardware/gic.h |4 +++- 1 file changed, 3 insertions(+), 1 deletio

[PATCH v6 00/13] KVM/ARM vGIC support

2013-01-16 Thread Christoffer Dall
The following series implements support for the virtual generic interrupt controller architecture for KVM/ARM. This patch series can also be pulled from: git://github.com/virtualopensystems/linux-kvm-arm.git branch: kvm-arm-v16-vgic Changes since v5: - Renamed sync_{to,from} to {

[PATCH v6 15/15] KVM: ARM: Add maintainer entry for KVM/ARM

2013-01-16 Thread Christoffer Dall
Add an entry in the MAINTAINERS file for KVM/ARM. Cc: Russell King Reviewed-by: Will Deacon Signed-off-by: Christoffer Dall --- MAINTAINERS |8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 915564e..70e5a10 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation

2013-01-16 Thread Christoffer Dall
From: Marc Zyngier Implement the PSCI specification (ARM DEN 0022A) to control virtual CPUs being "powered" on or off. PSCI/KVM is detected using the KVM_CAP_ARM_PSCI capability. A virtual CPU can now be initialized in a "powered off" state, using the KVM_ARM_VCPU_POWER_OFF feature flag. The g

[PATCH v6 13/15] KVM: ARM: Handle I/O aborts

2013-01-16 Thread Christoffer Dall
When the guest accesses I/O memory this will create data abort exceptions and they are handled by decoding the HSR information (physical address, read/write, length, register) and forwarding reads and writes to QEMU which performs the device emulation. Certain classes of load/store operations do n

[PATCH v6 12/15] KVM: ARM: Handle guest faults in KVM

2013-01-16 Thread Christoffer Dall
Handles the guest faults in KVM by mapping in corresponding user pages in the 2nd stage page tables. We invalidate the instruction cache by MVA whenever we map a page to the guest (no, we cannot only do it when we have an iabt because the guest may happily read/write a page before hitting the icac

[PATCH v6 11/15] KVM: ARM: VFP userspace interface

2013-01-16 Thread Christoffer Dall
From: Rusty Russell We use space #18 for floating point regs. Reviewed-by: Will Deacon Reviewed-by: Marcelo Tosatti Signed-off-by: Rusty Russell Signed-off-by: Christoffer Dall --- Documentation/virtual/kvm/api.txt |6 + arch/arm/include/uapi/asm/kvm.h | 12 ++ arch/arm/kvm/coproc.c

[PATCH v6 09/15] trom: Christoffer Dall

2013-01-16 Thread Christoffer Dall
KVM: ARM: User space API for getting/setting co-proc registers The following three ioctls are implemented: - KVM_GET_REG_LIST - KVM_GET_ONE_REG - KVM_SET_ONE_REG Now we have a table for all the cp15 registers, we can drive a generic API. The register IDs carry the following encoding: ARM

[PATCH v6 10/15] KVM: ARM: Demux CCSIDR in the userspace API

2013-01-16 Thread Christoffer Dall
The Cache Size Selection Register (CSSELR) selects the current Cache Size ID Register (CCSIDR). You write which cache you are interested in to CSSELR, and read the information out of CCSIDR. Which cache numbers are valid is known by reading the Cache Level ID Register (CLIDR). To export this sta

[PATCH v6 08/15] KVM: ARM: Emulation framework and CP15 emulation

2013-01-16 Thread Christoffer Dall
Adds a new important function in the main KVM/ARM code called handle_exit() which is called from kvm_arch_vcpu_ioctl_run() on returns from guest execution. This function examines the Hyp-Syndrome-Register (HSR), which contains information telling KVM what caused the exit from the guest. Some of th

[PATCH v6 06/15] KVM: ARM: Inject IRQs and FIQs from userspace

2013-01-16 Thread Christoffer Dall
From: Christoffer Dall All interrupt injection is now based on the VM ioctl KVM_IRQ_LINE. This works semantically well for the GIC as we in fact raise/lower a line on a machine component (the gic). The IOCTL uses the follwing struct. struct kvm_irq_level { union { __u32

[PATCH v6 07/15] KVM: ARM: World-switch implementation

2013-01-16 Thread Christoffer Dall
Provides complete world-switch implementation to switch to other guests running in non-secure modes. Includes Hyp exception handlers that capture necessary exception information and stores the information on the VCPU and KVM structures. The following Hyp-ABI is also documented in the code: Hyp-AB

[PATCH v6 05/15] KVM: ARM: Memory virtualization setup

2013-01-16 Thread Christoffer Dall
This commit introduces the framework for guest memory management through the use of 2nd stage translation. Each VM has a pointer to a level-1 table (the pgd field in struct kvm_arch) which is used for the 2nd stage translations. Entries are added when handling guest faults (later patch) and the tab

[PATCH v6 03/15] KVM: ARM: Initial skeleton to compile KVM support

2013-01-16 Thread Christoffer Dall
Targets KVM support for Cortex A-15 processors. Contains all the framework components, make files, header files, some tracing functionality, and basic user space API. Only supported core is Cortex-A15 for now. Most functionality is in arch/arm/kvm/* or arch/arm/include/asm/kvm_*.h. Reviewed-by:

[PATCH v6 04/15] KVM: ARM: Hypervisor initialization

2013-01-16 Thread Christoffer Dall
Sets up KVM code to handle all exceptions taken to Hyp mode. When the kernel is booted in Hyp mode, calling an hvc instruction with r0 pointing to the new vectors, the HVBAR is changed to the the vector pointers. This allows subsystems (like KVM here) to execute code in Hyp-mode with the MMU disab

[PATCH v6 02/15] ARM: Section based HYP idmap

2013-01-16 Thread Christoffer Dall
Add a method (hyp_idmap_setup) to populate a hyp pgd with an identity mapping of the code contained in the .hyp.idmap.text section. Offer a method to drop this identity mapping through hyp_idmap_teardown. Make all the above depend on CONFIG_ARM_VIRT_EXT and CONFIG_ARM_LPAE. Reviewed-by: Will Dea

[PATCH v6 01/15] ARM: Add page table and page defines needed by KVM

2013-01-16 Thread Christoffer Dall
KVM uses the stage-2 page tables and the Hyp page table format, so we define the fields and page protection flags needed by KVM. The nomenclature is this: - page_hyp:PL2 code/data mappings - page_hyp_device: PL2 device mappings (vgic access) - page_s2: Stage-2 code/data page map

[PATCH v6 00/15] KVM/ARM Implementation

2013-01-16 Thread Christoffer Dall
The following series implements KVM support for ARM processors, specifically on the Cortex A-15 platform. Work is done in collaboration between Columbia University, Virtual Open Systems and ARM/Linaro. The patch series applies to Linux 3.8-rc3. The series relies on two additional patches in Will

perf event "cache-references" count much more larger in guest than in host

2013-01-16 Thread Storm Wang
Dear all I used cachebench to test if perf works well with collecting Hardware event count and Hardware cache event count in guest. Most events' count were correct(almost as same as host), while the count of cache-refernecs, L1-dcache-load-misses, L1-icache-load-misses, dTLB-load-misses and iTLB-l

Re: [PATCH] KVM: PPC: add paravirt idle loop for 64-bit book E

2013-01-16 Thread Scott Wood
On 01/16/2013 11:21:24 AM, Stuart Yoder wrote: From: Stuart Yoder loop was derived from book3e_idle() Signed-off-by: Stuart Yoder --- arch/powerpc/kernel/epapr_hcalls.S | 63 1 file changed, 63 insertions(+) diff --git a/arch/powerpc/kernel/epapr_hc

[PATCH] KVM: PPC: add paravirt idle loop for 64-bit book E

2013-01-16 Thread Stuart Yoder
From: Stuart Yoder loop was derived from book3e_idle() Signed-off-by: Stuart Yoder --- arch/powerpc/kernel/epapr_hcalls.S | 63 1 file changed, 63 insertions(+) diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S index 6

Re: [Qemu-devel] [PATCH 8/8] s390: Add new channel I/O based virtio transport.

2013-01-16 Thread Alexander Graf
On 16.01.2013, at 17:46, Richard Henderson wrote: > $SUBJECT reminds me that the tcg s390x port is now prepared > to implement channel insns, but previously there were no > channels worth talking about: > >> /* I/O Instructions. For each we simply indicate non-operation. */ >>C(0xb276, XSC

Re: [Qemu-devel] [PATCH 00/12] Multiqueue virtio-net

2013-01-16 Thread Michael S. Tsirkin
On Wed, Jan 16, 2013 at 10:14:33AM -0600, Anthony Liguori wrote: > "Michael S. Tsirkin" writes: > > > On Wed, Jan 16, 2013 at 09:09:49AM -0600, Anthony Liguori wrote: > >> Jason Wang writes: > >> > >> > On 01/15/2013 03:44 AM, Anthony Liguori wrote: > >> >> Jason Wang writes: > >> >> > >> >>>

[PATCH v2] kvm tools: remove redundant "if" condition

2013-01-16 Thread Cong Ding
After we check (state.kcount != 0), state.kcount has to be 0 in all the "else" branchs. Signed-off-by: Cong Ding --- tools/kvm/hw/i8042.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c index 9f8be6a..9035732 100644 --- a/tools/k

[PATCH v2] kvm tools: close opened file

2013-01-16 Thread Cong Ding
The file should be closed before return. Signed-off-by: Cong Ding --- tools/kvm/builtin-setup.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/kvm/builtin-setup.c b/tools/kvm/builtin-setup.c index c5b0566..8b45c56 100644 --- a/tools/kvm/builtin-setup.c +++ b/t

Re: [Qemu-devel] [PATCH 8/8] s390: Add new channel I/O based virtio transport.

2013-01-16 Thread Richard Henderson
$SUBJECT reminds me that the tcg s390x port is now prepared to implement channel insns, but previously there were no channels worth talking about: /* I/O Instructions. For each we simply indicate non-operation. */ C(0xb276, XSCH,S, Z, 0, 0, 0, 0, subchannel, 0) C(0xb230, CSCH

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Gleb Natapov
On Wed, Jan 16, 2013 at 11:17:06AM -0500, Christoffer Dall wrote: > On Wed, Jan 16, 2013 at 10:52 AM, Gleb Natapov wrote: > > On Wed, Jan 16, 2013 at 10:42:02AM -0500, Christoffer Dall wrote: > >> [...] > >> > >> > > >> >> read side RCU protects against is the memslots data structure as far > >> >

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Gleb Natapov
On Wed, Jan 16, 2013 at 10:40:37AM -0500, Christoffer Dall wrote: > [...] > > >> > > > > Agree. Lets merge it and change later. The vcpu run loop is simple > > enough at this point. The question of using vcpu->requests is not > > the question of "real benefit" though, of course you can introduce y

Re: [kvmarm] [PATCH v5 07/12] ARM: KVM: VGIC virtual CPU interface management

2013-01-16 Thread Marc Zyngier
On Wed, 16 Jan 2013 11:13:08 -0500, Christoffer Dall wrote: > On Wed, Jan 16, 2013 at 11:09 AM, Marc Zyngier > wrote: >> On 16/01/13 15:29, Christoffer Dall wrote: >>> [...] >>> > diff --git a/arch/arm/include/asm/kvm_vgic.h > b/arch/arm/include/asm/kvm_vgic.h > index 1ace491..f9d1977

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Christoffer Dall
On Wed, Jan 16, 2013 at 10:52 AM, Gleb Natapov wrote: > On Wed, Jan 16, 2013 at 10:42:02AM -0500, Christoffer Dall wrote: >> [...] >> >> > >> >> read side RCU protects against is the memslots data structure as far >> >> as I can see, so the second patch pasted below fixes this for the code >> >> t

Re: [PATCH v5 07/12] ARM: KVM: VGIC virtual CPU interface management

2013-01-16 Thread Marc Zyngier
On 16/01/13 15:29, Christoffer Dall wrote: > [...] > >>> diff --git a/arch/arm/include/asm/kvm_vgic.h >>> b/arch/arm/include/asm/kvm_vgic.h >>> index 1ace491..f9d1977 100644 >>> --- a/arch/arm/include/asm/kvm_vgic.h >>> +++ b/arch/arm/include/asm/kvm_vgic.h >>> @@ -33,6 +33,7 @@ >>> #define VGIC

Re: [Qemu-devel] [PATCH 00/12] Multiqueue virtio-net

2013-01-16 Thread Anthony Liguori
"Michael S. Tsirkin" writes: > On Wed, Jan 16, 2013 at 09:09:49AM -0600, Anthony Liguori wrote: >> Jason Wang writes: >> >> > On 01/15/2013 03:44 AM, Anthony Liguori wrote: >> >> Jason Wang writes: >> >> >> >>> Hello all: >> >>> >> >>> This seires is an update of last version of multiqueue vir

Re: [PATCH v5 07/12] ARM: KVM: VGIC virtual CPU interface management

2013-01-16 Thread Christoffer Dall
On Wed, Jan 16, 2013 at 11:09 AM, Marc Zyngier wrote: > On 16/01/13 15:29, Christoffer Dall wrote: >> [...] >> diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h index 1ace491..f9d1977 100644 --- a/arch/arm/include/asm/kvm_vgic.h +++ b/arch/arm

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Gleb Natapov
On Wed, Jan 16, 2013 at 10:42:02AM -0500, Christoffer Dall wrote: > [...] > > > > >> read side RCU protects against is the memslots data structure as far > >> as I can see, so the second patch pasted below fixes this for the code > >> that actually accesses this data structure. > > Many memory rel

Re: [PATCH] KVM: VMX: enable acknowledge interupt on vmexit

2013-01-16 Thread Gleb Natapov
On Wed, Jan 16, 2013 at 05:00:48PM +0800, Yang Zhang wrote: > From: Yang Zhang > > The "acknowledge interrupt on exit" feature controls processor behavior > for external interrupt acknowledgement. When this control is set, the > processor acknowledges the interrupt controller to acquire the > int

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Christoffer Dall
[...] > >> read side RCU protects against is the memslots data structure as far >> as I can see, so the second patch pasted below fixes this for the code >> that actually accesses this data structure. > Many memory related functions that you call access memslots under the > hood and assume that lo

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Christoffer Dall
[...] >> > > Agree. Lets merge it and change later. The vcpu run loop is simple > enough at this point. The question of using vcpu->requests is not > the question of "real benefit" though, of course you can introduce your > own mechanism to pass requests to vcpus instead of using whatever kvm > pr

Re: [PATCH v5 07/12] ARM: KVM: VGIC virtual CPU interface management

2013-01-16 Thread Christoffer Dall
[...] >> diff --git a/arch/arm/include/asm/kvm_vgic.h >> b/arch/arm/include/asm/kvm_vgic.h >> index 1ace491..f9d1977 100644 >> --- a/arch/arm/include/asm/kvm_vgic.h >> +++ b/arch/arm/include/asm/kvm_vgic.h >> @@ -33,6 +33,7 @@ >> #define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS) >> #de

Re: [PATCH 00/12] Multiqueue virtio-net

2013-01-16 Thread Michael S. Tsirkin
On Wed, Jan 16, 2013 at 09:09:49AM -0600, Anthony Liguori wrote: > Jason Wang writes: > > > On 01/15/2013 03:44 AM, Anthony Liguori wrote: > >> Jason Wang writes: > >> > >>> Hello all: > >>> > >>> This seires is an update of last version of multiqueue virtio-net support. > >>> > >>> Recently, li

Re: [PATCH 00/12] Multiqueue virtio-net

2013-01-16 Thread Anthony Liguori
Jason Wang writes: > On 01/15/2013 03:44 AM, Anthony Liguori wrote: >> Jason Wang writes: >> >>> Hello all: >>> >>> This seires is an update of last version of multiqueue virtio-net support. >>> >>> Recently, linux tap gets multiqueue support. This series implements basic >>> support for multiqu

Re: FreeBSD-amd64 fails to start with SMP on quemu-kvm

2013-01-16 Thread Michael S. Tsirkin
On Wed, Jan 16, 2013 at 03:05:50PM +0200, Gleb Natapov wrote: > > Copying Michael. > > On Tue, Jan 15, 2013 at 12:18:59PM +0100, Artur Samborski wrote: > > W dniu 13.01.2013 10:23, Gleb Natapov pisze: > > >On Fri, Jan 11, 2013 at 03:57:05PM +0100, Artur Samborski wrote: > > >>W dniu 09.01.2013 11

[GIT PULL] KVM fixes for 3.8-rc3

2013-01-16 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive the following KVM bug fixes Christian Borntraeger (1): s390/kvm: Fix BUG in include/linux/kvm_host.h:745 arch/s390/kvm/kvm-s390.c |2 ++ 1 file changed, 2 insertions(+) --

Re: [Qemu-devel] [PATCH 8/8] s390: Add new channel I/O based virtio transport.

2013-01-16 Thread Cornelia Huck
On Wed, 16 Jan 2013 14:53:06 +0100 Alexander Graf wrote: > > On 16.01.2013, at 14:24, Alexander Graf wrote: > > > > > On 07.12.2012, at 13:50, Cornelia Huck wrote: > > > >> Add a new virtio transport that uses channel commands to perform > >> virtio operations. > >> > >> Add a new machine ty

Re: [Qemu-devel] [PATCH 8/8] s390: Add new channel I/O based virtio transport.

2013-01-16 Thread Alexander Graf
On 16.01.2013, at 14:24, Alexander Graf wrote: > > On 07.12.2012, at 13:50, Cornelia Huck wrote: > >> Add a new virtio transport that uses channel commands to perform >> virtio operations. >> >> Add a new machine type s390-ccw that uses this virtio-ccw transport >> and make it the default mach

Re: [PATCH 8/8] s390: Add new channel I/O based virtio transport.

2013-01-16 Thread Alexander Graf
On 07.12.2012, at 13:50, Cornelia Huck wrote: > Add a new virtio transport that uses channel commands to perform > virtio operations. > > Add a new machine type s390-ccw that uses this virtio-ccw transport > and make it the default machine for s390. > > Signed-off-by: Cornelia Huck > --- > hw/

Re: KVM: Questions and comments on make_all_cpus_request

2013-01-16 Thread Takuya Yoshikawa
On Tue, 15 Jan 2013 19:43:40 -0500 Christoffer Dall wrote: > @@ -201,9 +222,13 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) > { > long dirty_count = kvm->tlbs_dirty; > > - smp_mb(); > + smp_mb(); /* TODO: Someone should explain this! */ > if (make_all_cpus_request(kvm, KV

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Russell King - ARM Linux
If you're going to bother commenting on a big long email, please _CHOP OUT_ content which is not relevant to your reply. I paged down 5 pages, hit end, paged up, found no comment from you, so I'm not going to bother reading anything further in this message. Help your readers to read your email.

Re: FreeBSD-amd64 fails to start with SMP on quemu-kvm

2013-01-16 Thread Gleb Natapov
Copying Michael. On Tue, Jan 15, 2013 at 12:18:59PM +0100, Artur Samborski wrote: > W dniu 13.01.2013 10:23, Gleb Natapov pisze: > >On Fri, Jan 11, 2013 at 03:57:05PM +0100, Artur Samborski wrote: > >>W dniu 09.01.2013 11:15, Gleb Natapov pisze: > >>>On Tue, Jan 08, 2013 at 09:45:35PM +0100, Artu

Re: [PATCH v5 07/14] KVM: ARM: World-switch implementation

2013-01-16 Thread Gleb Natapov
On Tue, Jan 15, 2013 at 11:08:24PM -0500, Christoffer Dall wrote: > On Tue, Jan 15, 2013 at 9:08 PM, Christoffer Dall > wrote: > > On Tue, Jan 15, 2013 at 4:43 AM, Gleb Natapov wrote: > >> On Tue, Jan 08, 2013 at 01:39:24PM -0500, Christoffer Dall wrote: > >>> Provides complete world-switch imple

Re: [PATCH] kvm: close opened file

2013-01-16 Thread Gleb Natapov
Please use "kvmtool:" prefix at the subject line. On Wed, Jan 16, 2013 at 02:07:35AM +0100, Cong Ding wrote: > The file should be closed before return. > > Signed-off-by: Cong Ding > --- > tools/kvm/builtin-setup.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git

Re: [kvmarm] [PATCH v5 06/14] KVM: ARM: Inject IRQs and FIQs from userspace

2013-01-16 Thread Gleb Natapov
On Tue, Jan 15, 2013 at 05:25:13PM +0100, Alexander Graf wrote: > On 01/15/2013 04:17 PM, Gleb Natapov wrote: > >On Tue, Jan 15, 2013 at 02:04:47PM +, Peter Maydell wrote: > >>On 15 January 2013 12:52, Gleb Natapov wrote: > >>>On Tue, Jan 15, 2013 at 12:15:01PM +, Peter Maydell wrote: > >>

Re: [PATCH v11 0/3] x86, apicv: Add APIC virtualization support

2013-01-16 Thread Gleb Natapov
Please be patient. Nor me neither Marcelo reviewed previous submission. There is not point sending a new one. On Wed, Jan 16, 2013 at 06:21:09PM +0800, Yang Zhang wrote: > From: Yang Zhang > > APIC virtualization is a new feature which can eliminate most of VM exit > when vcpu handle a interrupt

[PATCH v11 3/3] x86, apicv: add virtual interrupt delivery support

2013-01-16 Thread Yang Zhang
From: Yang Zhang Virtual interrupt delivery avoids KVM to inject vAPIC interrupts manually, which is fully taken care of by the hardware. This needs some special awareness into existing interrupr injection path: - for pending interrupt, instead of direct injection, we may need update architect

[PATCH v11 1/3] x86, apicv: add APICv register virtualization support

2013-01-16 Thread Yang Zhang
- APIC read doesn't cause VM-Exit - APIC write becomes trap-like Signed-off-by: Kevin Tian Signed-off-by: Yang Zhang --- arch/x86/include/asm/vmx.h |2 ++ arch/x86/kvm/lapic.c | 15 +++ arch/x86/kvm/lapic.h |2 ++ arch/x86/kvm/vmx.c | 33 +

[PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-16 Thread Yang Zhang
From: Yang Zhang basically to benefit from apicv, we need to enable virtualized x2apic mode. Currently, we only enable it when guest is really using x2apic. Also, clear MSR bitmap for corresponding x2apic MSRs when guest enabled x2apic: 0x800 - 0x8ff: no read intercept for apicv register vir

[PATCH v11 0/3] x86, apicv: Add APIC virtualization support

2013-01-16 Thread Yang Zhang
From: Yang Zhang APIC virtualization is a new feature which can eliminate most of VM exit when vcpu handle a interrupt: APIC register virtualization: APIC read access doesn't cause APIC-access VM exits. APIC write becomes trap-like. Virtual interrupt delivery: Virtual in

Re: [PATCH v5 03/14] KVM: ARM: Initial skeleton to compile KVM support

2013-01-16 Thread Russell King - ARM Linux
On Wed, Jan 16, 2013 at 01:26:01PM +1030, Rusty Russell wrote: > Christoffer Dall writes: > > > On Mon, Jan 14, 2013 at 11:24 AM, Russell King - ARM Linux > > wrote: > >> On Tue, Jan 08, 2013 at 01:38:55PM -0500, Christoffer Dall wrote: > >>> + /* -ENOENT for unknown features, -EINVAL for in

  1   2   >