Re: [PATCH v4 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-20 Thread zhangyanfei
于 2012年11月20日 08:32, Marcelo Tosatti 写道: On Fri, Nov 16, 2012 at 06:12:58PM +0800, zhangyanfei wrote: Hello Marcelo, Any thoughts? I thought a function call was OK, but its better to have all code in vmx.c. Please have an atomic notifier in kexec.c (registered by KVM module via

Re: [PATCH v4 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-16 Thread zhangyanfei
Hello Marcelo, Any thoughts? 于 2012年11月14日 17:29, zhangyanfei 写道: Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted. But, sometimes, we need the VMCSs to debug guest

Re: [PATCH v3 2/2] KVM: make crash_clear_loaded_vmcss valid when loading kvm_intel module

2012-11-14 Thread zhangyanfei
于 2012年11月14日 05:22, Marcelo Tosatti 写道: On Thu, Nov 01, 2012 at 01:55:04PM +0800, zhangyanfei wrote: 于 2012年10月31日 17:01, Hatayama, Daisuke 写道: -Original Message- From: kexec-boun...@lists.infradead.org [mailto:kexec-boun...@lists.infradead.org] On Behalf Of zhangyanfei Sent

[PATCH v4 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-14 Thread zhangyanfei
Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted. But, sometimes, we need the VMCSs to debug guest images contained in the host vmcore. To prevent the corruption, we should

[PATCH v4 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-11-14 Thread zhangyanfei
crash_clear_loaded_vmcss is added to VMCLEAR vmcss loaded on all cpus. And when loading kvm_intel module, the function pointer will be made valid. The percpu variable vmclear_skipped is added to flag the case that if loaded_vmcss_on_cpu list is being modified while the machine crashes and doing

[PATCH v4 2/2] KVM: set/unset crash_clear_loaded_vmcss and vmclear_skipped in kvm_intel module

2012-11-14 Thread zhangyanfei
Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4ff0ab9..029ec7b 100644 --- a/arch/x86/kvm/vmx.c +++

Re: [PATCH v3 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-11-12 Thread zhangyanfei
Hello Marcelo, Do you have any comments about this version? Thanks Zhang 于 2012年10月31日 11:30, zhangyanfei 写道: Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted

Re: [PATCH v3 2/2] KVM: make crash_clear_loaded_vmcss valid when loading kvm_intel module

2012-10-31 Thread zhangyanfei
于 2012年10月31日 17:01, Hatayama, Daisuke 写道: -Original Message- From: kexec-boun...@lists.infradead.org [mailto:kexec-boun...@lists.infradead.org] On Behalf Of zhangyanfei Sent: Wednesday, October 31, 2012 12:34 PM To: x...@kernel.org; kexec@lists.infradead.org; Avi Kivity; Marcelo

Re: [PATCH 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-10-30 Thread zhangyanfei
-corrupted. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |2 ++ arch/x86/kernel/crash.c | 27 +++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h

[PATCH v3 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-10-30 Thread zhangyanfei
Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active on the logical processors may be corrupted. But, sometimes, we need the VMCSs to debug guest images contained in the host vmcore. To prevent the corruption, we should

[PATCH v3 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-10-30 Thread zhangyanfei
This patch provides a way to VMCLEAR vmcss related to guests on all cpus before executing the VMXOFF when doing kdump. This is used to ensure the VMCSs in the vmcore updated and non-corrupted. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |2 ++

[PATCH v3 2/2] KVM: make crash_clear_loaded_vmcss valid when loading kvm_intel module

2012-10-30 Thread zhangyanfei
Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/kvm/vmx.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 4ff0ab9..f6a16b2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -41,6 +41,7 @@

Re: [PATCH v2 0/2] x86: clear vmcss on all cpus when doing kdump if necessary

2012-10-25 Thread zhangyanfei
doing kdump. This is used to ensure the VMCSs in the vmcore updated and non-corrupted. Changelog from v1 to v2: 1. remove the sysctl and clear VMCSs unconditionally. zhangyanfei (2): x86/kexec: VMCLEAR vmcss on all cpus if necessary KVM: make crash_clear_loaded_vmcss valid when loading

[PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-16 Thread zhangyanfei
/vmcsinfo: shows physical address of VMCSINFO note information. /sys/kernel/vmcsinfo_maxsize: shows max size of VMCSINFO. 4. A new Documentation/ABI entry is added for vmcsinfo and vmcsinfo_maxsize. 5. Do not update VMCSINFO note when the kernel is panicked. zhangyanfei (5): x86: Add helper

[PATCH v2 1/5] x86: Add helper variables and functions to hold VMCSINFO

2012-05-16 Thread zhangyanfei
This patch provides a set of variables to hold the VMCSINFO and also some helper functions to help fill the VMCSINFO. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/vmcsinfo.h | 34 + arch/x86/kernel/Makefile|2 + arch/x86/kernel

[PATCH v2 2/5] KVM: Export symbols for module vmcsinfo-intel

2012-05-16 Thread zhangyanfei
A new module named vmcsinfo-intel is used to fill VMCSINFO. And this module depends on kvm-intel and kvm module. So we should export some symbols of kvm-intel and kvm module that are needed by vmcsinfo-intel. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/vmx.h

[PATCH v2 3/5] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO

2012-05-16 Thread zhangyanfei
Software Developer’s Manual, Volume 3C) but not defined in *vmcs_field*. 2. fields don't exist because their corresponding control bits are not set. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/kvm/Kconfig| 11 ++ arch/x86/kvm/Makefile |3 + arch/x86/kvm

[PATCH v2 4/5] ksysfs: Export VMCSINFO via sysfs

2012-05-16 Thread zhangyanfei
/sys/kernel/vmcsinfo_maxsize shows the max size of VMCSINFO. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- kernel/ksysfs.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 4e316e1..8a27ece 100644

[PATCH v2 5/5] Documentation: Add ABI entry for sysfs file vmcsinfo and vmcsinfo_maxsize

2012-05-16 Thread zhangyanfei
We create two new sysfs files, vmcsinfo and vmcsinfo_maxsize. And here we add an Documentation/ABI entry for them. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- Documentation/ABI/testing/sysfs-kernel-vmcsinfo | 16 1 files changed, 16 insertions(+), 0 deletions

Re: [PATCH 0/4] Export offsets of VMCS fields as note information for kdump

2012-04-18 Thread zhangyanfei
于 2012年04月17日 18:59, Avi Kivity 写道: On 04/17/2012 01:51 PM, zhangyanfei wrote: 于 2012年04月17日 15:44, Avi Kivity 写道: On 04/11/2012 04:39 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO

Re: [PATCH 0/4] Export offsets of VMCS fields as note information for kdump

2012-04-17 Thread zhangyanfei
于 2012年04月17日 15:44, Avi Kivity 写道: On 04/11/2012 04:39 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve runtime state of guest machine image, such as registers, in host machine's

Re: [PATCH 0/4] Export offsets of VMCS fields as note information for kdump

2012-04-11 Thread zhangyanfei
于 2012年04月11日 16:56, Avi Kivity 写道: On 04/11/2012 04:39 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve runtime state of guest machine image, such as registers, in host machine's

Re: [PATCH 2/4] KVM: VMX: Add functions to fill VMCSINFO

2012-04-11 Thread zhangyanfei
于 2012年04月11日 16:48, Avi Kivity 写道: On 04/11/2012 04:50 AM, zhangyanfei wrote: This patch is to implement the feature that at initialization of kvm_intel module, fills VMCSINFO with a VMCS revision identifier, and encoded offsets of VMCS fields. The reason why we put the VMCSINFO processing

[PATCH 2/4] KVM: VMX: Add functions to fill VMCSINFO

2012-04-10 Thread zhangyanfei
control bits are not set. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/kvm/vmx.c | 350 1 files changed, 350 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ad85adf..e98fafa

[PATCH 0/4] Export offsets of VMCS fields as note information for kdump

2012-04-10 Thread zhangyanfei
VMCS region of each guest vcpu and VMCSINFO into qemu-process core file. To do this, we will modify kernel core dumper, gdb gcore and crash gcore. 3. Dump guest image from the qemu-process core file into a vmcore. zhangyanfei (4): x86: Add helper variables and functions to hold

[PATCH 3/4] ksysfs: export VMCSINFO via sysfs

2012-04-10 Thread zhangyanfei
This patch creates sysfs file to export where VMCSINFO is allocated, as below: $ cat /sys/kernel/vmcsinfo 1cb88a0 2000 number on the left-hand side is the physical address of VMCSINFO, while the one on the right-hand side is the max size of VMCSINFO. Signed-off-by: zhangyanfei

[PATCH 4/4] kexec: Add crash_save_vmcsinfo to update VMCSINFO

2012-04-10 Thread zhangyanfei
crash_save_vmcsinfo updates the VMCSINFO when kernel crashes. If no VMCSINFO has been saved before, this function will do nothing. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- include/linux/kexec.h |1 + kernel/kexec.c| 14 ++ 2 files changed, 15 insertions