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

2011-12-28 Thread Avi Kivity
On 12/28/2011 08:54 AM, Liu ping fan wrote: > >> > >> struct kvm_vcpu { > >> struct kvm *kvm; > >> + struct list_head list; > >> #ifdef CONFIG_PREEMPT_NOTIFIERS > >> struct preempt_notifier preempt_notifier; > >> #endif > >> @@ -251,12 +252,14 @@ struct kvm { > >> struct

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

2011-12-28 Thread Avi Kivity
On 12/27/2011 10:38 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > Currently, vcpu can be destructed only when kvm instance destroyed. > Change this to vcpu's destruction before kvm instance, so vcpu MUST > and CAN be destroyed before kvm's destroy. > > Signed-off-by: Liu Ping Fan > --- > arch

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

2011-12-28 Thread Avi Kivity
On 12/28/2011 11:53 AM, Avi Kivity wrote: > On 12/27/2011 10:38 AM, Liu Ping Fan wrote: > > From: Liu Ping Fan > > > > Currently, vcpu can be destructed only when kvm instance destroyed. > > Change this to vcpu's destruction before kvm instance, so vcpu MUST > > and CAN be destroyed before kvm's d

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

2011-12-28 Thread Takuya Yoshikawa
(2011/12/28 18:54), Avi Kivity wrote: On 12/28/2011 11:53 AM, Avi Kivity wrote: On 12/27/2011 10:38 AM, Liu Ping Fan wrote: From: Liu Ping Fan Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction before kvm instance, so vcpu MUST and CAN be dest

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

2011-12-28 Thread Takuya Yoshikawa
(2011/12/28 15:54), Liu ping fan wrote: You are introducing kvm_arch_vcpu_zap(). Then, apart from the "zap" naming issue I mentioned last time, Yes, I will correct "zap", as you said, its meaning is quite different from destroy. :-) what about other architectures than x86? Have not conside

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

2011-12-28 Thread Avi Kivity
On 12/28/2011 12:19 PM, Takuya Yoshikawa wrote: >> Oops, that's only needed when the unplug API is introduced. >> > > > I think it is OK to to add such an API later on, but I really want > the author to write the plan in the changelog. It was in fact in the beginning of the thread. > I am not ob

Re: [Qemu-devel] [PATCH 1/5] vfio: Introduce documentation for VFIO driver

2011-12-28 Thread Ronen Hod
On 12/21/2011 11:42 PM, Alex Williamson wrote: Including rationale for design, example usage and API description. Signed-off-by: Alex Williamson --- Documentation/vfio.txt | 352 1 files changed, 352 insertions(+), 0 deletions(-) create mod

RE: [PATCH] Expose tsc deadline timer cpuid to guest

2011-12-28 Thread Liu, Jinsong
>> diff --git a/qemu-kvm.h b/qemu-kvm.h >> index 2bd5602..8c6c2ea 100644 >> --- a/qemu-kvm.h >> +++ b/qemu-kvm.h >> @@ -260,6 +260,7 @@ extern int kvm_irqchip; >> extern int kvm_pit; >> extern int kvm_pit_reinject; >> extern unsigned int kvm_shadow_memory; >> +extern int tsc_deadline_timer; >>

Re: Regarding KVM

2011-12-28 Thread David Mair
Hi On 12/27/2011 03:25 AM, Ajith Adapa wrote: Hi, I am new to KVM stuff and had very BASIC (might be lame even) doubts regarding KVM. As per the various diagrams I have gone through in internet my understanding is KVM is an hypervisor on top of which all VMs run. In case of FULL VIRTUALIZATIO

Re: [PATCH] Expose tsc deadline timer cpuid to guest

2011-12-28 Thread Jan Kiszka
On 2011-12-28 18:35, Liu, Jinsong wrote: >>> diff --git a/qemu-kvm.h b/qemu-kvm.h >>> index 2bd5602..8c6c2ea 100644 >>> --- a/qemu-kvm.h >>> +++ b/qemu-kvm.h >>> @@ -260,6 +260,7 @@ extern int kvm_irqchip; >>> extern int kvm_pit; >>> extern int kvm_pit_reinject; >>> extern unsigned int kvm_shado

[PATCH 1/2] Define KVM_CAP_TSC_DEADLINE_TIMER

2011-12-28 Thread Liu, Jinsong
>From 5afecc308bc25c7fd8d124e7557f08fb067d6caa Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Thu, 29 Dec 2011 01:45:45 +0800 Subject: [PATCH 1/2] Define KVM_CAP_TSC_DEADLINE_TIMER Signed-off-by: Liu, Jinsong Signed-off-by: Jan Kiszka --- linux-headers/linux/kvm.h |1 + 1 files changed,

[PATCH 2/2] Expose tsc deadline timer cpuid to guest

2011-12-28 Thread Liu, Jinsong
>From 3a78adf8006ec6189bfe2f55f7ae213e75bf3815 Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Thu, 29 Dec 2011 05:28:12 +0800 Subject: [PATCH 2/2] Expose tsc deadline timer cpuid to guest Depend on several factors: 1. Considering live migration, user enable/disable tsc deadline timer; 2. If gue

RE: Regarding KVM

2011-12-28 Thread Decker, Schorschi
David is right, KVM is a type 2 hypervisor, it will never own the hardware 100%, as a type 1 hypervisor would. KVM leverages the hosting OS, RHEL for example, for example RHEL/RHEV variant. Paravirtualization allows KVM, via its design and associated virtual instance driver design, to gain a d

[PATCH 01/21] arch_init: export sort_ram_list() and ram_save_block()

2011-12-28 Thread Isaku Yamahata
This will be used by postcopy. Signed-off-by: Isaku Yamahata --- arch_init.c |4 ++-- migration.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch_init.c b/arch_init.c index d4c92b0..1947396 100644 --- a/arch_init.c +++ b/arch_init.c @@ -112,7 +112,7 @@ static i

[PATCH 02/21] arch_init: export RAM_SAVE_xxx flags for postcopy

2011-12-28 Thread Isaku Yamahata
Those constants will be also used by postcopy. Signed-off-by: Isaku Yamahata --- arch_init.c |7 --- arch_init.h |7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index 1947396..4ede5ad 100644 --- a/arch_init.c +++ b/arch_init.c @@ -

[PATCH 04/21] arch_init: refactor host_from_stream_offset()

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- arch_init.c | 25 ++--- arch_init.h |9 + 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index 5ad6956..d55e39c 100644 --- a/arch_init.c +++ b/arch_init.c @@ -335,21 +335,22 @@ int ram_s

[PATCH 09/21] exec.c: factor out qemu_get_ram_ptr()

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- cpu-all.h |2 ++ exec.c| 51 +-- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/cpu-all.h b/cpu-all.h index 9d78715..0244f7a 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -496,6 +496,8 @@ ext

[PATCH 06/21] arch_init: refactor ram_save_block()

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- arch_init.c | 82 +++--- arch_init.h |1 + 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/arch_init.c b/arch_init.c index 9bc313e..982c846 100644 --- a/arch_init.c +++ b/arch_init.c @@ -1

[PATCH 12/21] savevm: qemu_pending_size() to return pending buffered size

2011-12-28 Thread Isaku Yamahata
This will be used later by postcopy migration. Signed-off-by: Isaku Yamahata --- hw/hw.h |1 + savevm.c |5 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 0b481ba..d508b4e 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -80,6 +80,7 @@ int qemu_get_byt

[PATCH 18/21] configure: add CONFIG_POSTCOPY option

2011-12-28 Thread Isaku Yamahata
Add enable/disable postcopy mode. No dynamic test yet. Signed-off-by: Isaku Yamahata --- configure | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 640e815..440fa9e 100755 --- a/configure +++ b/configure @@ -190,6 +190,7 @@ opengl="

[PATCH 13/21] savevm, buffered_file: introduce method to drain buffer of buffered file

2011-12-28 Thread Isaku Yamahata
Introduce a new method to drain the buffer of QEMUBufferedFile. When postcopy migration, buffer size can increase unboundedly. To keep the buffer size reasonably small, introduce the method to wait for buffer to drain. Signed-off-by: Isaku Yamahata --- buffered_file.c | 20 +++-

[PATCH 16/21] umem.h: import Linux umem.h

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- linux-headers/linux/umem.h | 83 1 files changed, 83 insertions(+), 0 deletions(-) create mode 100644 linux-headers/linux/umem.h diff --git a/linux-headers/linux/umem.h b/linux-headers/linux/umem.h new file mode 10

[PATCH 15/21] migration: factor out parameters into MigrationParams

2011-12-28 Thread Isaku Yamahata
Introduce MigrationParams for parameters of migration. Signed-off-by: Isaku Yamahata --- block-migration.c |8 hw/hw.h |2 +- migration.c | 16 +--- migration.h |8 ++-- qemu-common.h |1 + savevm.c | 12

[PATCH 14/21] migration: export migrate_fd_completed() and migrate_fd_cleanup()

2011-12-28 Thread Isaku Yamahata
This will be used by postcopy migration. Signed-off-by: Isaku Yamahata --- migration.c |4 ++-- migration.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration.c b/migration.c index 412fdfe..057dde7 100644 --- a/migration.c +++ b/migration.c @@ -166,7 +166,7 @

[PATCH 19/21] postcopy: introduce -postcopy and -postcopy-flags option

2011-12-28 Thread Isaku Yamahata
This patch prepares for postcopy livemigration. It introduces -postcopy option and its internal flag, migration_postcopy. It introduces -postcopy-flags for chaging the behavior of incoming postcopy mainly for benchmark/debug. Signed-off-by: Isaku Yamahata postcopy: introduce -postcopy-flags opti

[PATCH 00/21][RFC] postcopy live migration

2011-12-28 Thread Isaku Yamahata
Intro = This patch series implements postcopy live migration.[1] As discussed at KVM forum 2011, dedicated character device is used for distributed shared memory between migration source and destination. Now we can discuss/benchmark/compare with precopy. I believe there are much rooms for impro

[PATCH 07/21] arch_init/ram_save_live: factor out ram_save_limit

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- arch_init.c | 28 +--- migration.h |1 + 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/arch_init.c b/arch_init.c index 982c846..249b440 100644 --- a/arch_init.c +++ b/arch_init.c @@ -261,9 +261,24 @@ void ram_save_

[PATCH 05/21] arch_init/ram_save_live: factor out RAM_SAVE_FLAG_MEM_SIZE case

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- arch_init.c | 21 ++--- migration.h |1 + 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/arch_init.c b/arch_init.c index d55e39c..9bc313e 100644 --- a/arch_init.c +++ b/arch_init.c @@ -243,6 +243,19 @@ void sort_ram_list(voi

[PATCH 20/21] postcopy outgoing: add -p and -n option to migrate command

2011-12-28 Thread Isaku Yamahata
Added -p option to migrate command for postcopy mode and introduce postcopy parameter for migration to indicate that postcopy mode is enabled. Add -n option for postcopy migration which indicates disabling background transfer. Signed-off-by: Isaku Yamahata --- hmp-commands.hx | 12 --

[PATCH 10/21] exec.c: export last_ram_offset()

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- exec-obsolete.h |1 + exec.c |4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exec-obsolete.h b/exec-obsolete.h index 34b9fc5..8f69f1c 100644 --- a/exec-obsolete.h +++ b/exec-obsolete.h @@ -25,6 +25,7 @@ #ifndef CONFIG_U

[PATCH 11/21] savevm: export qemu_peek_buffer, qemu_peek_byte, qemu_file_skip

2011-12-28 Thread Isaku Yamahata
Those will be used by postcopy. Signed-off-by: Isaku Yamahata --- hw/hw.h |3 +++ savevm.c |6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index efa04d1..0b481ba 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -77,6 +77,9 @@ void qemu_put_be32(QEMUFile

[PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2011-12-28 Thread Isaku Yamahata
This is Linux kernel driver for qemu/kvm postcopy live migration. This is used by qemu/kvm postcopy live migration patch. TODO: - Consider FUSE/CUSE option So far several mmap patches for FUSE/CUSE are floating around. (their purpose isn't different from our purpose, though). They haven't merg

[PATCH 2/2] umem: chardevice for kvm postcopy

2011-12-28 Thread Isaku Yamahata
This is a character device to hook page access. The page fault in the area is reported to another user process by this chardriver. Then, the process fills the page contents and resolves the page fault. Signed-off-by: Isaku Yamahata --- drivers/char/Kconfig |9 + drivers/char/Makefile |1

[PATCH 1/2] export necessary symbols

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- mm/memcontrol.c |1 + mm/shmem.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b63f5f7..85530fc 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2807,6 +2807,7 @@ int mem_cgroup_cac

[PATCH 17/21] update-linux-headers.sh: teach umem.h to update-linux-headers.sh

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- scripts/update-linux-headers.sh |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 9d2a4bc..2afdd54 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-li

[PATCH 08/21] arch_init/ram_load: refactor ram_load

2011-12-28 Thread Isaku Yamahata
Signed-off-by: Isaku Yamahata --- arch_init.c | 67 +- arch_init.h |1 + 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/arch_init.c b/arch_init.c index 249b440..bc53092 100644 --- a/arch_init.c +++ b/arch_init.c @@ -3

[PATCH 03/21] arch_init/ram_save: introduce constant for ram save version = 4

2011-12-28 Thread Isaku Yamahata
Introduce RAM_SAVE_VERSION_ID to represent version_id for ram save format. Signed-off-by: Isaku Yamahata --- arch_init.c |2 +- arch_init.h |2 ++ vl.c|4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch_init.c b/arch_init.c index 4ede5ad..5ad6956 1006

Re: [PATCH 0/2][RFC] postcopy migration: Linux char device for postcopy

2011-12-28 Thread Isaku Yamahata
On Thu, Dec 29, 2011 at 10:26:16AM +0900, Isaku Yamahata wrote: > UMEM_DEV_LIST: list created umem devices > UMEM_DEV_REATTACH: re-attach the created umem device > UMEM_DEV_LIST and UMEM_DEV_REATTACH are used when > the process that services page fault disappears or

Re: Regarding KVM

2011-12-28 Thread Zhen-Hua Li
In short, when you running qemu and enabled KVM, kvm only gives virtual cpu and gets the commands from your vm and give them to VT. KVm does not have other hardware. The hardware are provided by qemu or other vms. > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@

Re: Is that possible to virtualize a kernel module?

2011-12-28 Thread Zhen-Hua Li
Do you mean that you want to run a kernel in another VM? I think it is not possible. I have checked it. In a qemu with kvm enabled, # cat /proc/cpuinfo | grep ^flags flags : fpu de pse tsc msr pae mce cx8 apic sep pge cmov mmx fxsr sse sse2 up pni popcnt hypervisor It does not have "