Re: [PATCH v2] KVM: Fix kvm_irqfd_init initialization

2013-05-08 Thread Cornelia Huck
On Wed, 8 May 2013 10:57:29 +0800 Asias He as...@redhat.com wrote: In commit a0f155e96 'KVM: Initialize irqfd from kvm_init()', when kvm_init() is called the second time (e.g kvm-amd.ko and kvm-intel.ko), kvm_arch_init() will fail with -EEXIST, then kvm_irqfd_exit() will be called on the

Re: [PATCH] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
On Tue, May 07, 2013 at 02:22:32PM +0300, Michael S. Tsirkin wrote: On Tue, May 07, 2013 at 02:52:45PM +0800, Asias He wrote: Fix it by: 1) switching to use the new device specific fields per vq 2) not including vhost.c, instead make vhost-test.ko depend on vhost.ko. Please split this

[PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He as...@redhat.com --- This is for 3.10. drivers/vhost/test.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/vhost/test.c

Re: regression in v3.9? a guest stuck in BIOS if emulate_invalid_guest_state=Y

2013-05-08 Thread Jun'ichi Nomura
On 05/08/13 12:22, Jun'ichi Nomura wrote: Il 07/05/2013 14:06, Gleb Natapov ha scritto: What is the output of virsh qemu-monitor-command vm12 --hmp x/i $pc when it hangs? # virsh qemu-monitor-command vm12 --hmp x/4i \$pc 0x000c06ca: aam$0xa 0x000c06cc: mov%ax,%bx

Re: [PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Michael S. Tsirkin
On Wed, May 08, 2013 at 03:24:33PM +0800, Asias He wrote: Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He as...@redhat.com --- This is for 3.10. drivers/vhost/test.c | 35 --- 1 file changed, 24 insertions(+), 11

Re: [PATCH] vhost-test: Make vhost/test.c work

2013-05-08 Thread Michael S. Tsirkin
On Wed, May 08, 2013 at 03:14:58PM +0800, Asias He wrote: On Tue, May 07, 2013 at 02:22:32PM +0300, Michael S. Tsirkin wrote: On Tue, May 07, 2013 at 02:52:45PM +0800, Asias He wrote: Fix it by: 1) switching to use the new device specific fields per vq 2) not including vhost.c, instead

Re: [PATCH] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
On Wed, May 08, 2013 at 10:59:03AM +0300, Michael S. Tsirkin wrote: On Wed, May 08, 2013 at 03:14:58PM +0800, Asias He wrote: On Tue, May 07, 2013 at 02:22:32PM +0300, Michael S. Tsirkin wrote: On Tue, May 07, 2013 at 02:52:45PM +0800, Asias He wrote: Fix it by: 1) switching to use

Re: [PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Asias He
On Wed, May 08, 2013 at 10:56:19AM +0300, Michael S. Tsirkin wrote: On Wed, May 08, 2013 at 03:24:33PM +0800, Asias He wrote: Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He as...@redhat.com --- This is for 3.10. drivers/vhost/test.c |

Re: [PATCH v2] vhost-test: Make vhost/test.c work

2013-05-08 Thread Michael S. Tsirkin
On Wed, May 08, 2013 at 04:17:19PM +0800, Asias He wrote: On Wed, May 08, 2013 at 10:56:19AM +0300, Michael S. Tsirkin wrote: On Wed, May 08, 2013 at 03:24:33PM +0800, Asias He wrote: Fix it by switching to use the new device specific fields per vq Signed-off-by: Asias He

Re: regression in v3.9? a guest stuck in BIOS if emulate_invalid_guest_state=Y

2013-05-08 Thread Paolo Bonzini
Il 08/05/2013 09:34, Jun'ichi Nomura ha scritto: On 05/08/13 12:22, Jun'ichi Nomura wrote: Il 07/05/2013 14:06, Gleb Natapov ha scritto: What is the output of virsh qemu-monitor-command vm12 --hmp x/i $pc when it hangs? # virsh qemu-monitor-command vm12 --hmp x/4i \$pc 0x000c06ca:

Re: [v1][KVM][PATCH 1/1] kvm:ppc:booehv: direct ISI exception to Guest

2013-05-08 Thread tiejun.chen
On 05/08/2013 05:20 PM, Caraman Mihai Claudiu-B02008 wrote: -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of tiejun.chen Sent: Wednesday, May 08, 2013 4:54 AM To: Wood Scott-B07421 Cc: ag...@suse.de; kvm-...@vger.kernel.org;

Re: Kernel 3.9 - can't boot qemu with accel=kvm _and_ networking enabled

2013-05-08 Thread Paolo Bonzini
Paolo, The full command line is: qemu-system-x86_64 -machine accel=kvm -m 1024m \ -net tap -net nic \ -drive file=/dev/zpool/testsrv,index=0,cache=writethrough \ -k en-us \ -no-kvm-irqchip \ -vga cirrus I've tried any combinations of -net options, but the result is always the

[PATCH] virtio-balloon spec: rework VIRTIO_BALLOON_F_MUST_TELL_HOST feature, support silent deflation

2013-05-08 Thread Paolo Bonzini
The idea of the VIRTIO_BALLOON_F_MUST_TELL_HOST feature is to let drivers skip usage of the deflate queue when leaking the balloon (silent deflation). Guests may benefit from silent deflate by aggressively inflating the balloon; they know that they will be able to use ballooned pages without

Re: [PATCH v2] KVM: Fix kvm_irqfd_init initialization

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 10:57:29AM +0800, Asias He wrote: In commit a0f155e96 'KVM: Initialize irqfd from kvm_init()', when kvm_init() is called the second time (e.g kvm-amd.ko and kvm-intel.ko), kvm_arch_init() will fail with -EEXIST, then kvm_irqfd_exit() will be called on the error handling

Re: KVM: x86: fix maintenance of guest/host xcr0 state

2013-05-08 Thread Gleb Natapov
On Mon, Apr 15, 2013 at 11:30:13PM -0300, Marcelo Tosatti wrote: ** Untested **. Emulation of xcr0 writes zero guest_xcr0_loaded variable so that subsequent VM-entry reloads CPU's xcr0 with guests xcr0 value. However, this is incorrect because guest_xcr0_loaded variable is read to

Re: [PATCH v4 4/6] KVM: MMU: fast invalid all shadow pages

2013-05-08 Thread Gleb Natapov
On Tue, May 07, 2013 at 12:09:29PM -0300, Marcelo Tosatti wrote: On Tue, May 07, 2013 at 05:56:08PM +0300, Gleb Natapov wrote: Yes, I am missing what Marcelo means there too. We cannot free memslot until we unmap its rmap one way or the other. I do not understand what are you

kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
I have the same issue, with 3.9.1 (3.9.0 too) it hangs right after seabios... (no problem in 3.8.11) qemu-1.4.1 seabios-1.7.2.1 after setting emulate_invalid_guest_state=0 everything works just fine. virsh # qemu-monitor-command vm-jack --hmp x/8i \$pc 0x000fc46b: lgdtw %cs:-0x2c60

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 11:22:01AM +, Tomas Papan wrote: I have the same issue, with 3.9.1 (3.9.0 too) it hangs right after seabios... (no problem in 3.8.11) qemu-1.4.1 seabios-1.7.2.1 Is there anything interesting in libvirt logfile? Also please send the output of

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
Hi, I found this in the libvirt (but those messages are same in 3.8.x) anakin libvirt # cat libvirtd.log 2013-05-08 11:59:29.645+: 3750: info : libvirt version: 1.0.5 2013-05-08 11:59:29.645+: 3750: error : udevGetDMIData:1548 : Failed to get udev device for syspath

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 02:08:55PM +0200, Tomas Papan wrote: Hi, I found this in the libvirt (but those messages are same in 3.8.x) anakin libvirt # cat libvirtd.log 2013-05-08 11:59:29.645+: 3750: info : libvirt version: 1.0.5 2013-05-08 11:59:29.645+: 3750: error :

Re: Kernel 3.9 - can't boot qemu with accel=kvm _and_ networking enabled

2013-05-08 Thread Vladimir
Here they are: (qemu) x/8i $pc 0x000fc49b: lgdtw %cs:-0x2c60 0x000fc4a1: mov%cr0,%eax 0x000fc4a4: or $0x1,%eax 0x000fc4a8: mov%eax,%cr0 0x000fc4ab: ljmpl $0x8,$0xfc4b3 0x000fc4b3: mov$0x10,%ax 0x000fc4b6: add

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
Hi, No nothing, I check all logs (even syslog) 1) virsh # qemu-monitor-command vm-jack --hmp info status VM status: running 2) morpheus@anakin ~ $ ps aux | grep vm-jack qemu 3822 0.5 0.1 8952256 23600 ? Sl 13:59 0:08 /usr/bin/qemu-system-x86_64 -machine accel=kvm -name vm-jack

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Daniel P. Berrange
On Wed, May 08, 2013 at 02:08:55PM +0200, Tomas Papan wrote: Hi, I found this in the libvirt (but those messages are same in 3.8.x) anakin libvirt # cat libvirtd.log 2013-05-08 11:59:29.645+: 3750: info : libvirt version: 1.0.5 2013-05-08 11:59:29.645+: 3750: error :

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
Sorry, I didn't write that well, I checked that log too... nothing is there... anakin qemu # cat vm-jack.log 2013-05-08 13:02:52.358+: starting up LC_ALL=C PATH=/bin:/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin HOME=/root USER=root

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 02:51:48PM +0200, Tomas Papan wrote: Hi, No nothing, I check all logs (even syslog) Yeah, since status of the vm is running you are not suppose to see there anything. 1) virsh # qemu-monitor-command vm-jack --hmp info status VM status: running 2) morpheus@anakin

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
Ok, the cpu stays at 0% when it hangs, there is only one 100% cpu peak which happens when the vm starts ( I think this is quite normal). However I run following command, and I stop it right when it hangs: anakin trace2 # virsh start vm-jack; pid=`virsh qemu-monitor-command vm-jack --hmp info cpus

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 03:50:47PM +0200, Tomas Papan wrote: Ok, the cpu stays at 0% when it hangs, there is only one 100% cpu peak which happens when the vm starts ( I think this is quite normal). However I run following command, and I stop it right when it hangs: anakin trace2 # virsh

Re: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
-- 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: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Tomas Papan
patch is working :) Thank you very much Gleb. Regards Tomas -- 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: kernel 3.9.x kvm hangs after seabios

2013-05-08 Thread Gleb Natapov
On Wed, May 08, 2013 at 04:52:52PM +0200, Tomas Papan wrote: patch is working :) Thank you very much Gleb. Thank you for your patience. Curious but it was. -- Gleb. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[PATCH] KVM: VMX: fix halt emulation while emulating invalid guest sate

2013-05-08 Thread Gleb Natapov
The invalid guest state emulation loop does not check halt_request which causes 100% cpu loop while guest is in halt and in invalid state, but more serious issue is that this leaves halt_request set, so random instruction emulated by vm86 #GP exit can be interpreted as halt which causes guest

Re: VFIO VGA test branches

2013-05-08 Thread Alex Williamson
A few notes for anyone trying this... * I recommend the q35 machine type and using the default config file found in the docs directory. This means your command line should include: -M q35 -nodefconfig -readconfig /path/to/qemu.git/docs/q35-chipset.cfg *

Re: [PATCH] KVM: VMX: fix halt emulation while emulating invalid guest sate

2013-05-08 Thread Paolo Bonzini
- Messaggio originale - Da: Gleb Natapov g...@redhat.com A: kvm@vger.kernel.org Cc: pbonz...@redhat.com, sta...@vger.kernel.org Inviato: Mercoledì, 8 maggio 2013 17:38:44 Oggetto: [PATCH] KVM: VMX: fix halt emulation while emulating invalid guest sate The invalid guest state

Re: Problems while booting a linux system on fast models based CortexA15

2013-05-08 Thread Christoffer Dall
On Wed, May 8, 2013 at 12:07 AM, Mai Daftedar mai.dafte...@gmail.com wrote: Dear All, I am facing a problem with booting a fully working Linux system on the Fast Models based Cortex-A15 simulation platform. I'm using the KVM on ARM guide to configure KVM on the ARM fast models with

[PATCH v3 01/13] nEPT: Support LOAD_IA32_EFER entry/exit controls for L1

2013-05-08 Thread Jun Nakajima
Recent KVM, since http://kerneltrap.org/mailarchive/linux-kvm/2010/5/2/6261577 switch the EFER MSR when EPT is used and the host and guest have different NX bits. So if we add support for nested EPT (L1 guest using EPT to run L2) and want to be able to run recent KVM as L1, we need to allow L1 to

[PATCH v3 02/13] nEPT: Move gpte_access() and prefetch_invalid_gpte() to paging_tmpl.h

2013-05-08 Thread Jun Nakajima
For preparation, we just move gpte_access() and prefetch_invalid_gpte() from mmu.c to paging_tmpl.h. Signed-off-by: Nadav Har'El n...@il.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com --- arch/x86/kvm/mmu.c | 30

[PATCH v3 03/13] nEPT: Add EPT tables support to paging_tmpl.h

2013-05-08 Thread Jun Nakajima
This is the first patch in a series which adds nested EPT support to KVM's nested VMX. Nested EPT means emulating EPT for an L1 guest so that L1 can use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its own page faults without either of L0

[PATCH v3 04/13] nEPT: Define EPT-specific link_shadow_page()

2013-05-08 Thread Jun Nakajima
Since link_shadow_page() is used by a routine in mmu.c, add an EPT-specific link_shadow_page() in paging_tmp.h, rather than moving it. Signed-off-by: Nadav Har'El n...@il.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com ---

[PATCH v3 05/13] nEPT: MMU context for nested EPT

2013-05-08 Thread Jun Nakajima
KVM's existing shadow MMU code already supports nested TDP. To use it, we need to set up a new MMU context for nested EPT, and create a few callbacks for it (nested_ept_*()). This context should also use the EPT versions of the page table access functions (defined in the previous patch). Then, we

[PATCH v3 06/13] nEPT: Fix cr3 handling in nested exit and entry

2013-05-08 Thread Jun Nakajima
The existing code for handling cr3 and related VMCS fields during nested exit and entry wasn't correct in all cases: If L2 is allowed to control cr3 (and this is indeed the case in nested EPT), during nested exit we must copy the modified cr3 from vmcs02 to vmcs12, and we forgot to do so. This

[PATCH v3 07/13] nEPT: Fix wrong test in kvm_set_cr3

2013-05-08 Thread Jun Nakajima
kvm_set_cr3() attempts to check if the new cr3 is a valid guest physical address. The problem is that with nested EPT, cr3 is an *L2* physical address, not an L1 physical address as this test expects. As the comment above this test explains, it isn't necessary, and doesn't correspond to anything

[PATCH v3 08/13] nEPT: Some additional comments

2013-05-08 Thread Jun Nakajima
Some additional comments to preexisting code: Explain who (L0 or L1) handles EPT violation and misconfiguration exits. Don't mention shadow on either EPT or shadow as the only two options. Signed-off-by: Nadav Har'El n...@il.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com

[PATCH v3 09/13] nEPT: Advertise EPT to L1

2013-05-08 Thread Jun Nakajima
Advertise the support of EPT to the L1 guest, through the appropriate MSR. This is the last patch of the basic Nested EPT feature, so as to allow bisection through this patch series: The guest will not see EPT support until this last patch, and will not attempt to use the half-applied feature.

[PATCH v3 10/13] nEPT: Nested INVEPT

2013-05-08 Thread Jun Nakajima
If we let L1 use EPT, we should probably also support the INVEPT instruction. In our current nested EPT implementation, when L1 changes its EPT table for L2 (i.e., EPT12), L0 modifies the shadow EPT table (EPT02), and in the course of this modification already calls INVEPT. Therefore, when L1

[PATCH v3 11/13] nEPT: Miscelleneous cleanups

2013-05-08 Thread Jun Nakajima
Some trivial code cleanups not really related to nested EPT. Signed-off-by: Nadav Har'El n...@il.ibm.com Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- arch/x86/kvm/vmx.c | 6 ++ 1 file

[PATCH v3 12/13] nEPT: Move is_rsvd_bits_set() to paging_tmpl.h

2013-05-08 Thread Jun Nakajima
Move is_rsvd_bits_set() to paging_tmpl.h so that it can be used to check reserved bits in EPT page table entries as well. Signed-off-by: Jun Nakajima jun.nakaj...@intel.com Signed-off-by: Xinhao Xu xinhao...@intel.com --- arch/x86/kvm/mmu.c | 8 arch/x86/kvm/paging_tmpl.h | 12

[PATCH v3 13/13] nEPT: Inject EPT violation/misconfigration

2013-05-08 Thread Jun Nakajima
Add code to detect EPT misconfiguration and inject it to L1 VMM. Also, it injects more correct exit qualification upon EPT violation to L1 VMM. Now L1 can correctly go to ept_misconfig handler (instead of wrongly going to fast_page_fault), it will try to handle mmio page fault, if failed, it is a

Re: [PATCH] kvm/ppc: interrupt disabling fixes

2013-05-08 Thread Benjamin Herrenschmidt
On Wed, 2013-05-08 at 19:35 -0500, Scott Wood wrote: Sigh, and then there's this: #ifdef CONFIG_PPC64 /* lazy EE magic */ hard_irq_disable(); if (lazy_irq_pending()) { /* Got an interrupt in between, try again */

Re: [v1][KVM][PATCH 1/1] kvm:ppc:booehv: direct ISI exception to Guest

2013-05-08 Thread tiejun.chen
On 05/08/2013 05:20 PM, Caraman Mihai Claudiu-B02008 wrote: -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of tiejun.chen Sent: Wednesday, May 08, 2013 4:54 AM To: Wood Scott-B07421 Cc: ag...@suse.de; kvm-ppc@vger.kernel.org;

Re: [PATCH] kvm/ppc: interrupt disabling fixes

2013-05-08 Thread Benjamin Herrenschmidt
On Wed, 2013-05-08 at 19:35 -0500, Scott Wood wrote: Sigh, and then there's this: #ifdef CONFIG_PPC64 /* lazy EE magic */ hard_irq_disable(); if (lazy_irq_pending()) { /* Got an interrupt in between, try again */