Re: Bug inkvm_set_irq

2011-03-04 Thread Jean-Philippe Menil
Le 03/03/2011 16:55, Michael S. Tsirkin a écrit : On Thu, Mar 03, 2011 at 04:26:11PM +0100, Jean-Philippe Menil wrote: Le 03/03/2011 15:47, Michael S. Tsirkin a écrit : On Tue, Mar 01, 2011 at 03:39:12PM +0100, Jean-Philippe Menil wrote: so this time the bug is: [17882.612303] BUG: unable to

Re: Bug inkvm_set_irq

2011-03-04 Thread Michael S. Tsirkin
On Fri, Mar 04, 2011 at 10:22:03AM +0100, Jean-Philippe Menil wrote: > Le 03/03/2011 16:55, Michael S. Tsirkin a écrit : > >On Thu, Mar 03, 2011 at 04:26:11PM +0100, Jean-Philippe Menil wrote: > >>Le 03/03/2011 15:47, Michael S. Tsirkin a écrit : > >>>On Tue, Mar 01, 2011 at 03:39:12PM +0100, Jean-

Re: Bug inkvm_set_irq

2011-03-04 Thread Jean-Philippe Menil
Le 04/03/2011 10:35, Michael S. Tsirkin a écrit : On Fri, Mar 04, 2011 at 10:22:03AM +0100, Jean-Philippe Menil wrote: Le 03/03/2011 16:55, Michael S. Tsirkin a écrit : On Thu, Mar 03, 2011 at 04:26:11PM +0100, Jean-Philippe Menil wrote: Le 03/03/2011 15:47, Michael S. Tsirkin a écrit : On Tu

[PATCH 14/15] kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit

2011-03-04 Thread Jan Kiszka
There are no generic bits remaining in the handling of KVM_EXIT_DEBUG. So push its logic completely into arch hands, i.e. only x86 so far. Signed-off-by: Jan Kiszka --- kvm-all.c | 11 --- kvm.h |2 -- target-i386/kvm.c | 25 - 3 files

[PATCH 04/15] kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle

2011-03-04 Thread Jan Kiszka
With in-kernel irqchip support enabled, the vcpu threads sleep in kernel space while halted. Account for this difference in cpu_thread_is_idle. Signed-off-by: Jan Kiszka --- cpus.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index 0f33945..66f6b5a 1

[PATCH 03/15] kvm: Install optimized interrupt handlers

2011-03-04 Thread Jan Kiszka
KVM only requires to set the raised IRQ in CPUState and, if the user space irqchip is used, to kick the receiving vcpu if it is remote. Signed-off-by: Jan Kiszka --- kvm-all.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 22

[PATCH 06/15] kvm: Mark VCPU state dirty on creation

2011-03-04 Thread Jan Kiszka
This avoids that early cpu_synchronize_state calls try to retrieve an uninitialized state from the kernel. That even causes a deadlock if io-thread is enabled. Signed-off-by: Jan Kiszka --- kvm-all.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c i

[PATCH 11/15] kvm: Rework inner loop of kvm_cpu_exec

2011-03-04 Thread Jan Kiszka
Let kvm_cpu_exec return EXCP_* values consistently and generate those codes already inside its inner loop. This means we will now re-enter the kernel while ret == 0. Update kvm_handle_internal_error accordingly, but keep kvm_arch_handle_exit untouched, it will be converted in a separate step. Sig

[PATCH 07/15] x86: Properly reset PAT MSR

2011-03-04 Thread Jan Kiszka
Conforming to the Intel spec, set the power-on value of PAT also on reset, but save it across INIT. Signed-off-by: Jan Kiszka --- target-i386/cpu.h|4 ++-- target-i386/cpuid.c |1 - target-i386/helper.c |5 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tar

[PATCH 15/15] Expose thread_id in info cpus

2011-03-04 Thread Jan Kiszka
Based on patch by Glauber Costa: To allow management applications like libvirt to apply CPU affinities to the VCPU threads, expose their ID via info cpus. This patch provides the pre-existing and used interface from qemu-kvm. Signed-off-by: Jan Kiszka --- cpu-defs.h |1 + cpus.c

[PATCH 13/15] kvm: x86: Reorder functions in kvm.c

2011-03-04 Thread Jan Kiszka
Required for next patch which will access guest debug services from kvm_arch_handle_exit. No functional changes. Signed-off-by: Jan Kiszka --- target-i386/kvm.c | 108 ++-- 1 files changed, 54 insertions(+), 54 deletions(-) diff --git a/target-i3

[PATCH 08/15] x86: Save/restore PAT MSR

2011-03-04 Thread Jan Kiszka
Signed-off-by: Jan Kiszka --- target-i386/machine.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-i386/machine.c b/target-i386/machine.c index d78eceb..6384f54 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -491,6 +491,8 @@ static const VMStat

[PATCH 02/15] Redirect cpu_interrupt to callback handler

2011-03-04 Thread Jan Kiszka
This allows to override the interrupt handling of QEMU in system mode. KVM will make use of it to set optimized handlers. Signed-off-by: Jan Kiszka --- cpu-all.h | 14 +- exec.c|4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cpu-all.h b/cpu-all.h in

[PATCH 09/15] kvm: x86: Synchronize PAT MSR with the kernel

2011-03-04 Thread Jan Kiszka
Signed-off-by: Jan Kiszka --- target-i386/kvm.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 6efa491..bfc8d66 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -861,6 +861,7 @@ static int kvm_put_msrs(CPUState *en

[PATCH 05/15] kvm: x86: Do not leave halt if interrupts are disabled

2011-03-04 Thread Jan Kiszka
When an external interrupt is pending but IF is cleared, we must not leave the halt state prematurely. Signed-off-by: Jan Kiszka --- target-i386/kvm.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7b7105d..6efa491 100644 -

[PATCH 00/15] [uq/master] Patch queue, part V (the rest)

2011-03-04 Thread Jan Kiszka
This series catches "all the rest" to prepare QEMU's KVM support for merging with qemu-kvm. IOW, once these bits here are applied, qemu-kvm can switch its infrastructure to upstream and is effectively only adding own bits for in-kernel irqchip and device assignment support. Topics of this series a

[PATCH 12/15] kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes

2011-03-04 Thread Jan Kiszka
Make the return code of kvm_arch_handle_exit directly usable for kvm_cpu_exec. This is straightforward for x86 and ppc, just s390 would require more work. Avoid this for now by pushing the return code translation logic into s390's kvm_arch_handle_exit. Signed-off-by: Jan Kiszka CC: Alexander Graf

[PATCH 10/15] kvm: Consider EXIT_DEBUG unknown without CAP_SET_GUEST_DEBUG

2011-03-04 Thread Jan Kiszka
Without KVM_CAP_SET_GUEST_DEBUG, we neither motivate the kernel to report KVM_EXIT_DEBUG nor do we expect such exits. So fall through to the arch code which will simply report an unknown exit reason. Signed-off-by: Jan Kiszka --- kvm-all.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletio

[PATCH 01/15] Break up user and system cpu_interrupt implementations

2011-03-04 Thread Jan Kiszka
Both have only two lines in common, and we will convert the system service into a callback which is of no use for user mode operation. Signed-off-by: Jan Kiszka CC: Riku Voipio --- exec.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c inde

[PATCH 1/10] KVM: MMU: fix kvm_mmu_slot_remove_write_access

2011-03-04 Thread Xiao Guangrong
Only remove write access in the last sptes Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b6a9963..b9bf016 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c

[PATCH 2/10] KVM: MMU: fix kvm_mmu_get_spte_hierarchy

2011-03-04 Thread Xiao Guangrong
Don not walk to the next level if spte is mapping to the large page Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b9bf016..10e0982 100644 --- a/arch/x86/kvm/mmu.c +++ b

[PATCH 3/10] KVM: MMU: set spte accessed bit properly

2011-03-04 Thread Xiao Guangrong
Set spte accessed bit only if guest_initiated == 1 that means the really accessed Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 10e0982..6e9cb35 100644 --- a/arch/x86/kv

[PATCH 4/10] KVM: fix rcu usage in init_rmode_* functions

2011-03-04 Thread Xiao Guangrong
fix: [ 3494.671786] stack backtrace: [ 3494.671789] Pid: 10527, comm: qemu-system-x86 Not tainted 2.6.38-rc6+ #23 [ 3494.671790] Call Trace: [ 3494.671796] [] ? lockdep_rcu_dereference+0x9d/0xa5 [ 3494.671826] [] ? kvm_memslots+0x6b/0x73 [kvm] [ 3494.671834] [] ? gfn_to_memslot+0x16/0x4f [kvm] [

[PATCH 5/10] KVM: MMU: move mmu pages calculated out of mmu lock

2011-03-04 Thread Xiao Guangrong
kvm_mmu_calculate_mmu_pages need to walk all memslots and it's protected by kvm->slots_lock, so move it out of mmu spinlock Signed-off-by: Xiao Guangrong --- arch/x86/kvm/x86.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86

[PATCH 6/10] KVM: MMU: don not record gfn in kvm_mmu_pte_write

2011-03-04 Thread Xiao Guangrong
No need to record the gfn to verifier the pte has the same mode as current vcpu, it's because we only speculatively update the pte only if the pte and vcpu have the same mode Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h |1 - arch/x86/kvm/mmu.c |6 ++

[PATCH 7/10] KVM: MMU: introduce a common function to get no-dirty-logged slot

2011-03-04 Thread Xiao Guangrong
pte_prefetch_gfn_to_memslot and mapping_level_dirty_bitmap have the same operation, so integrated Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 26 ++ 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

[PATCH 8/10] KVM: MMU: cleanup page alloc and free

2011-03-04 Thread Xiao Guangrong
Using __get_free_page instead of alloc_page and page_address, using free_page instead of __free_page and virt_to_page Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c ind

[PATCH 9/10] KVM: MMU: remove unused macros

2011-03-04 Thread Xiao Guangrong
These macros are not used, so removed Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c |5 - arch/x86/kvm/paging_tmpl.h |3 --- 2 files changed, 0 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 7d558b8..54a2ead 100644 --- a/arch/

[PATCH 10/10] KVM: cleanup memslot_id function

2011-03-04 Thread Xiao Guangrong
We can get memslot id from memslot->id directly Signed-off-by: Xiao Guangrong --- include/linux/kvm_host.h |7 ++- virt/kvm/kvm_main.c | 17 - 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index

when use sriov, guest os could not access the vf device assigned

2011-03-04 Thread lidong chen
guest os could not access the vf assigned ,and print this error message . PCI: device :00:06.0 has unknown header type 7f, ignoring. PCI: device :00:07.0 has unknown header type 7f, ignoring. PCI: device :00:08.0 has unknown header type 7f, ignoring. the reason is the config file /sys/

[ANNOUNCE] kvm-kmod-2.6.38-rc7

2011-03-04 Thread Jan Kiszka
We are approaching 2.6.38, so it's time to role out a preview on its kvm bits: http://sourceforge.net/projects/kvm/files/kvm-kmod/2.6.38-rc7/kvm-kmod-2.6.38-rc7.tar.bz2/download No big news in this release (async page faults require a 2.6.38 host kernel), but many small improvements. Major KVM c

Re: [PATCH 4/10] KVM: fix rcu usage in init_rmode_* functions

2011-03-04 Thread Jan Kiszka
On 2011-03-04 11:58, Xiao Guangrong wrote: > fix: > [ 3494.671786] stack backtrace: > [ 3494.671789] Pid: 10527, comm: qemu-system-x86 Not tainted 2.6.38-rc6+ #23 > [ 3494.671790] Call Trace: > [ 3494.671796] [] ? lockdep_rcu_dereference+0x9d/0xa5 > [ 3494.671826] [] ? kvm_memslots+0x6b/0x73 [kvm

Re: [PATCH 0/3] [RFC] Implement multiqueue (RX & TX) virtio-net

2011-03-04 Thread Krishna Kumar2
Andrew Theurer wrote on 03/04/2011 12:31:24 AM: Hi Andrew, > > ___ > > TCP: Guest -> Local Host (TCP_STREAM) > > TCP: Local Host -> Guest (TCP_MAERTS) > > UDP: Local Host -> Guest (UD

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Zachary Amsden
On 03/03/2011 05:01 PM, Nikola Ciprich wrote: That sounds like a kernel which will be vulnerable to broken KVM clock on 32-bit. There's a kernel side fix that is needed, but why the server side change triggers the problem needs more investigation. OK, it's important for me that I can fix

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Nikola Ciprich
Hello Zachary, > You don't see any messages about TSC being unstable or switching > clocksource after loading the KVM module? And you are not suspending > the host or anything? no messages, no suspending, nothing. > Can you try using "processor.max_cstate=1" on the host as a kernel > para

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Glauber Costa
On Fri, 2011-03-04 at 19:27 +0100, Nikola Ciprich wrote: > Hello Zachary, > > > You don't see any messages about TSC being unstable or switching > > clocksource after loading the KVM module? And you are not suspending > > the host or anything? > no messages, no suspending, nothing. > > > >

[Bug 29232] [VT-d] VT-d device passthrough fail to guest

2011-03-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=29232 Florian Mickler changed: What|Removed |Added Status|NEW |RESOLVED Resolution|

[Bug 29232] [VT-d] VT-d device passthrough fail to guest

2011-03-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=29232 Florian Mickler changed: What|Removed |Added Status|RESOLVED|CLOSED -- Configure bugmail: https

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Nikola Ciprich
> Zach, > > I don't understand 100 % the logic behind all your tsc changes. > But kvm-clock-wise, most of the problems we had in the past were related > to the difference in resolution between the tsc and the host clocksource > (hpet, acpi_pm, etc), which in his case, it is a non-issue. > > It do

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Glauber Costa
On Fri, 2011-03-04 at 21:55 +0100, Nikola Ciprich wrote: > > Zach, > > > > I don't understand 100 % the logic behind all your tsc changes. > > But kvm-clock-wise, most of the problems we had in the past were related > > to the difference in resolution between the tsc and the host clocksource > > (

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Nikola Ciprich
> > I think although the long term plan is to just do this update once in > your case (stable tsc), this update is needed. > > Why don't you send a patch to re-include it ? > Yes, I'll gladly submit patch, one question, is this OK to just add calling kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu)

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Zachary Amsden
On 03/04/2011 02:09 PM, Glauber Costa wrote: On Fri, 2011-03-04 at 19:27 +0100, Nikola Ciprich wrote: Hello Zachary, You don't see any messages about TSC being unstable or switching clocksource after loading the KVM module? And you are not suspending the host or anything? n

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Zachary Amsden
On 03/04/2011 05:36 PM, Nikola Ciprich wrote: I think although the long term plan is to just do this update once in your case (stable tsc), this update is needed. Why don't you send a patch to re-include it ? Yes, I'll gladly submit patch, one question, is this OK to just add calling kvm

Re: when use sriov, guest os could not access the vf device assigned

2011-03-04 Thread Chris Wright
* lidong chen (chen.lidong.ker...@gmail.com) wrote: > guest os could not access the vf assigned ,and print this error message . > PCI: device :00:06.0 has unknown header type 7f, ignoring. > PCI: device :00:07.0 has unknown header type 7f, ignoring. > PCI: device :00:08.0 has unknown he

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Zachary Amsden
On 03/04/2011 05:36 PM, Nikola Ciprich wrote: I think although the long term plan is to just do this update once in your case (stable tsc), this update is needed. Why don't you send a patch to re-include it ? Yes, I'll gladly submit patch, one question, is this OK to just add calling kvm

[PATCH] KVM: x86: Remove useless regs_page pointer from kvm_lapic

2011-03-04 Thread Takuya Yoshikawa
From: Takuya Yoshikawa Access to this page is mostly done through the regs member which holds the address to this page. The exceptions are in vmx_vcpu_reset() and kvm_free_lapic() and these both can easily be converted to using regs. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/lapic.c |

Re: regression - 2.6.36 -> 2.6.37 - kvm - 32bit SMP guests don't boot

2011-03-04 Thread Nikola Ciprich
> > Can you try this patch to see if it fixes the problem? You haven't read my replies, did you? ;-) kvm_request_guest_time_update seems to have been removed, and kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu) seems to be used instead, adding it fixes the problem. That's what I was going to use in t