Re: [kvm-devel] Use host CPUID processor info

2007-07-08 Thread Avi Kivity
Dong, Eddie wrote: > Use host cpu model name, type, family, Model, stepping for guest. > > Against head. > > This is turning into a mix of the qemu cpuid and the host cpuid. We need to think of a way to make this controllable. > Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]> > > diff

Re: [kvm-devel] kvm-27 vs 28 I/O speed

2007-07-08 Thread Avi Kivity
Dave Hansen wrote: > I've noticed that some of my tests run *MUCH* slower in kvm-28 than in > 27. I'm sure that wall time is pretty wonky in the guests, but it is > much slower in real-world time as well. > > Here's a little test to create a 32MB zeroed file with dd. Here it is > from kvm-27 (thi

Re: [kvm-devel] In kernel PIC support: kernel patch

2007-07-08 Thread Avi Kivity
Dong, Eddie wrote: > Avi Kivity wrote: > >> Merged both into the 'lapic2' branch. Got the following oops running >> Windows (i386 on Intel): >> >> > > Avi: > This one should fixed the bug. > Against lapic2 dc03e1b70198e0e4aadfc9063399590fa42cf55e. > thx,eddie > > Destroy io b

Re: [kvm-devel] [PATCH] make kvm service script use dhclient config

2007-07-08 Thread Dor Laor
>Hi list, > >in order to make the kvm service script work with DHCP on FC6 I had to >apply the following patch. Hope it's useful :-) > > >Ferry > > > >--- kvm 2007-06-07 17:13:47.0 +0200 >+++ /etc/init.d/kvm 2007-07-05 21:06:43.0 +0200 >@@ -132,7 +132,7 @@ >pgrep dhc

Re: [kvm-devel] [PATCH] make kvm service script use dhclient config

2007-07-08 Thread Ferry Huberts
Dor Laor wrote: >> Hi list, >> >> in order to make the kvm service script work with DHCP on FC6 I had to >> apply the following patch. Hope it's useful :-) >> >> >> Ferry >> >> >> >> --- kvm 2007-06-07 17:13:47.0 +0200 >> +++ /etc/init.d/kvm 2007-07-05 21:06:43.0 +0200 >> @@ -13

[kvm-devel] bug concering Solaris ?

2007-07-08 Thread Adrian Lambeck
I have question concerning solaris as a guest system. Windows XP and Linux are up and running without problems. Now I would like to us Solaris10 for x86 too. I downloaded the ISO image and validated the MD5 checksum but when I start QEMU with "boot d" and -cdrom="location of the DVD image", QEMU

[kvm-devel] [PATCH 02/20] KVM: Implement emulation of instruction "ret" (opcode 0xc3)

2007-07-08 Thread Avi Kivity
From: Nitin A Kamble <[EMAIL PROTECTED]> Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/x86_emulate.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_em

[kvm-devel] [PATCH 01/20] KVM: Implement emulation of "pop reg" instruction (opcode 0x58-0x5f)

2007-07-08 Thread Avi Kivity
From: Nitin A Kamble <[EMAIL PROTECTED]> For use in real mode. Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/x86_emulate.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/x86_e

[kvm-devel] [PATCH 00/20] KVM updates for 2.6.23, part 2

2007-07-08 Thread Avi Kivity
This is the second set of updates for the 2.6.23 merge window. This time around, the patchset includes the cpu hotplug fixes (which also make suspend and resume robust in the presence of running virtual machines). Also included are a few fixes and core updates. Avi Kivity (11): KVM: VMX: Re

[kvm-devel] [PATCH 05/20] KVM: Add support for in-kernel pio handlers

2007-07-08 Thread Avi Kivity
From: Eddie Dong <[EMAIL PROTECTED]> Useful for the PIC and PIT. Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm.h |5 - drivers/kvm/kvm_main.c | 33 + 2 files changed, 37 inser

[kvm-devel] [PATCH 04/20] KVM: VMX: Fix interrupt checking on lightweight exit

2007-07-08 Thread Avi Kivity
From: Gregory Haskins <[EMAIL PROTECTED]> With kernel-injected interrupts, we need to check for interrupts on lightweight exits too. Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/vmx.c |6 +++--- 1 files changed, 3 insertions

[kvm-devel] [PATCH 11/20] KVM: SVM: Reliably detect if SVM was disabled by BIOS

2007-07-08 Thread Avi Kivity
From: Joerg Roedel <[EMAIL PROTECTED]> This patch adds an implementation to the svm is_disabled function to detect reliably if the BIOS disabled the SVM feature in the CPU. This fixes the issues with kernel panics when loading the kvm-amd module on machines where SVM is available but disabled. Si

[kvm-devel] [PATCH 03/20] KVM: Adds support for in-kernel mmio handlers

2007-07-08 Thread Avi Kivity
From: Gregory Haskins <[EMAIL PROTECTED]> Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm.h | 60 ++ drivers/kvm/kvm_main.c | 94 +-- 2 files chang

[kvm-devel] [PATCH 14/20] HOTPLUG: Add CPU_DYING notifier

2007-07-08 Thread Avi Kivity
KVM wants a notification when a cpu is about to die, so it can disable hardware extensions, but at a time when user processes cannot be scheduled on the cpu, so it doesn't try to use virtualization extensions after they have been disabled. This adds a CPU_DYING notification. The notification is c

[kvm-devel] [PATCH 10/20] KVM: VMX: Remove unnecessary code in vmx_tlb_flush()

2007-07-08 Thread Avi Kivity
A vmexit implicitly flushes the tlb; the code is bogus. Noted by Shaohua Li. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/vmx.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 42a9163..7d04ffa 100644 --- a/driv

[kvm-devel] [PATCH 12/20] KVM: Remove kvmfs in favor of the anonymous inodes source

2007-07-08 Thread Avi Kivity
kvm uses a pseudo filesystem, kvmfs, to generate inodes, a job that the new anonymous inodes source does much better. Cc: Davide Libenzi <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c | 143 fs/anon_in

[kvm-devel] [PATCH 07/20] KVM: Avoid useless memory write when possible

2007-07-08 Thread Avi Kivity
From: Luca Tettamanti <[EMAIL PROTECTED]> When writing to normal memory and the memory area is unchanged the write can be safely skipped, avoiding the costly kvm_mmu_pte_write. Signed-Off-By: Luca Tettamanti <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_ma

[kvm-devel] [PATCH 09/20] KVM: MMU: Fix Wrong tlb flush order

2007-07-08 Thread Avi Kivity
From: Shaohua Li <[EMAIL PROTECTED]> Need to flush the tlb after updating a pte, not before. Signed-off-by: Shaohua Li <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/mmu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/mmu

[kvm-devel] [PATCH 19/20] KVM: Tune hotplug/suspend IPIs

2007-07-08 Thread Avi Kivity
The hotplug IPIs can be called from the cpu on which we are currently running on, so use on_cpu(). Similarly, drop on_each_cpu() for the suspend/resume callbacks, as we're in atomic context here and only one cpu is up anyway. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main

[kvm-devel] [PATCH 17/20] SMP: Implement on_cpu()

2007-07-08 Thread Avi Kivity
This defines on_cpu() which is similar to smp_call_function_single() except that it works if cpu happens to be the current cpu. Can also be seen as a complement to on_each_cpu() (which also doesn't treat the current cpu specially). Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- include/linux/

[kvm-devel] [PATCH 15/20] HOTPLUG: Adapt cpuset hotplug callback to CPU_DYING

2007-07-08 Thread Avi Kivity
CPU_DYING is called in atomic context, so don't try to take any locks. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- kernel/cpuset.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4c49188..c4d123f 100644 --- a/kernel/cpuset.c

[kvm-devel] [PATCH 08/20] KVM: VMX: Reinitialize the real-mode tss when entering real mode

2007-07-08 Thread Avi Kivity
Protected mode code may have corrupted the real-mode tss, so re-initialize it when switching to real mode. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/vmx.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index b4

[kvm-devel] [PATCH 06/20] KVM: Fix x86 emulator writeback

2007-07-08 Thread Avi Kivity
From: Luca Tettamanti <[EMAIL PROTECTED]> When the old value and new one are the same the emulator skips the write; this is undesirable when the destination is a MMIO area and the write shall be performed regardless of the previous value. This optimization breaks e.g. a Linux guest APIC compiled w

[kvm-devel] [PATCH 18/20] KVM: Keep track of which cpus have virtualization enabled

2007-07-08 Thread Avi Kivity
By keeping track of which cpus have virtualization enabled, we prevent double-enable or double-disable during hotplug, which is a very fatal oops. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c | 45 + 1 files changed, 33 ins

[kvm-devel] [PATCH 16/20] HOTPLUG: Adapt thermal throttle to CPU_DYING

2007-07-08 Thread Avi Kivity
CPU_DYING is notified in atomic context, so no taking mutexes here. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- arch/i386/kernel/cpu/mcheck/therm_throt.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kern

[kvm-devel] [PATCH 13/20] KVM: Clean up #includes

2007-07-08 Thread Avi Kivity
Remove unnecessary ones, and rearange the remaining in the standard order. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c | 18 +++--- drivers/kvm/mmu.c | 10 ++ drivers/kvm/svm.c |7 --- drivers/kvm/vmx.c |5 +++-- 4 fi

[kvm-devel] [PATCH 20/20] KVM: Use CPU_DYING for disabling virtualization

2007-07-08 Thread Avi Kivity
Only at the CPU_DYING stage can we be sure that no user process will be scheduled onto the cpu and oops when trying to use virtualization extensions. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [kvm-devel] bug concering Solaris ?

2007-07-08 Thread Avi Kivity
Adrian Lambeck wrote: > I have question concerning solaris as a guest system. Windows XP and > Linux are up and running without problems. > Now I would like to us Solaris10 for x86 too. I downloaded the ISO image > and validated the MD5 checksum but when I start QEMU with "boot d" and > -cdrom="

Re: [kvm-devel] [PATCH 09/20] KVM: MMU: Fix Wrong tlb flush order

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > From: Shaohua Li <[EMAIL PROTECTED]> > > Need to flush the tlb after updating a pte, not before. > rmap_remove(vcpu, spte); > - kvm_flush_remote_tlbs(vcpu->kvm); > set_shadow_pte(spte, *spte & ~PT_WRITABLE_MASK);

Re: [kvm-devel] [PATCH 09/20] KVM: MMU: Fix Wrong tlb flush order

2007-07-08 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >> From: Shaohua Li <[EMAIL PROTECTED]> >> >> Need to flush the tlb after updating a pte, not before. >> > > >> rmap_remove(vcpu, spte); >> -kvm_flush_remote_tlbs(vcpu->kvm); >> set_sha

[kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Intel VT essentially introduces a new set of registers into the processor; this means we cannot preempt kvm in kernel mode lest a new VM run with and old VM's registers. In addition, kvm lazy switches some host registers as well. (AMD does not introduce new registers, but we still want lazy msr sw

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > Intel VT essentially introduces a new set of registers into the > processor; this means we cannot preempt kvm in kernel mode lest a new > VM run with and old VM's registers. In addition, kvm lazy switches > some host registers as well. (AMD does not i

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >> Intel VT essentially introduces a new set of registers into the >> processor; this means we cannot preempt kvm in kernel mode lest a new >> VM run with and old VM's registers. In addition, kvm lazy switches >> some host regi

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > +#ifdef CONFIG_SCHED_KVM > +static __read_mostly struct sched_kvm_hooks kvm_hooks; > +#endif please just add a current->put_vcpu() function pointer instead of this hooks thing. > static inline void prepare_task_switch(struct rq *rq, struct task_struct

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > > hm, why not do what i have in -rt? See the patch below. Seems to > > work fine for me, although i might be missing something. > > How can this work with >1 VM? We need to execute vmptrld with the new > VM's vmcs before touching any VT registers. ye

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > >> +#ifdef CONFIG_SCHED_KVM >> +static __read_mostly struct sched_kvm_hooks kvm_hooks; >> +#endif >> > > please just add a current->put_vcpu() function pointer instead of this > hooks thing. > > Won't that increase task_s

Re: [kvm-devel] [PATCH 11/20] KVM: SVM: Reliably detect if SVM was disabled by BIOS

2007-07-08 Thread Roland Dreier
seems like we probably want this for 2.6.22... it fixes a panic that I've seen actually reported by several users. Is there any risk to merging it? i guess getting it into 2.6.22.1 would be OK too. - This SF.net email is spo

Re: [kvm-devel] Use host CPUID processor info

2007-07-08 Thread Dong, Eddie
Avi Kivity wrote: > Dong, Eddie wrote: >> Use host cpu model name, type, family, Model, stepping for guest. >> >> Against head. >> >> > > This is turning into a mix of the qemu cpuid and the host cpuid. We > need to think of a way to make this controllable. > Actually I am wondering why we ne

Re: [kvm-devel] [PATCH 11/20] KVM: SVM: Reliably detect if SVM was disabled by BIOS

2007-07-08 Thread Avi Kivity
Roland Dreier wrote: > seems like we probably want this for 2.6.22... it fixes a panic that > I've seen actually reported by several users. Is there any risk to > merging it? > > i guess getting it into 2.6.22.1 would be OK too. > Well, there were reports of miscompiles with the original patch

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > >>+#ifdef CONFIG_SCHED_KVM > >>+static __read_mostly struct sched_kvm_hooks kvm_hooks; > >>+#endif > > > >please just add a current->put_vcpu() function pointer instead of > >this hooks thing. > > Won't that increase task_struct (16 bytes on 64-bit) unn

Re: [kvm-devel] Use host CPUID processor info

2007-07-08 Thread Avi Kivity
Dong, Eddie wrote: > Avi Kivity wrote: > >> Dong, Eddie wrote: >> >>> Use host cpu model name, type, family, Model, stepping for guest. >>> >>> Against head. >>> >>> >>> >> This is turning into a mix of the qemu cpuid and the host cpuid. We >> need to think of a way to make this con

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > +#ifdef CONFIG_SCHED_KVM +static __read_mostly struct sched_kvm_hooks kvm_hooks; +#endif >>> please just add a current->put_vcpu() function pointer instead of >>> this hooks thing. >>> >> Won't

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > >> Won't that increase task_struct (16 bytes on 64-bit) unnecessarily? > >> The function pointers are common to all virtual machines. > > > > well, this function pointer could then be reused by other virtual > > machines as well, couldnt it? > > I don

Re: [kvm-devel] Use host CPUID processor info

2007-07-08 Thread Dong, Eddie
Avi Kivity wrote: > > One of the uses of virtualization is to abstract the underlying > hardware, so that a VM image can run on any platform (live > migration is > an example of this use case). For that we must not let any detail of > the hardware be visible. I doutb about the live migration cr

Re: [kvm-devel] Use host CPUID processor info

2007-07-08 Thread Avi Kivity
Dong, Eddie wrote: > Avi Kivity wrote: > >> One of the uses of virtualization is to abstract the underlying >> hardware, so that a VM image can run on any platform (live >> migration is >> an example of this use case). For that we must not let any detail of >> the hardware be visible. >>

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > Won't that increase task_struct (16 bytes on 64-bit) unnecessarily? The function pointers are common to all virtual machines. >>> well, this function pointer could then be reused by other virtual >>> mach

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Rusty Russell
On Sun, 2007-07-08 at 15:48 +0200, Ingo Molnar wrote: > * Avi Kivity <[EMAIL PROTECTED]> wrote: > > > >>+#ifdef CONFIG_SCHED_KVM > > >>+static __read_mostly struct sched_kvm_hooks kvm_hooks; > > >>+#endif > > > > > >please just add a current->put_vcpu() function pointer instead of > > >this hooks

[kvm-devel] User space for lapic2

2007-07-08 Thread Dong, Eddie
Avi: To make lapic code into mainline earlier, I am thinking what should the user space code look like. If we wait till lapic branch has all same functionality as mainline have today i.e. live migration, all guests etc, we may have very long way to go given that only Greg (temply off), me

[kvm-devel] Compile error

2007-07-08 Thread Zhao, Yunfeng
I meet the error below when I compile KVM module against 30dac03825e830641054a829fe99ff6d1f2ebe0d. The kernel is 2.6.22-rc4. + make -C kernel make[1]: Entering directory `/workspace/ia32e/nightly/kvm-master-2.6.22-rc4-20070708190117/kvm-users pace/BUILD/kernel' make -j20 -C /lib/modules/2.6.22-rc4

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
Rusty Russell wrote: > On Sun, 2007-07-08 at 15:48 +0200, Ingo Molnar wrote: > >> * Avi Kivity <[EMAIL PROTECTED]> wrote: >> >> > +#ifdef CONFIG_SCHED_KVM > +static __read_mostly struct sched_kvm_hooks kvm_hooks; > +#endif > please just add a current->put_vcp

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-08 Thread Avi Kivity
[cc list restored] Andi Kleen wrote: > Avi Kivity writes: > >> diff --git a/include/linux/sched.h b/include/linux/sched.h >> index 693f0e6..b705876 100644 >> --- a/include/linux/sched.h >> +++ b/include/linux/sched.h >> @@ -875,6 +875,10 @@ struct task_struct { >> pid_t pid; >> pid_t

Re: [kvm-devel] [PATCH 17/20] SMP: Implement on_cpu()

2007-07-08 Thread Avi Kivity
[cc list restored] Andi Kleen wrote: >> This defines on_cpu() which is similar to smp_call_function_single() >> except that it works if cpu happens to be the current cpu. Can also be >> seen as a complement to on_each_cpu() (which also doesn't treat the >> current cpu specially). >> > > I th