Does macvtap support host to guest communication?

2011-04-18 Thread Asias He
Hi, folks I am trying to use qemu/qemu-kvm with macvtap using following commands: # ip link add link eth0 name v0 type macvtap mode {vepa,bridge,private} # ip link set v0 address da:4e:17:88:42:b1 up # idx=`ip link show v0 | grep mtu| awk -F: '{print $1}'` # kvm -net

Re: [PATCH] kvm tools: Add robust error handling for fork/waitpid()

2011-04-18 Thread Ingo Molnar
* Amos Kong kongjian...@gmail.com wrote: + } else if (pid 0) { + while(waitpid(pid, status, 0) != pid) { } } Doesn't that look like an infinite loop when waitpid() returns an error? Thanks, Ingo -- To unsubscribe

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Arnd Bergmann
On Monday 18 April 2011, Asias He wrote: Hi, folks I am trying to use qemu/qemu-kvm with macvtap using following commands: # ip link add link eth0 name v0 type macvtap mode {vepa,bridge,private} # ip link set v0 address da:4e:17:88:42:b1 up # idx=`ip link show v0 | grep mtu| awk -F:

Re: [PATCH 3/6] KVM: X86: Make tsc_delta calculation a function of guest tsc

2011-04-18 Thread Roedel, Joerg
On Sat, Apr 16, 2011 at 12:09:17PM -0400, Jan Kiszka wrote: This patch appears to cause troubles to Linux guests on TSC clocksource and APIC highres timer. The first boot after qemu start is always fine, but after a reboot the guest timer appears to fire incorrectly or even not at all. Hi

[PATCH] acpi_piix4: remove bad save/restore of cpus_sts

2011-04-18 Thread Avi Kivity
Introduced by a mismerge and segfaults immediately. Still need proper save/restore of this field. Signed-off-by: Avi Kivity a...@redhat.com --- hw/acpi.h |1 - hw/acpi_piix4.c |1 - 2 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/acpi.h b/hw/acpi.h index

Re: [PATCH 3/6] KVM: X86: Make tsc_delta calculation a function of guest tsc

2011-04-18 Thread Jan Kiszka
On 2011-04-18 10:03, Roedel, Joerg wrote: On Sat, Apr 16, 2011 at 12:09:17PM -0400, Jan Kiszka wrote: This patch appears to cause troubles to Linux guests on TSC clocksource and APIC highres timer. The first boot after qemu start is always fine, but after a reboot the guest timer appears to

Re: [PATCH 3/6] KVM: X86: Make tsc_delta calculation a function of guest tsc

2011-04-18 Thread Joerg Roedel
On Mon, Apr 18, 2011 at 11:12:56AM +0200, Jan Kiszka wrote: Looks good, behaviour is now fine also after reboot. Thanks for testing, I send it out together with another fix today. Joerg -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[PATCH 0/4] qemu-kvm: Sort out upstream merge regressions

2011-04-18 Thread Jan Kiszka
Recent merge with upstream left some corners of qemu-kvm broken behind. This series addresses those I've spotted based on my merge experiments in the past months. Jan Kiszka (4): qemu-kvm: Map run_on_cpu on qemu-kvm variant qemu-kvm: Synchronize states before reset qemu-kvm: Process async

[PATCH 1/4] qemu-kvm: Map run_on_cpu on qemu-kvm variant

2011-04-18 Thread Jan Kiszka
Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/helper.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index c859846..3fdbe68 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -33,6 +33,9 @@

[PATCH 4/4] qemu-kvm: Unbreak guest debugging

2011-04-18 Thread Jan Kiszka
Align handling of guest debug exits to upstream by moving it completely to the arch section. This patch accounts for changed return codes in the exit handling code. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm.h |2 -- qemu-kvm-x86.c| 14 +-

[PATCH 2/4] qemu-kvm: Synchronize states before reset

2011-04-18 Thread Jan Kiszka
This aligns qemu-kvm with upstream commit a7ada1510c. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- qemu-kvm.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 39974be..8781cde 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -18,6 +18,7

[PATCH 3/4] qemu-kvm: Process async MCE events in main loop

2011-04-18 Thread Jan Kiszka
This aligns qemu-kvm with upstream commit ab443475c9. Namely, we were missing a call to an equivalent of kvm_arch_process_async_events from the main loop. This adds a stripped down version of upstream's process_async_events until we switch over. Signed-off-by: Jan Kiszka jan.kis...@siemens.com

[PATCH 0/2] Some KVM fixes

2011-04-18 Thread Joerg Roedel
Hi, these two patches fix one issue introduced with the recent emulator-intercept code (the issue was there before too, but hidden by other workaround code which was removed in the mentioned patch-set). The second patch fixes a problem introduced with the tsc-scaling patch-set where the TSC was

[PATCH 1/2] KVM: SVM: Fix nested sel_cr0 intercept path with decode-assists

2011-04-18 Thread Joerg Roedel
This patch fixes a bug in the nested-svm path when decode-assists is available on the machine. After a selective-cr0 intercept is detected the rip is advanced unconditionally. This causes the l1-guest to continue running with an l2-rip. This bug was with the sel_cr0 unit-test on decode-assists

[PATCH 2/2] KVM: X86: Update last_guest_tsc in vcpu_put

2011-04-18 Thread Joerg Roedel
The last_guest_tsc is used in vcpu_load to adjust the tsc_offset since tsc-scaling is merged. So the last_guest_tsc needs to be updated in vcpu_put instead of the the last_host_tsc. This is fixed with this patch. Reported-by: Jan Kiszka jan.kis...@web.de Tested-by: Jan Kiszka

KVM call agenda for April 19th

2011-04-18 Thread Juan Quintela
Please, send in any agenda items you are interested in covering. 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

Enhancing qemu-img convert format compatibility

2011-04-18 Thread Stefan Hajnoczi
qemu-img is a pretty good Rosetta stone for image formats but it is missing support some format versions. In order to bring qemu-img up-to-date with the latest disk image formats we will need to find specific image files and/or software versions that produce image files that qemu-img cannot

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Asias He
On 04/18/2011 02:58 PM, Arnd Bergmann wrote: On Monday 18 April 2011, Asias He wrote: Hi, folks I am trying to use qemu/qemu-kvm with macvtap using following commands: # ip link add link eth0 name v0 type macvtap mode {vepa,bridge,private} # ip link set v0 address da:4e:17:88:42:b1 up #

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Arnd Bergmann
On Monday 18 April 2011, Asias He wrote: (1) Is it possible to add an interface to macvtap like /dev/net/tun, eg, /dev/net/macvtap. Currently, it is hard to use macvtap programmatically. I decided against having a multiplexor device because it makes permission handling rather hard. One chardev

Re: [Qemu-devel] Enhancing qemu-img convert format compatibility

2011-04-18 Thread Richard W.M. Jones
On Mon, Apr 18, 2011 at 11:18:42AM +0100, Stefan Hajnoczi wrote: qemu-img is a pretty good Rosetta stone for image formats but it is missing support some format versions. In order to bring qemu-img up-to-date with the latest disk image formats we will need to find specific image files and/or

Re: [Qemu-devel] Enhancing qemu-img convert format compatibility

2011-04-18 Thread Stefan Hajnoczi
On Mon, Apr 18, 2011 at 12:03 PM, Richard W.M. Jones rjo...@redhat.com wrote: On Mon, Apr 18, 2011 at 11:18:42AM +0100, Stefan Hajnoczi wrote: qemu-img is a pretty good Rosetta stone for image formats but it is missing support some format versions.  In order to bring qemu-img up-to-date with

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Ingo Molnar
* Arnd Bergmann a...@arndb.de wrote: On Monday 18 April 2011, Asias He wrote: (1) Is it possible to add an interface to macvtap like /dev/net/tun, eg, /dev/net/macvtap. Currently, it is hard to use macvtap programmatically. I decided against having a multiplexor device because it makes

[PATCH 1/4] kvm tools: Thread virtio-blk

2011-04-18 Thread Sasha Levin
Add I/O thread to handle I/O operations in virtio-blk. There is currently support for multiple virtio queues but the kernel side supports only one virtio queue. It's not too much of a performance impact and the ABI does support multiple queues there - So I've prefered to do it like that to keep

[PATCH 2/4] kvm tools: Use virtio_blk_parameters to configure virtio-blk

2011-04-18 Thread Sasha Levin
Like in virtio-net, use virtio_blk_parameters to pass configuration parameters Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/virtio-blk.h |6 +- tools/kvm/kvm-run.c|7 ++- tools/kvm/virtio-blk.c |4 +++- 3 files

[PATCH 3/4] kvm tools: Add debug feature to test the IO thread

2011-04-18 Thread Sasha Levin
Add --debug-io-delay-cycles and --debug-io-delay-amount to delay the completion of IO requests within virtio-blk. This feature allows to verify and debug the threading within virtio-blk. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/include/kvm/virtio-blk.h |6 +-

[PATCH 4/4] kvm tools: Complete missing segments in a iov op using regular op

2011-04-18 Thread Sasha Levin
If any of the iov operations return mid-block, use regular ops to complete the current block and continue using iov ops. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/read-write.c | 58 ++- 1 files changed, 51 insertions(+), 7

[PATCH 4/4 V2] kvm tools: Complete missing segments in a iov op using regular op

2011-04-18 Thread Sasha Levin
If any of the iov operations return mid-block, use regular ops to complete the current block and continue using iov ops. Signed-off-by: Sasha Levin levinsasha...@gmail.com --- tools/kvm/read-write.c | 58 ++- 1 files changed, 51 insertions(+), 7

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Arnd Bergmann
On Monday 18 April 2011, Ingo Molnar wrote: Only in VEPA mode. Note that a similar restriction applies when using the bridge device, for the same technical reasons. Just to sum things up, our goal is to allow the tools/kvm/ unprivileged tool to provide TCP connectivity to Linux guests

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Michael S. Tsirkin
On Mon, Apr 18, 2011 at 02:01:14PM +0200, Ingo Molnar wrote: - the kvm tool wants to be stateless - i.e. it does not want to allocate or manage host side devices - it just wants to provide the kind of TCP/IP connectivity host unprivileged user-space has, to the guest. The tool wants

Re: [PATCH] acpi_piix4: remove bad save/restore of cpus_sts

2011-04-18 Thread Isaku Yamahata
This patch would fix the segfaults. But I suppose the followings are necessary. - PIIX4PMState::gpe_cpu needs to be saved/loaded somewhere - gpe_writeb() needs to handle PROC_BASE ... PROC_BASE+31 like gpe_readb(). To be honest, I don't see why gpe_readb/writeb() are used for

[PATCH] acpi_piix4: fix save/load of PIIX4PMState

2011-04-18 Thread Isaku Yamahata
It's vmstate parameter was wrong. This patch fixes it. Reported-by: Avi Kivity a...@redhat.com Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- hw/acpi_piix4.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index

Re: [PATCH] acpi_piix4: remove bad save/restore of cpus_sts

2011-04-18 Thread Isaku Yamahata
On Mon, Apr 18, 2011 at 10:56:58PM +0900, Isaku Yamahata wrote: - enable/disable_processor() manipulates gpe-sts pointer. it should be gpe-sts[0] |= PIIX4_CPU_HOTPLUG_STATUS The last one is wrong. enable/diable_processor() looks correct. -- yamahata -- To unsubscribe from this list: send

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Asias He
On 04/18/2011 09:20 PM, Arnd Bergmann wrote: On Monday 18 April 2011, Ingo Molnar wrote: Only in VEPA mode. Note that a similar restriction applies when using the bridge device, for the same technical reasons. Just to sum things up, our goal is to allow the tools/kvm/ unprivileged tool to

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Arnd Bergmann
On Monday 18 April 2011, Asias He wrote: We do need guest appearing on the same network as the host support as well. The reason I am considering using macvatp instead of tap plus brctl is that it simplifies the bridge configuration and it is more efficient. Right, you certainly don't need to

Re: Does macvtap support host to guest communication?

2011-04-18 Thread Asias He
On 04/18/2011 11:05 PM, Arnd Bergmann wrote: On Monday 18 April 2011, Asias He wrote: We do need guest appearing on the same network as the host support as well. The reason I am considering using macvatp instead of tap plus brctl is that it simplifies the bridge configuration and it is more

[no subject]

2011-04-18 Thread Noriaki TAKAMIYA
-- 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

[PATCH v2] KVM: emulator: Use linearize() when fetching instructions.

2011-04-18 Thread Nelson Elhage
Since segments need to be handled slightly differently when fetching instructions, we add a __linearize helper that accepts a new 'fetch' boolean. Signed-off-by: Nelson Elhage nelh...@ksplice.com --- arch/x86/include/asm/kvm_emulate.h |1 - arch/x86/kvm/emulate.c | 26

Re: [PATCH] acpi_piix4: fix save/load of PIIX4PMState

2011-04-18 Thread Juan Quintela
Isaku Yamahata yamah...@valinux.co.jp wrote: It's vmstate parameter was wrong. This patch fixes it. Reported-by: Avi Kivity a...@redhat.com Signed-off-by: Isaku Yamahata yamah...@valinux.co.jp --- hw/acpi_piix4.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git

[PATCH 1/3] KVM: Introduce a helper to check if gfn is in memslot

2011-04-18 Thread Takuya Yoshikawa
From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp This will be used later. Signed-off-by: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp --- include/linux/kvm_host.h |5 + virt/kvm/kvm_main.c |6 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCH 2/3] KVM: MMU: Introduce a helper to read guest pte

2011-04-18 Thread Takuya Yoshikawa
From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp This will be optimized later. Signed-off-by: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp --- arch/x86/kvm/paging_tmpl.h | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h

[RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk

2011-04-18 Thread Takuya Yoshikawa
From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp We optimize multi level guest page table walk as follows: 1. We cache the memslot which, probably, includes the next guest page tables to avoid searching for it many times. 2. We use get_user() instead of copy_from_user(). Note that

Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk

2011-04-18 Thread Joerg Roedel
On Tue, Apr 19, 2011 at 03:38:14AM +0900, Takuya Yoshikawa wrote: From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp We optimize multi level guest page table walk as follows: 1. We cache the memslot which, probably, includes the next guest page tables to avoid searching for it

Re: [PATCH 2/2] KVM: Use pci_store/load_saved_state() around VM device usage

2011-04-18 Thread Alex Williamson
On Sun, 2011-04-17 at 12:25 +0300, Avi Kivity wrote: On 04/15/2011 10:54 PM, Alex Williamson wrote: Store the device saved state so that we can reload the device back to the original state when it's unassigned. This has the benefit that the state survives across pci_reset_function() calls

Re: [PATCH 1/2] PCI: Add interfaces to store and load the device saved state

2011-04-18 Thread Alex Williamson
On Sun, 2011-04-17 at 12:23 +0300, Avi Kivity wrote: On 04/15/2011 10:54 PM, Alex Williamson wrote: For KVM device assignment, we'd like to save off the state of a device prior to passing it to the guest and restore it later. We also want to allow pci_reset_funciton() to be called while

[PATCH 0/5] Make unattended install on Linux safer, fix OpenSUSE/SLES installs

2011-04-18 Thread Lucas Meneghel Rodrigues
While working on making unattended install on Linux guests safer, noticed that the recent patches changing unattended install to use -kernel and -initrd options [1] were breaking OpenSUSE and SLES installation. As a maintainer it is my duty to fix such breakages, so I did it. I tested all

[PATCH 1/5] KVM test: Fix incorrect CdromDisk instantiation when distro is OpenSUSE

2011-04-18 Thread Lucas Meneghel Rodrigues
We need to pass an additional tmpdir param to the class initialization. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/kvm/tests/unattended_install.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/tests/unattended_install.py

[PATCH 2/5] KVM test: Unattended install Give Linux VMs time to shutdown cleanly v2

2011-04-18 Thread Lucas Meneghel Rodrigues
During unattended install, right after we receive the ACK from the guest the test is deemed to be finished, and as shutdown_vm = yes, it'll try to end the vm issuing a shutdown command to it. However, on virtually all Linux guests an SSH server is not available at the end of install, so KVM

[PATCH 3/5] KVM test: unattended_install: Introduce wait_no_ack param

2011-04-18 Thread Lucas Meneghel Rodrigues
Some distros such as OpenSUSE won't let the install test to communicate the guest ACK for some weird reason [1], this commit modifies the unattended_install test introducing a wait_no_ack param that will skip the ACK check, and break the unattended install loop when the machine turns off itself

[PATCH 4/5] KVM test: Make OpenSUSE and SLES to use unattended_cdrom

2011-04-18 Thread Lucas Meneghel Rodrigues
We had disabled unattended_cdrom usage with SLES and OpenSUSE due to the fact that autoyast=cdrom wasn't working properly to specify a profile. However, the interaction of the linux floppy driver with qemu-kvm and qemu tends to generate some pretty bad guest kernel panics, reason why we came up

[PATCH 5/5] KVM test: Introduce OpenSUSE 11.4 guest definitions

2011-04-18 Thread Lucas Meneghel Rodrigues
For both 32 and 64 bit. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/kvm/tests_base.cfg.sample | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/tests_base.cfg.sample

Re: [PATCH 3/6] KVM: X86: Make tsc_delta calculation a function of guest tsc

2011-04-18 Thread Zachary Amsden
On Sat, Apr 16, 2011 at 06:09:17PM +0200, Jan Kiszka wrote: On 2011-03-25 09:44, Joerg Roedel wrote: + tsc_delta = !vcpu-arch.last_guest_tsc ? 0 : +tsc - vcpu-arch.last_guest_tsc; This patch appears to cause troubles to Linux

Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk

2011-04-18 Thread Takuya Yoshikawa
Joerg Roedel j...@8bytes.org wrote: Nice optimization! What scenarios have you used to test it? I used my desktop Phenom II box, running the latest qemu-kvm. So probably, NPT was ON by default. The guest was running a .ogg movie during that test. I am not an MMU expert. So I would be glad if

Re: Network performance with small packets

2011-04-18 Thread Rusty Russell
On Thu, 14 Apr 2011 19:03:59 +0300, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Apr 14, 2011 at 08:58:41PM +0930, Rusty Russell wrote: They have to offer the feature, so if the have some way of allocating non-page-aligned amounts of memory, they'll have to add those extra 2 bytes.

Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk

2011-04-18 Thread Xiao Guangrong
On 04/19/2011 02:38 AM, Takuya Yoshikawa wrote: From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp We optimize multi level guest page table walk as follows: 1. We cache the memslot which, probably, includes the next guest page tables to avoid searching for it many times. Yeah,

Re: [RFC PATCH 3/3] KVM: MMU: Optimize guest page table walk

2011-04-18 Thread Takuya Yoshikawa
Xiao Guangrong xiaoguangr...@cn.fujitsu.com wrote: We optimize multi level guest page table walk as follows: 1. We cache the memslot which, probably, includes the next guest page tables to avoid searching for it many times. Yeah, the hit is very high, after optimizing the

[PATCH 2/2] KVM: PPC: booke: add sregs support

2011-04-18 Thread Scott Wood
Signed-off-by: Scott Wood scottw...@freescale.com --- Documentation/kvm/api.txt |6 +- arch/powerpc/include/asm/kvm.h | 184 +++ arch/powerpc/include/asm/kvm_44x.h |1 - arch/powerpc/include/asm/kvm_e500.h |1 +

Re: [PATCH 1/2] KVM: PPC: booke: save/restore VRSAVE (a.k.a. USPRG0)

2011-04-18 Thread Alexander Graf
On 19.04.2011, at 00:31, Scott Wood wrote: Linux doesn't use USPRG0 (now renamed VRSAVE in the architecture, even when Altivec isn't involved), but a guest might. Signed-off-by: Scott Wood scottw...@freescale.com --- Sent to the right list this time... sigh

[PATCH 1/2] KVM: PPC: booke: save/restore VRSAVE (a.k.a. USPRG0)

2011-04-18 Thread Scott Wood
Linux doesn't use USPRG0 (now renamed VRSAVE in the architecture, even when Altivec isn't involved), but a guest might. Signed-off-by: Scott Wood scottw...@freescale.com --- Sent to the right list this time... sigh arch/powerpc/include/asm/kvm_host.h |1 + arch/powerpc/kernel/asm-offsets.c

Re: [PATCH 2/2] KVM: PPC: booke: add sregs support

2011-04-18 Thread Alexander Graf
On 19.04.2011, at 00:31, Scott Wood wrote: Signed-off-by: Scott Wood scottw...@freescale.com --- Documentation/kvm/api.txt |6 +- arch/powerpc/include/asm/kvm.h | 184 +++ arch/powerpc/include/asm/kvm_44x.h |1 -