Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Gleb Natapov
On Mon, Dec 05, 2011 at 01:39:37PM +0800, Liu ping fan wrote: On Sun, Dec 4, 2011 at 8:10 PM, Gleb Natapov g...@redhat.com wrote: On Sun, Dec 04, 2011 at 07:53:37PM +0800, Liu ping fan wrote: On Sat, Dec 3, 2011 at 2:26 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2011-12-02 07:26, Liu

[net-next RFC PATCH 0/5] Series short description

2011-12-05 Thread Jason Wang
multiple queue virtio-net: flow steering through host/guest cooperation Hello all: This is a rough series adds the guest/host cooperation of flow steering support based on Krish Kumar's multiple queue virtio-net driver patch 3/3 (http://lwn.net/Articles/467283/). This idea is simple, the

[net-next RFC PATCH 1/5] virtio_net: passing rxhash through vnet_hdr

2011-12-05 Thread Jason Wang
This patch enables the ability to pass the rxhash value to guest through vnet_hdr. This is useful for guest when it wants to cooperate with virtual device to steer a flow to dedicated guest cpu. This feature is negotiated through VIRTIO_NET_F_GUEST_RXHASH. Signed-off-by: Jason Wang

[net-next RFC PATCH 2/5] tuntap: simple flow director support

2011-12-05 Thread Jason Wang
This patch adds a simple flow director to tun/tap device. It is just a page that contains the hash to queue mapping which could be changed by user-space. The backend (tap/macvtap) would query this table to get the desired queue of a packets when it send packets to userspace. The page address were

[net-next RFC PATCH 3/5] macvtap: flow director support

2011-12-05 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/macvlan.c |4 drivers/net/macvtap.c | 36 ++-- include/linux/if_macvlan.h |1 + 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/net/macvlan.c

[net-next RFC PATCH 4/5] virtio: introduce a method to get the irq of a specific virtqueue

2011-12-05 Thread Jason Wang
Device specific irq configuration may be need in order to do some optimization. So a new configuration is needed to get the irq of a virtqueue. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/lguest/lguest_device.c |8 drivers/s390/kvm/kvm_virtio.c |6 ++

[net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-05 Thread Jason Wang
In order to let the packets of a flow to be passed to the desired guest cpu, we can co-operate with devices through programming the flow director which was just a hash to queue table. This kinds of co-operation is done through the accelerate RFS support, a device specific flow sterring method

winXP Standard PC HAL and qemu-kvm = 0.15

2011-12-05 Thread Michael Tokarev
As it turned out, a windowsXP machine does not work in qemu-kvm = 0.15 (it loses network and USB entirely) if it is using Standard PC HAL. In 0.14 it worked fine, but not in 0.14 (I haven't tried any in-between versions yet). There are several HAL types available in winXP: these are Uniprocessor

[PATCH] kvm tools: Split custom rootfs init into two stages

2011-12-05 Thread Sasha Levin
Currently custom rootfs init is built along with the main KVM tools executable and is copied into custom rootfs directories when they are created with 'kvm setup'. The problem there is that if the init code changes, they have to be manually copied to custom rootfs directories. Instead, this patch

Re: [PATCH] kvm tools: Split custom rootfs init into two stages

2011-12-05 Thread Cyrill Gorcunov
On Mon, Dec 05, 2011 at 11:22:11AM +0200, Sasha Levin wrote: +static int kvm_custom_stage2(void) +{ + char tmp[PATH_MAX], dst[PATH_MAX], *src; + const char *rootfs; + int r; + + src = realpath(guest/init_stage2, NULL); + if (src == NULL) + return

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Avi Kivity
On 12/05/2011 07:29 AM, Liu ping fan wrote: like this, #define kvm_for_each_vcpu(idx, cnt, vcpup, kvm) \ for (idx = 0, cnt = 0, vcpup = kvm_get_vcpu(kvm, idx); \ cnt atomic_read(kvm-online_vcpus) \ idx KVM_MAX_VCPUS; \ idx++, (vcpup == NULL)?:cnt++,

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Gleb Natapov
On Mon, Dec 05, 2011 at 11:30:51AM +0200, Avi Kivity wrote: On 12/05/2011 07:29 AM, Liu ping fan wrote: like this, #define kvm_for_each_vcpu(idx, cnt, vcpup, kvm) \ for (idx = 0, cnt = 0, vcpup = kvm_get_vcpu(kvm, idx); \ cnt atomic_read(kvm-online_vcpus) \ idx

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-05 Thread Avi Kivity
On 12/05/2011 02:10 AM, Rusty Russell wrote: On Sun, 04 Dec 2011 17:16:59 +0200, Avi Kivity a...@redhat.com wrote: On 12/04/2011 05:11 PM, Michael S. Tsirkin wrote: There's also the used ring, but that's a mistake if you have out of order completion. We should have used copying.

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Avi Kivity
On 12/05/2011 11:42 AM, Gleb Natapov wrote: On Mon, Dec 05, 2011 at 11:30:51AM +0200, Avi Kivity wrote: On 12/05/2011 07:29 AM, Liu ping fan wrote: like this, #define kvm_for_each_vcpu(idx, cnt, vcpup, kvm) \ for (idx = 0, cnt = 0, vcpup = kvm_get_vcpu(kvm, idx); \ cnt

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Avi Kivity
On 12/04/2011 11:38 PM, Jan Kiszka wrote: It should be also possible to migrate from non-KVM device to KVM version, different names would prevent that for ever. It is (theoretically) possible with these patches as the vmstate names are the same. KVM to TCG migration does not work right

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Gleb Natapov
On Mon, Dec 05, 2011 at 11:58:56AM +0200, Avi Kivity wrote: On 12/05/2011 11:42 AM, Gleb Natapov wrote: On Mon, Dec 05, 2011 at 11:30:51AM +0200, Avi Kivity wrote: On 12/05/2011 07:29 AM, Liu ping fan wrote: like this, #define kvm_for_each_vcpu(idx, cnt, vcpup, kvm) \ for

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Avi Kivity
On 12/05/2011 12:18 PM, Gleb Natapov wrote: We can, but that's a bigger change. Is it? I do not see a lot of accesses to vcpu array except those loops. Well actually some of those loops have to go away and be replaced by a hash lookup with apic id as key. -- error compiling

Re: [net-next RFC PATCH 2/5] tuntap: simple flow director support

2011-12-05 Thread Stefan Hajnoczi
On Mon, Dec 5, 2011 at 8:58 AM, Jason Wang jasow...@redhat.com wrote: This patch adds a simple flow director to tun/tap device. It is just a page that contains the hash to queue mapping which could be changed by user-space. The backend (tap/macvtap) would query this table to get the desired

Re: [PATCH] kvm: make vcpu life cycle separated from kvm instance

2011-12-05 Thread Gleb Natapov
On Mon, Dec 05, 2011 at 12:22:53PM +0200, Avi Kivity wrote: On 12/05/2011 12:18 PM, Gleb Natapov wrote: We can, but that's a bigger change. Is it? I do not see a lot of accesses to vcpu array except those loops. Well actually some of those loops have to go away and be replaced

Re: [Qemu-devel] [RFC][PATCH 02/16] kvm: Move kvmclock into hw/kvm folder

2011-12-05 Thread Andreas Färber
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 03.12.2011 23:33, schrieb Jan Kiszka: On 2011-12-03 20:00, Andreas Färber wrote: Am 03.12.2011 12:17, schrieb Jan Kiszka: diff --git a/hw/kvmclock.c b/hw/kvm/clock.c similarity index 96% rename from hw/kvmclock.c rename to hw/kvm/clock.c index

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-05 Thread Stefan Hajnoczi
On Mon, Dec 5, 2011 at 8:59 AM, Jason Wang jasow...@redhat.com wrote: +static int virtnet_set_fd(struct net_device *dev, u32 pfn) +{ +       struct virtnet_info *vi = netdev_priv(dev); +       struct virtio_device *vdev = vi-vdev; + +       if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_FD))

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Jan Kiszka
On 2011-12-05 11:01, Avi Kivity wrote: On 12/04/2011 11:38 PM, Jan Kiszka wrote: It should be also possible to migrate from non-KVM device to KVM version, different names would prevent that for ever. It is (theoretically) possible with these patches as the vmstate names are the same. KVM to

[kvm-autotest] tests.cgroup: Add 2 new tests of cpuset.cpus cgroup functionality

2011-12-05 Thread Lukas Doktor
Hi, This patchset fixes some issues in cgroup_common.py library and adds 2 new tests to cgroup-kvm test. Please find the details in each patch. Sent to upstream as pull req. 103: https://github.com/autotest/autotest/pull/103 Regards, Lukáš -- To unsubscribe from this list: send the line

[PATCH 2/3] [kvm-autotest] tests.cgroup: Add TestCpusetCpus test

2011-12-05 Thread Lukas Doktor
Tests the cpuset.cpus cgroup feature. It stresses all VM's CPUs and changes the CPU affinity. Verifies correct behaviour. * Add TestCpusetCpus test * import cleanup * private function names cleanup --- client/tests/cgroup/cgroup_common.py |2 + client/tests/kvm/tests/cgroup.py | 211

[PATCH 3/3] [kvm-autotest] tests.cgroup: Add TestCpusetCpusSwitching

2011-12-05 Thread Lukas Doktor
Tests the cpuset.cpus cgroup feature. It stresses all VM's CPUs while switching between cgroups with different setting. Signed-off-by: Lukas Doktor ldok...@redhat.com --- client/tests/cgroup/cgroup_common.py |4 + client/tests/kvm/tests/cgroup.py | 108 +-

[PATCH 1/3] [autotest] client.tests.cgroup: Replace LoadPerCpu() by get_load_per_cpu

2011-12-05 Thread Lukas Doktor
* Move LoadPerCpu into cgroup_common.py (cgroup-kvm will need it too) * [FIX] Use etraceback * Code cleanup --- client/tests/cgroup/cgroup.py| 79 ++ client/tests/cgroup/cgroup_common.py | 22 + 2 files changed, 35 insertions(+), 66 deletions(-)

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Avi Kivity
On 12/05/2011 01:37 PM, Jan Kiszka wrote: On 2011-12-05 11:01, Avi Kivity wrote: On 12/04/2011 11:38 PM, Jan Kiszka wrote: It should be also possible to migrate from non-KVM device to KVM version, different names would prevent that for ever. It is (theoretically) possible with these

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Jan Kiszka
On 2011-12-05 13:36, Avi Kivity wrote: On 12/05/2011 01:37 PM, Jan Kiszka wrote: On 2011-12-05 11:01, Avi Kivity wrote: On 12/04/2011 11:38 PM, Jan Kiszka wrote: It should be also possible to migrate from non-KVM device to KVM version, different names would prevent that for ever. It is

Re: [PATCH V3] Guest stop notification

2011-12-05 Thread Eric B Munson
On Sat, 03 Dec 2011, Jan Kiszka wrote: On 2011-12-02 22:27, Eric B Munson wrote: On Fri, 02 Dec 2011, Jan Kiszka wrote: On 2011-12-02 20:19, Eric B Munson wrote: Often when a guest is stopped from the qemu console, it will report spurious soft lockup warnings on resume. There are

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Avi Kivity
On 12/05/2011 02:47 PM, Jan Kiszka wrote: (the memory API added unstable names, hopefully the QOM can take over the stable ones and we'll have a good way to denote the unstable ones). OK, maybe - or likely - we should make those device models have the same names in QOM once

Re: winXP Standard PC HAL and qemu-kvm = 0.15

2011-12-05 Thread Avi Kivity
On 12/05/2011 11:21 AM, Michael Tokarev wrote: As it turned out, a windowsXP machine does not work in qemu-kvm = 0.15 (it loses network and USB entirely) if it is using Standard PC HAL. In 0.14 it worked fine, but not in 0.14 (I haven't tried any in-between versions yet). There are several

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Jan Kiszka
On 2011-12-05 14:14, Avi Kivity wrote: On 12/05/2011 02:47 PM, Jan Kiszka wrote: (the memory API added unstable names, hopefully the QOM can take over the stable ones and we'll have a good way to denote the unstable ones). OK, maybe - or likely - we should make those device models have the

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Avi Kivity
On 12/05/2011 03:29 PM, Jan Kiszka wrote: On 2011-12-05 14:14, Avi Kivity wrote: On 12/05/2011 02:47 PM, Jan Kiszka wrote: (the memory API added unstable names, hopefully the QOM can take over the stable ones and we'll have a good way to denote the unstable ones). OK, maybe - or

Re: [Qemu-devel] [PATCH V3] Guest stop notification

2011-12-05 Thread Jan Kiszka
On 2011-12-05 14:35, Marcelo Tosatti wrote: On Sat, Dec 03, 2011 at 12:45:51PM +0100, Jan Kiszka wrote: I was referring to the relation between the IOCTL and kvmclock, but IOCTL vs. kvm_run. Jan Ah, OK. Yes, we better characterize it as KVMCLOCK specific (a generic guest is paused command

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-05 Thread Jan Kiszka
On 2011-12-05 14:36, Avi Kivity wrote: On 12/05/2011 03:29 PM, Jan Kiszka wrote: On 2011-12-05 14:14, Avi Kivity wrote: On 12/05/2011 02:47 PM, Jan Kiszka wrote: (the memory API added unstable names, hopefully the QOM can take over the stable ones and we'll have a good way to denote the

KVM call agenda for 12/6 (Tuesday) @ 10am US/Eastern

2011-12-05 Thread Juan Quintela
Hi Please send in any agenda items you are interested in covering. Proposal (from Anthony): 1. A short introduction to each of the guest agents, what guests they support, and what verbs they support. 2. A short description of key requirements from each party (oVirt, libvirt, QEMU) for a

[PATCH 1/5] kvm tools: Split custom rootfs init into two stages

2011-12-05 Thread Sasha Levin
Currently custom rootfs init is built along with the main KVM tools executable and is copied into custom rootfs directories when they are created with 'kvm setup'. The problem there is that if the init code changes, they have to be manually copied to custom rootfs directories. Instead, this patch

[PATCH 2/5] kvm tools: Remove double 'init=' kernel param

2011-12-05 Thread Sasha Levin
Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/builtin-run.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 9635c82..de3001e 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@

[PATCH 3/5] kvm tools: Allow easily sandboxing applications within a guest

2011-12-05 Thread Sasha Levin
This patch adds a '--sandbox' argument when used in conjuction with a custom rootfs, it allows running a script or an executable in the guest environment by using executables and other files from the host. This is useful when testing code that might cause problems on the host, or to automate

[PATCH 4/5] kvm tools: Ignore parameters after dashdash in 'kvm run'

2011-12-05 Thread Sasha Levin
This allows other commands to wrap 'kvm run' and use the parameters user provides after a dash-dash for it's own use. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/builtin-run.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git

[PATCH 5/5] kvm tools: Add 'kvm sandbox'

2011-12-05 Thread Sasha Levin
This patch adds 'kvm sandbox' which is a wrapper on top of 'kvm run' which allows the user to easily specify sandboxed command to run in a custom rootfs guest. Example usage: kvm sandbox -d test_guest -k some_kernel -- do_something_in_guest Suggested-by: Pekka Enberg

Re: [PATCH 3/5 V4] Add ioctl for KVM_GUEST_STOPPED

2011-12-05 Thread Eric B Munson
On Sat, 03 Dec 2011, Sasha Levin wrote: On Tue, 2011-11-29 at 16:35 -0500, Eric B Munson wrote: Now that we have a flag that will tell the guest it was suspended, create an interface for that communication using a KVM ioctl. Signed-off-by: Eric B Munson emun...@mgebm.net Can it

Re: [PATCH v2 1/3] pci: Rework config space blocking services

2011-12-05 Thread Jesse Barnes
On Fri, 4 Nov 2011 09:45:59 +0100 Jan Kiszka jan.kis...@siemens.com wrote: pci_block_user_cfg_access was designed for the use case that a single context, the IPR driver, temporarily delays user space accesses to the config space via sysfs. This assumption became invalid by the time

Re: [PATCHv2 RFC] virtio-pci: flexible configuration layout

2011-12-05 Thread Jesse Barnes
On Mon, 14 Nov 2011 20:18:55 +0200 Michael S. Tsirkin m...@redhat.com wrote: Add a flexible mechanism to specify virtio configuration layout, using pci vendor-specific capability. A separate capability is used for each of common, device specific and data-path accesses. Warning: compiled

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-12-05 Thread Cam Macdonell
2011/12/2 Cam Macdonell c...@cs.ualberta.ca: 2011/11/30 Cam Macdonell c...@cs.ualberta.ca: 2011/11/30 Zang Hongyong zanghongy...@huawei.com: Can this bug fix patch be applied yet? Sorry, for not replying yet. I'll test your patch within the next day. Have you confirmed the proper receipt

Re: [net-next RFC PATCH 2/5] tuntap: simple flow director support

2011-12-05 Thread Ben Hutchings
On Mon, 2011-12-05 at 16:58 +0800, Jason Wang wrote: This patch adds a simple flow director to tun/tap device. It is just a page that contains the hash to queue mapping which could be changed by user-space. The backend (tap/macvtap) would query this table to get the desired queue of a packets

Re: [net-next RFC PATCH 3/5] macvtap: flow director support

2011-12-05 Thread Ben Hutchings
Similarly, macvtap chould implement the ethtool {get,set}_rxfh_indir operations. Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked. -- To unsubscribe from

[PATCH V4] Guest stop notification

2011-12-05 Thread Eric B Munson
Often when a guest is stopped from the qemu console, it will report spurious soft lockup warnings on resume. There are kernel patches being discussed that will give the host the ability to tell the guest that it is being stopped and should ignore the soft lockup warning that generates. This

[PATCH 1/5 V5] Add flag to indicate that a vm was stopped by the host

2011-12-05 Thread Eric B Munson
This flag will be used to check if the vm was stopped by the host when a soft lockup was detected. The host will set the flag when it stops the guest. On resume, the guest will check this flag if a soft lockup is detected and skip issuing the warning. Signed-off-by: Eric B Munson

[PATCH 2/5 V5] Add functions to check if the host has stopped the vm

2011-12-05 Thread Eric B Munson
When a host stops or suspends a VM it will set a flag to show this. The watchdog will use these functions to determine if a softlockup is real, or the result of a suspended VM. Signed-off-by: Eric B Munson emun...@mgebm.net Cc: mi...@redhat.com Cc: h...@zytor.com Cc: a...@arndb.de Cc:

[PATCH 0/5 V5] Avoid soft lockup message when KVM is stopped by host

2011-12-05 Thread Eric B Munson
Changes from V4: Rename KVM_GUEST_PAUSED to KVMCLOCK_GUEST_PAUSED Add description of KVMCLOCK_GUEST_PAUSED ioctl to api.txt Changes from V3: Include CC's on patch 3 Drop clear flag ioctl and have the watchdog clear the flag when it is reset Changes from V2: A new kvm functions defined in

[PATCH 5/5 V5] Add check for suspended vm in softlockup detector

2011-12-05 Thread Eric B Munson
A suspended VM can cause spurious soft lockup warnings. To avoid these, the watchdog now checks if the kernel knows it was stopped by the host and skips the warning if so. When the watchdog is reset successfully, clear the guest paused flag. Signed-off-by: Eric B Munson emun...@mgebm.net Cc:

Re: winXP Standard PC HAL and qemu-kvm = 0.15

2011-12-05 Thread Michael Tokarev
On 05.12.2011 17:28, Avi Kivity wrote: [] I haven't debugged further yet, -- because it were not easy to find out what was causing the regression and how to reproduce it, and also because I don't think it is the right HAL for qemu-kvm guest anyway. It's not, but the regression indicates we

Re: [PATCHv2 RFC] virtio-pci: flexible configuration layout

2011-12-05 Thread Michael S. Tsirkin
On Mon, Dec 05, 2011 at 11:16:05AM -0800, Jesse Barnes wrote: On Mon, 14 Nov 2011 20:18:55 +0200 Michael S. Tsirkin m...@redhat.com wrote: Add a flexible mechanism to specify virtio configuration layout, using pci vendor-specific capability. A separate capability is used for each of

[PATCH 4/5 V5] Add generic stubs for kvm stop check functions

2011-12-05 Thread Eric B Munson
Signed-off-by: Eric B Munson emun...@mgebm.net Cc: mi...@redhat.com Cc: h...@zytor.com Cc: a...@arndb.de Cc: ry...@linux.vnet.ibm.com Cc: aligu...@us.ibm.com Cc: mtosa...@redhat.com Cc: jeremy.fitzhardi...@citrix.com Cc: levinsasha...@gmail.com Cc: Jan Kiszka jan.kis...@siemens.com Cc:

[PATCH 3/5 V5] Add ioctl for KVMCLOCK_GUEST_STOPPED

2011-12-05 Thread Eric B Munson
Now that we have a flag that will tell the guest it was suspended, create an interface for that communication using a KVM ioctl. Signed-off-by: Eric B Munson emun...@mgebm.net Cc: mi...@redhat.com Cc: h...@zytor.com Cc: a...@arndb.de Cc: ry...@linux.vnet.ibm.com Cc: aligu...@us.ibm.com Cc:

Re: [net-next RFC PATCH 5/5] virtio-net: flow director support

2011-12-05 Thread Ben Hutchings
On Mon, 2011-12-05 at 16:59 +0800, Jason Wang wrote: In order to let the packets of a flow to be passed to the desired guest cpu, we can co-operate with devices through programming the flow director which was just a hash to queue table. This kinds of co-operation is done through the

kvm deadlock

2011-12-05 Thread Nate Custer
Hello, I am struggling with repeatable full hardware locks when running 8-12 KVM vms. At some point before the hard lock I get a inconsistent lock state warning. An example of this can be found here: http://pastebin.com/8wKhgE2C After that the server continues to run for a while and then

Re: [Xen-devel] [PATCH RFC V3 1/4] debugfs: Add support to print u32 array in debugfs

2011-12-05 Thread Konrad Rzeszutek Wilk
On Wed, Nov 30, 2011 at 02:29:39PM +0530, Raghavendra K T wrote: Add debugfs support to print u32-arrays in debugfs. Move the code from Xen to debugfs to make the code common for other users as well. Signed-off-by: Srivatsa Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Suzuki Poulose

[no subject]

2011-12-05 Thread Cao,Bing Bu
subscribe kvm -- 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: [PATCH RFC V3 4/4] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2011-12-05 Thread Konrad Rzeszutek Wilk
On Wed, Nov 30, 2011 at 02:30:38PM +0530, Raghavendra K T wrote: This patch extends Linux guests running on KVM hypervisor to support pv-ticketlocks. During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_KICK_VCPU) to support

[PATCH 00/28] kvm tools: Prepare kvmtool for another architecture

2011-12-05 Thread Matt Evans
Hi, This patch series rearranges and tidies various parts of kvmtool to pave the way for the addition of support for another architecture -- SPAPR PPC64. A second patch series will follow to present the PPC64 support. kvmtool is extremely x86-specific, so a fair chunk of refactoring into

[PATCH 02/28] kvm tools: Only build/init i8042 on x86

2011-12-05 Thread Matt Evans
Not every architecture has an i8042 kbd controller, so only use this when building for x86. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile |2 +- tools/kvm/builtin-run.c |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/kvm/Makefile

[PATCH 03/28] kvm tools: Add Makefile parameter for kernel include path

2011-12-05 Thread Matt Evans
This patch adds an 'I' parameter to override the default kernel include path of '../../include'. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index

[PATCH 04/28] kvm tools: Re-arrange Makefile to heed CFLAGS before checking for optional libs

2011-12-05 Thread Matt Evans
The checks for optional libraries build code to perform the tests, so should respect certain CFLAGS -- in particular, -m64 so we check for 64bit libraries if they're required. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile | 86

[PATCH 05/28] kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link appropriately

2011-12-05 Thread Matt Evans
On LP64 systems our u64s are just longs; remove the %llx'es in favour of PRIx64 etc. This patch also adds CFLAGS to the final link, so that any -m64 is obeyed when linking, too. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile |2 +- tools/kvm/builtin-run.c | 14

[PATCH 06/28] kvm tools: Add arch-specific KVM_RUN exit handling via kvm_cpu__handle_exit()

2011-12-05 Thread Matt Evans
This patch creates a new function in x86/kvm-cpu.c, kvm_cpu__handle_exit(), in which arch-specific exit reasons can be handled outside of the common runloop. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/include/kvm/kvm-cpu.h |2 ++ tools/kvm/kvm-cpu.c | 10 --

[PATCH 07/28] kvm tools: Move 'kvm__recommended_cpus' to arch-specific code

2011-12-05 Thread Matt Evans
Architectures can recommend/count/determine number of CPUs differently, so move this out of generic code. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/kvm.c | 30 -- tools/kvm/x86/kvm.c | 30 ++ 2 files changed, 30

[PATCH 08/28] kvm tools: Fix KVM_RUN exit code check

2011-12-05 Thread Matt Evans
kvm_cpu__run() currently die()s if KVM_RUN returns non-zero. Some architectures may return positive values in non-error cases, whereas real errors are always negative return values. Check for those instead. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/kvm-cpu.c |2 +- 1 files

[PATCH 09/28] kvm tools: Add kvm__arch_periodic_poll()

2011-12-05 Thread Matt Evans
Currently, the SIGALRM handler calls device poll functions (for serial, virtio console) directly. Which devices are present and which require polling is a system-specific decision, so create a new function called from common code move the x86-specific poll calls into it. Signed-off-by: Matt

[PATCH 10/28] kvm tools: term.h needs to include stdbool.h

2011-12-05 Thread Matt Evans
Fix a missing include. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/include/kvm/term.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/kvm/include/kvm/term.h b/tools/kvm/include/kvm/term.h index 37ec731..938c26f 100644 --- a/tools/kvm/include/kvm/term.h

[PATCH 11/28] kvm tools: kvm.c needs to include sys/stat.h for mkdir

2011-12-05 Thread Matt Evans
Fix a missing include. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/kvm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index e526483..33243f1 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -8,6 +8,7 @@ #include

[PATCH 12/28] kvm tools: Move arch-specific cmdline init into kvm__arch_set_cmdline()

2011-12-05 Thread Matt Evans
Different systems will want different base kernel commandlines, e.g. non-x86 systems probably don't need noapic, i8042.* etc., so set the commandline up in arch-specific code. Then, if the resulting commandline is empty, don't strcat a space onto the front. Signed-off-by: Matt Evans

[PATCH 13/28] kvm tools: Add CONSOLE_HV term type and allow it to be selected

2011-12-05 Thread Matt Evans
This patch paves the way for adding a hypervisor console, useful on systems that support one out of the box yet don't have either serial port or virtio console support (e.g. kernels expecting POWER SPAPR). Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/builtin-run.c |8 ++--

[PATCH 14/28] kvm tools: Fix term_getc(), term_getc_iov() endian bugs

2011-12-05 Thread Matt Evans
term_getc()'s int c has one byte written into it (at its lowest address) by read_in_full(). This is expected to be the least significant byte, but that isn't the case on BE! Use correct type, unsigned char. A similar issue exists in term_getc_iov(), which needs to write a char to the iov rather

[PATCH 15/28] kvm tools: Allow initrd_check() to match a cpio

2011-12-05 Thread Matt Evans
cpios are valid as initrds too, so allow them through the check. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/kvm.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 33243f1..457de1a 100644 --- a/tools/kvm/kvm.c +++

[PATCH 16/28] kvm tools: Allow load_flat_binary() to load an initrd alongside

2011-12-05 Thread Matt Evans
This patch passes the initrd fd and commandline to load_flat_binary(), which may be used to load both the kernel an initrd (stashing or inserting the commandline as appropriate) in the same way that load_bzimage() does. This is especially useful when load_bzimage() is unused for a particular

[PATCH 17/28] kvm tools: Only call symbol__init() if we have BFD

2011-12-05 Thread Matt Evans
CONFIG_HAS_BFD is optional, symbol.c inclusion is optional -- so make its init call dependent on CONFIG_HAS_BFD. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/builtin-run.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/kvm/builtin-run.c

[PATCH 18/28] kvm tools: Initialise PCI before devices start getting registered with PCI

2011-12-05 Thread Matt Evans
Re-arrange pci__init() in builtin-run such that it comes before devices are initialised. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/builtin-run.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index

[PATCH 19/28] kvm tools: Perform CPU and firmware setup after devices are added

2011-12-05 Thread Matt Evans
Currently some devices (in this case kbd, fb, vesa) are initialised after CPU/firmware setup. On some platforms (e.g. PPC) kvm__arch_setup_firmware() may be making a device tree. Any devices added after this point will be missed! Tiny refactor of builtin-run.c, moving timer start, firmware

[PATCH 20/28] kvm tools: Init IRQs after determining nrcpus

2011-12-05 Thread Matt Evans
IRQ init may involve per-CPU setup/allocation of resources, so make sure kvm-nrcpus is initialised before calling irq__init(). Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/builtin-run.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/builtin-run.c

[PATCH 21/28] kvm tools: Add --hugetlbfs option to specify memory path

2011-12-05 Thread Matt Evans
Some architectures may want to use hugetlbfs to mmap() their guest memory, so allow a path to be specified on the commandline and pass it to kvm__arch_init(). Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/builtin-run.c |4 +++- tools/kvm/include/kvm/kvm.h |4 ++--

[PATCH 22/28] kvm tools: Move PCI_MAX_DEVICES to pci.h

2011-12-05 Thread Matt Evans
Other pieces of kvmtool may be interested in PCI_MAX_DEVICES. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/include/kvm/pci.h |1 + tools/kvm/pci.c |1 - 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/include/kvm/pci.h

[PATCH 23/28] kvm tools: Endian-sanitise pci.h and PCI device setup

2011-12-05 Thread Matt Evans
vesa, pci-shmem and virtio-pci devices need to set up config space with little-endian conversions (as config space is LE). The pci_config_address bitfield also needs to be reversed when building on BE systems. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/hw/pci-shmem.c | 23

[PATCH 24/28] kvm tools: Fix virtio-pci endian bug when reading VIRTIO_PCI_QUEUE_NUM

2011-12-05 Thread Matt Evans
The field size is currently wrong, read into a 32bit word instead of 16. This casues trouble when BE. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/virtio/pci.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c

[PATCH 25/28] kvm tools: Correctly set virtio-pci bar_size and remove hardwired address

2011-12-05 Thread Matt Evans
The BAR addresses are set up fine, but missed the bar_size[] array which is now updated correspondingly. Use PCI_IO_SIZE instead of '0x100'. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/virtio/pci.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH 26/28] kvm tools: Add pci__config_{rd,wr}(), pci__find_dev() and fix PCI config register addressing

2011-12-05 Thread Matt Evans
This allows config space access in a more natural manner than clunky x86 IO ports, and is useful for other architectures. Furthermore, the actual registers were only accessed in 32bit chunks; other systems (e.g. PPC) allow smaller accesses so that, for example, the 16-bit config field can be

[PATCH 27/28] kvm tools: Arch-specific define for PCI MMIO allocation area

2011-12-05 Thread Matt Evans
pci_get_io_space_block() used to grab addresses from KVM_32BIT_GAP_START + 0x100, which is x86-specific. Create a new define, KVM_PCI_MMIO_AREA, to specify a bus address these allocations can come from. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/pci.c |

[PATCH 28/28] kvm tools: Create arch-specific kvm_cpu__emulate_io()

2011-12-05 Thread Matt Evans
Different architectures will deal with MMIO exits differently. For example, KVM_EXIT_IO is x86-specific, and I/O cycles are often synthesisted by steering into windows in PCI bridges on other architectures. This patch moves the IO/MMIO exit code from the main runloop into x86/kvm-cpu.c

[PATCH 1/8] kvm tools: Add initial SPAPR PPC64 architecture support

2011-12-05 Thread Matt Evans
This patch adds a new arch directory, powerpc, basic file structure, register setup and where necessary stubs out arch-specific functions (e.g. interrupts, runloop exits) that later patches will provide. The target is an SPAPR-compliant PPC64 machine (i.e. pSeries); there is no support for PPC32

[PATCH 2/8] kvm tools: Generate SPAPR PPC64 guest device tree

2011-12-05 Thread Matt Evans
The generated DT is the bare minimum structure required for SPAPR (on which subsequent patches for VIO, XICS, PCI etc. will build); root node, cpus, memory. Some aspects are currently hardwired for simplicity, for example advertised page sizes, HPT size, SLB size, VMX/DFP, etc. Future support of

[PATCH 0/8] kvm tools SPAPR PPC64 support

2011-12-05 Thread Matt Evans
Hi, This set of patches builds upon the prep-work of the previous set and adds support to kvmtool for PPC64 SPAPR-based guests, i.e. an environment akin to an LPAR on IBM's pSeries machines. This support is not yet fully-featured but, in a basic state, works well. The guests have a functional

[PATCH 3/8] kvm tools: Add SPAPR PPC64 hcall rtascall structure

2011-12-05 Thread Matt Evans
This patch adds the basic structure for HV calls, their registration and some of the simpler calls. A similar layout for RTAS calls is also added, again with some of the simpler RTAS calls used by the guest. The SPAPR RTAS stub is generated inline. Also, nodes for RTAS are added to the device

[PATCH 4/8] kvm tools: Add SPAPR PPC64 HV console

2011-12-05 Thread Matt Evans
This adds the console code, plus VIO HV terminal nodes are added to the device tree so the guest kernel will pick it up. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile |1 + tools/kvm/powerpc/kvm.c | 31 tools/kvm/powerpc/spapr_hvcons.c

[PATCH 5/8] kvm tools: Add PPC64 XICS interrupt controller support

2011-12-05 Thread Matt Evans
This patch adds XICS emulation code (heavily borrowed from QEMU), and wires this into kvm_cpu__irq() to fire a CPU IRQ via KVM. A device tree entry is also added. IPIs work, xics_alloc_irqnum() is added to allocate an external IRQ (which will later be used by the PHB PCI code) and finally,

[PATCH 6/8] kvm tools: Add PPC64 PCI Host Bridge

2011-12-05 Thread Matt Evans
This provides the PCI bridge, definitions for the address layout of the windows and wires in IRQs. Once PCI devices are all registered, they are enumerated and DT nodes generated for each. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/powerpc/include/kvm/kvm-arch.h |3 +

[PATCH 7/8] kvm tools: Add PPC64 kvm_cpu__emulate_io()

2011-12-05 Thread Matt Evans
This is the final piece of the puzzle for PPC SPAPR PCI; this function splits MMIO accesses into the two PHB windows directs things to MMIO/IO emulation as appropriate. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/Makefile |1 + tools/kvm/powerpc/kvm-cpu.c | 34

[PATCH 8/8] kvm tools: Make virtio-pci's ioeventfd__add_event() fall back gracefully if ioeventfds unavailable

2011-12-05 Thread Matt Evans
PPC KVM doesn't yet support ioeventfds, so don't bomb out/die. virtio-pci is able to function if it instead uses normal IO port notification. Signed-off-by: Matt Evans m...@ozlabs.org --- tools/kvm/include/kvm/ioeventfd.h |3 ++- tools/kvm/ioeventfd.c | 12 +---

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-05 Thread Rusty Russell
On Mon, 05 Dec 2011 11:52:54 +0200, Avi Kivity a...@redhat.com wrote: On 12/05/2011 02:10 AM, Rusty Russell wrote: On Sun, 04 Dec 2011 17:16:59 +0200, Avi Kivity a...@redhat.com wrote: On 12/04/2011 05:11 PM, Michael S. Tsirkin wrote: There's also the used ring, but that's a

Re: [PATCH 00/28] kvm tools: Prepare kvmtool for another architecture

2011-12-05 Thread Matt Evans
On 06/12/11 14:35, Matt Evans wrote: This patch series rearranges and tidies various parts of kvmtool to pave the way for the addition of support for another architecture -- SPAPR PPC64. A second patch series will follow to present the PPC64 support. I forgot to mention, of course, that

  1   2   >