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

2012-10-18 Thread Zhang Yanfei
于 2012年10月18日 18:55, Avi Kivity 写道: On 10/18/2012 03:12 AM, Zhang Yanfei wrote: 于 2012年10月17日 18:16, Avi Kivity 写道: On 10/17/2012 04:28 AM, Zhang Yanfei wrote: 于 2012年10月15日 23:43, Avi Kivity 写道: On 10/12/2012 08:40 AM, Zhang Yanfei wrote: Currently, kdump just makes all the logical

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

2012-10-18 Thread Zhang Yanfei
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 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-10-18 Thread Zhang Yanfei
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: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |2 ++

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

2012-10-18 Thread Zhang Yanfei
Signed-off-by: zhangyanfei 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 @@

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

2012-10-12 Thread Zhang Yanfei
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 1/3] x86/kexec: clear vmcss on all cpus if necessary

2012-10-12 Thread Zhang Yanfei
This patch provides an alternative way to clear vmcss related to guests on all cpus when doing kdump. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |3 +++ arch/x86/kernel/crash.c | 23 +++ 2 files changed, 26 insertions(+),

[PATCH 2/3] KVM: make crash_clear_loaded_vmcss valid when kvm_intel is loaded

2012-10-12 Thread Zhang Yanfei
Signed-off-by: zhangyanfei 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 @@

[PATCH 3/3] sysctl: introduce a new interface to control kdump-vmcs-clear behaviour

2012-10-12 Thread Zhang Yanfei
This patch exports the variable clear_loaded_vmcs_enabled to userspace. Signed-off-by: zhangyanfei zhangyan...@cn.fujitsu.com --- Documentation/sysctl/kernel.txt |8 kernel/sysctl.c | 10 ++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git

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

2012-10-16 Thread Zhang Yanfei
于 2012年10月15日 23:43, Avi Kivity 写道: On 10/12/2012 08:40 AM, Zhang Yanfei wrote: 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

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

2012-10-17 Thread Zhang Yanfei
于 2012年10月17日 18:16, Avi Kivity 写道: On 10/17/2012 04:28 AM, Zhang Yanfei wrote: 于 2012年10月15日 23:43, Avi Kivity 写道: On 10/12/2012 08:40 AM, Zhang Yanfei wrote: Currently, kdump just makes all the logical processors leave VMX operation by executing VMXOFF instruction, so any VMCSs active

Re: [PATCH 1/2] sysfs: Add crash_notes_size to export percpu note size

2013-03-28 Thread Zhang Yanfei
Hi, simon I forgot to add your email in the CC, could you please help reviewing this patch since I will send the kexec-tools patch if this patch is accepted. Thanks Zhang 于 2013年03月28日 16:15, Zhang Yanfei 写道: For percpu notes, we are exporting only address and not size. So the userspace tool

[PATCH] sysfs: fix compile warning in i386

2013-04-02 Thread Zhang Yanfei
...@intel.com Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- drivers/base/cpu.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index a55b590..ee38cc2 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -138,8 +138,10

[PATCH 2/2] Documentation: Add ABI entry for crash_notes and crash_notes_size

2013-03-28 Thread Zhang Yanfei
Add an Documentation/ABI entry for /sys/devices/system/cpu/cpu0/crash_notes and /sys/devices/system/cpu/cpu0/crash_notes_size. Cc: Greg KH gre...@linuxfoundation.org Cc: Eric W. Biederman ebied...@xmission.com Cc: Vivek Goyal vgo...@redhat.com Signed-off-by: Zhang Yanfei zhangyan

[PATCH 1/2] sysfs: Add crash_notes_size to export percpu note size

2013-03-28 Thread Zhang Yanfei
parse it intead of using 1024. The idea came from Vivek Goyal. And a later patch will be sent to kexec-tools to let it parse the size. Cc: Greg KH gre...@linuxfoundation.org Cc: Eric W. Biederman ebied...@xmission.com Cc: Vivek Goyal vgo...@redhat.com Signed-off-by: Zhang Yanfei zhangyan

Re: [PATCH v2 15/20] kexec: fill note buffers by NT_VMCORE_PAD notes in page-size boundary

2013-03-09 Thread Zhang Yanfei
anything more. I see. I know what you mean now. I was just surprised and puzzled about your namespace concept. Other than the name of NT_VMCORE_PAD, no complaints about the code. Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH v2 01/20] vmcore: refer to e_phoff member explicitly

2013-03-09 Thread Zhang Yanfei
于 2013年03月05日 15:35, Zhang Yanfei 写道: 于 2013年03月02日 16:35, HATAYAMA Daisuke 写道: Code around /proc/vmcore currently assumes program header table is next to ELF header. But future change can break the assumption on kexec-tools and the 1st kernel. To avoid worst case, now refer to e_phoff member

Re: [PATCH v2 07/20] vmcore: copy non page-size aligned head and tail pages in 2nd kernel

2013-03-09 Thread Zhang Yanfei
于 2013年03月02日 16:36, HATAYAMA Daisuke 写道: Due to mmap() requirement, we need to copy pages not starting or ending with page-size aligned address in 2nd kernel and to map them to user-space. For example, see the map below: -0001 : reserved 0001-0009f7ff : System

Re: [PATCH v2, part1 29/29] mm,kexec: use common help functions to free reserved pages

2013-03-10 Thread Zhang Yanfei
于 2013年03月10日 14:27, Jiang Liu 写道: Use common help functions to free reserved pages. Signed-off-by: Jiang Liu jiang@huawei.com Cc: Eric Biederman ebied...@xmission.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c |8 ++-- 1 file changed, 2

[PATCH 01/18] arm: remove cast for kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org Cc: Russell King li...@arm.linux.org.uk Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/kernel/topology.c |2 +- 1 files changed, 1 insertions(+), 1

[PATCH 02/18] ia64: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Tony Luck tony.l...@intel.com Cc: Fenghua Yu fenghua...@intel.com Cc: Andrew Morton a...@linux-foundation.org Cc: linux-i...@vger.kernel.org --- arch/ia64/kernel/mca_drv.c |2 +- 1 files changed

[PATCH 03/18] powerpc: remove cast for kmalloc/kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc/kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: Paul Mackerras pau...@samba.org Cc: Andrew Morton a...@linux-foundation.org Cc: linuxppc-...@lists.ozlabs.org --- arch/powerpc/kernel

[PATCH 04/18] x86: platform: mrst: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Thomas Gleixner t...@linutronix.de Cc: Ingo Molnar mi...@redhat.com Cc: H. Peter Anvin h...@zytor.com Cc: Andrew Morton a...@linux-foundation.org Cc: x...@kernel.org x...@kernel.org --- arch/x86

[PATCH 05/18] driver: staging: csr: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Andrew Morton a...@linux-foundation.org Cc: de...@driverdev.osuosl.org --- drivers/staging/csr/drv.c |4 ++-- drivers/staging

[PATCH 06/18] driver: gpu: drm: i915: remove cast for kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org Cc: David Airlie airl...@linux.ie Cc: dri-de...@lists.freedesktop.org --- drivers/gpu/drm/i915/intel_sdvo.c |2 +- 1 files changed, 1 insertions(+), 1

[PATCH 07/18] driver: hv: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: K. Y. Srinivasan k...@microsoft.com Cc: Haiyang Zhang haiya...@microsoft.com Cc: Andrew Morton a...@linux-foundation.org Cc: de...@linuxdriverproject.org --- drivers/hv/hv.c |5 ++--- 1 files

[PATCH 08/18] driver: isdn: capi: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org Cc: Karsten Keil i...@linux-pingi.de Cc: net...@vger.kernel.org --- drivers/isdn/capi/capidrv.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions

[PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc/kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org Cc: Karsten Keil i...@linux-pingi.de Cc: net...@vger.kernel.org --- drivers/isdn/hisax/fsm.c|2 +- drivers/isdn/hisax/hfc_sx.c |2 +- 2

[PATCH 10/18] driver: s390: block: remove cast for kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Martin Schwidefsky schwidef...@de.ibm.com Cc: Heiko Carstens heiko.carst...@de.ibm.com Cc: Andrew Morton a...@linux-foundation.org Cc: linux...@de.ibm.com --- drivers/s390/block/dasd_devmap.c |3

[PATCH 11/18] driver: s390: net: remove cast for kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Ursula Braun ursula.br...@de.ibm.com Cc: Frank Blaschka blasc...@linux.vnet.ibm.com Cc: Martin Schwidefsky schwidef...@de.ibm.com Cc: Heiko Carstens heiko.carst...@de.ibm.com Cc: Andrew Morton

[PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc/kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Andrew Morton a...@linux-foundation.org Cc: linux-s...@vger.kernel.org --- drivers/scsi/hpsa.c |3 +-- drivers/scsi/lpfc

[PATCH 13/18] driver: tty: serial: remove cast for kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Jiri Slaby jsl...@suse.cz Cc: Andrew Morton a...@linux-foundation.org Cc: linux-ser...@vger.kernel.org --- drivers/tty/serial/icom.c |3 +-- 1

[PATCH 14/18] driver: tty: vt: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Jiri Slaby jsl...@suse.cz Cc: Andrew Morton a...@linux-foundation.org --- drivers/tty/vt/consolemap.c |3 +-- 1 files changed, 1 insertions(+), 2

[PATCH 15/18] driver: usb: storage: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Matthew Dharm mdharm-...@one-eyed-alien.net Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: Andrew Morton a...@linux-foundation.org Cc: linux-...@vger.kernel.org Cc: usb-stor...@lists.one-eyed

[PATCH 16/18] fs: befs: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org --- fs/befs/btree.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/befs/btree.c b/fs/befs/btree.c index a66c9b1..74e397d 100644

[PATCH 17/18] fs: ufs: remove cast for kmalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Evgeniy Dushistov dushis...@mail.ru Cc: Andrew Morton a...@linux-foundation.org --- fs/ufs/util.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/ufs/util.c b/fs/ufs

[PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc return value

2013-03-11 Thread Zhang Yanfei
remove cast for kmalloc/kzalloc return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Vlad Yasevich vyasev...@gmail.com Cc: Sridhar Samudrala s...@us.ibm.com Cc: Neil Horman nhor...@tuxdriver.com Cc: Andrew Morton a...@linux-foundation.org Cc: linux-s...@vger.kernel.org

[PATCH] mmap: find_vma: remove the WARN_ON_ONCE(!mm) check

2013-03-13 Thread Zhang Yanfei
Remove the WARN_ON_ONCE(!mm) check as the comment suggested. Kernel code calls find_vma only when it is absolutely sure that the mm_struct arg to it is non-NULL. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Andrew Morton a...@linux-foundation.org --- mm/mmap.c |3 --- 1 files

Re: [PATCH v2 01/20] vmcore: refer to e_phoff member explicitly

2013-03-04 Thread Zhang Yanfei
header table in file-offset. Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com Signed-off-by: HATAYAMA Daisuke d.hatay...@jp.fujitsu.com --- fs/proc/vmcore.c | 40 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/fs/proc

Re: [PATCH v2 02/20] vmcore: rearrange program headers without assuming consequtive PT_NOTE entries

2013-03-05 Thread Zhang Yanfei
于 2013年03月02日 16:35, HATAYAMA Daisuke 写道: Current code assumes all PT_NOTE headers are placed at the beginning of program header table and they are consequtive. But the assumption could be broken by future changes on either kexec-tools or the 1st kernel. This patch removes the assumption and

Re: [PATCH v2 03/20] vmcore, sysfs: export ELF note segment size instead of vmcoreinfo data size

2013-03-05 Thread Zhang Yanfei
*kobj, { return sprintf(buf, %lx %x\n, paddr_vmcoreinfo_note(), -(unsigned int)vmcoreinfo_max_size); +(unsigned int)sizeof(vmcoreinfo_note)); } KERNEL_ATTR_RO(vmcoreinfo); Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com

Re: [PATCH v2 02/20] vmcore: rearrange program headers without assuming consequtive PT_NOTE entries

2013-03-05 Thread Zhang Yanfei
于 2013年03月05日 17:02, HATAYAMA Daisuke 写道: From: Zhang Yanfei zhangyan...@cn.fujitsu.com Subject: Re: [PATCH v2 02/20] vmcore: rearrange program headers without assuming consequtive PT_NOTE entries Date: Tue, 5 Mar 2013 16:36:53 +0800 于 2013年03月02日 16:35, HATAYAMA Daisuke 写道: Current code

Re: [PATCH v2 04/20] vmcore: allocate buffer for ELF headers on page-size alignment

2013-03-05 Thread Zhang Yanfei
于 2013年03月02日 16:36, HATAYAMA Daisuke 写道: Allocate buffer for ELF headers on page-size aligned boudary to satisfy mmap() requirement. For this, __get_free_pages() is used instead of kmalloc(). Also, later patch will decrease actually used buffer size for ELF headers, so it's necessary to

Re: [PATCH v2 15/20] kexec: fill note buffers by NT_VMCORE_PAD notes in page-size boundary

2013-03-07 Thread Zhang Yanfei
于 2013年03月02日 16:37, HATAYAMA Daisuke 写道: Fill both crash_notes and vmcoreinfo_note buffers by NT_VMCORE_PAD note type to make them satisfy mmap()'s page-size boundary requirement. So far, end of note segments has been marked by zero-filled elf header. Instead, this patch writes

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

2012-12-04 Thread Zhang Yanfei
于 2012年12月05日 04:14, Eric W. Biederman 写道: Zhang Yanfei zhangyan...@cn.fujitsu.com writes: 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

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

2012-12-05 Thread Zhang Yanfei
and clear VMCSs unconditionally. Zhang Yanfei (2): x86/kexec: VMCLEAR VMCSs loaded on all cpus if necessary KVM-INTEL: provide the vmclear function and a bitmap to support VMCLEAR in kdump arch/x86/include/asm/kexec.h |2 + arch/x86/kernel/crash.c | 32

[PATCH v10 1/2] x86/kexec: VMCLEAR VMCSs loaded on all cpus if necessary

2012-12-05 Thread Zhang Yanfei
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 ++ arch

Re: [PATCH v10 2/2] KVM-INTEL: provide the vmclear function and a bitmap to support VMCLEAR in kdump

2012-12-05 Thread Zhang Yanfei
The vmclear function will be assigned to the callback function pointer when loading kvm-intel module. And the bitmap indicates whether we should do VMCLEAR operation in kdump. The bits in the bitmap are set/unset according to different conditions. Signed-off-by: Zhang Yanfei zhangyan

[PATCH 0/3] mm: rename confusing function names

2013-02-05 Thread Zhang Yanfei
patch1 first. Zhang Yanfei (3): mm: rename nr_free_zone_pages to nr_free_zone_high_pages mm: rename nr_free_buffer_pages to nr_free_buffer_high_pages mm: rename nr_free_pagecache_pages to nr_free_pagecache_high_pages arch/ia64/mm/contig.c |3 ++- arch/ia64/mm/discontig.c

[PATCH 1/3] mm: rename nr_free_zone_pages to nr_free_zone_high_pages

2013-02-05 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com This function actually counts present_pages - pages_high, so rename it to a reasonable name. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- mm/page_alloc.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mm

[PATCH 2/3] mm: rename nr_free_buffer_pages to nr_free_buffer_high_pages

2013-02-05 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com This function actually counts RAM pages that are above high watermark within ZONE_DMA and ZONE_NORMAL, so rename it to a reasonable name. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/ia64/mm/contig.c |3 ++- arch/ia64

[PATCH 3/3] mm: rename nr_free_pagecache_pages to nr_free_pagecache_high_pages

2013-02-05 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com This function actually counts RAM pages that are above high watermark within all zones, so rename it to a reasonable name. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/swap.h |2 +- mm/memory_hotplug.c |4

Re: [PATCH 0/3] mm: rename confusing function names

2013-02-05 Thread Zhang Yanfei
于 2013年02月06日 06:13, Andrew Morton 写道: On Tue, 5 Feb 2013 14:26:40 -0500 Johannes Weiner han...@cmpxchg.org wrote: On Wed, Feb 06, 2013 at 01:09:55AM +0800, Zhang Yanfei wrote: Function nr_free_zone_pages, nr_free_buffer_pages and nr_free_pagecache_pages are horribly badly named

Re: [PATCH 0/3] mm: rename confusing function names

2013-02-05 Thread Zhang Yanfei
于 2013年02月06日 09:20, Andrew Morton 写道: On Wed, 06 Feb 2013 09:06:05 +0800 Zhang Yanfei zhangyan...@cn.fujitsu.com wrote: So could I rename the functions to the names like nr_available_buffer_high_pages And accurately document them with code comments just as you suggested. gee. available

[PATCH 0/7] mm: fix types for some functions and variables in case of overflow

2013-02-05 Thread Zhang Yanfei
. For these variables are placed in several subsystems, I may be incorrectly fix them, if there is any problem with the fix, please correct me. Zhang Yanfei (7): mm: fix return type for functions nr_free_*_pages ia64: use %ld to print pages calculated in nr_free_buffer_pages fs/buffer.c: change type

[PATCH 1/7] mm: fix return type for functions nr_free_*_pages

2013-02-05 Thread Zhang Yanfei
Currently, the amount of RAM that functions nr_free_*_pages return is held in unsigned int. But in machines with big memory (exceeding 16TB), the amount may be incorrect because of overflow, so fix it. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/swap.h |4

[PATCH 5/7] vmscan: change type of vm_total_pages to unsigned long

2013-02-05 Thread Zhang Yanfei
This variable is calculated from nr_free_pagecache_pages so change its type to unsigned long. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/swap.h |2 +- mm/vmscan.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux

[PATCH 6/7] net: change type of netns_ipvs-sysctl_sync_qlen_max

2013-02-05 Thread Zhang Yanfei
This member of struct netns_ipvs is calculated from nr_free_buffer_pages so change its type to unsigned long in case of overflow. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/net/ip_vs.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/net

[PATCH 7/7] net: change type of virtio_chan-p9_max_pages

2013-02-05 Thread Zhang Yanfei
This member of struct virtio_chan is calculated from nr_free_buffer_pages so change its type to unsigned long in case of overflow. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- net/9p/trans_virtio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/9p

[PATCH 2/7] ia64: use %ld to print pages calculated in nr_free_buffer_pages

2013-02-05 Thread Zhang Yanfei
Now the function nr_free_buffer_pages returns unsigned long, so use %ld to print its return value. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/ia64/mm/contig.c|2 +- arch/ia64/mm/discontig.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 4/7] fs/nfsd: change type of max_delegations, nfsd_drc_max_mem and nfsd_drc_mem_used

2013-02-05 Thread Zhang Yanfei
The three variables are calculated from nr_free_buffer_pages so change their types to unsigned long in case of overflow. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- fs/nfsd/nfs4state.c |6 +++--- fs/nfsd/nfsd.h |6 +++--- fs/nfsd/nfssvc.c|6 +++--- 3 files

[PATCH 3/7] fs/buffer.c: change type of max_buffer_heads to unsigned long

2013-02-05 Thread Zhang Yanfei
max_buffer_heads is calculated from nr_free_buffer_pages(), so change its type to unsigned long in case of overflow. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- fs/buffer.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[PATCH] mm: accurately document nr_free_*_pages functions with code comments

2013-02-06 Thread Zhang Yanfei
Functions nr_free_zone_pages, nr_free_buffer_pages and nr_free_pagecache_pages are horribly badly named, so accurately document them with code comments in case of the misuse of them. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- mm/page_alloc.c | 23 +++ 1

Re: [PATCH 6/7] net: change type of netns_ipvs-sysctl_sync_qlen_max

2013-02-06 Thread Zhang Yanfei
sync_qlen_max that should be changed to sizeof(unsigned long) and updated with proc_doulongvec_minmax. Thanks for pointing this. I will update this in patch v2. Thanks Zhang Yanfei -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH 6/7] net: change type of netns_ipvs-sysctl_sync_qlen_max

2013-02-06 Thread Zhang Yanfei
于 2013年02月07日 09:09, Simon Horman 写道: On Wed, Feb 06, 2013 at 05:36:12PM +0800, Zhang Yanfei wrote: 于 2013年02月06日 17:29, Julian Anastasov 写道: Hello, Sorry that I'm writing a private email but I deleted your original message by mistake. Your change of the sysctl_sync_qlen_max from

Re: [PATCH] mm: accurately document nr_free_*_pages functions with code comments

2013-02-06 Thread Zhang Yanfei
于 2013年02月07日 08:55, Randy Dunlap 写道: On 02/06/13 00:25, Zhang Yanfei wrote: Functions nr_free_zone_pages, nr_free_buffer_pages and nr_free_pagecache_pages are horribly badly named, so accurately document them with code comments in case of the misuse of them. Signed-off-by: Zhang Yanfei

[PATCH RESEND] mm: accurately document nr_free_*_pages functions with code comments

2013-02-06 Thread Zhang Yanfei
Functions nr_free_zone_pages, nr_free_buffer_pages and nr_free_pagecache_pages are horribly badly named, so accurately document them with code comments in case of the misuse of them. Reviewed-by: Randy Dunlap rdun...@infradead.org Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- mm

[PATCH] net: fix functions and variables related to netns_ipvs-sysctl_sync_qlen_max

2013-02-06 Thread Zhang Yanfei
Cc: Simon Horman ho...@verge.net.au Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/net/ip_vs.h|4 ++-- net/netfilter/ipvs/ip_vs_ctl.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index

[PATCH v2] net: fix functions and variables related to netns_ipvs-sysctl_sync_qlen_max

2013-02-06 Thread Zhang Yanfei
-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/net/ip_vs.h|6 +++--- net/netfilter/ipvs/ip_vs_ctl.c |4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 68c69d5..1d56f92 100644 --- a/include/net

Re: [PATCH v2] net: fix functions and variables related to netns_ipvs-sysctl_sync_qlen_max

2013-02-07 Thread Zhang Yanfei
于 2013年02月07日 16:40, Julian Anastasov 写道: Hello, On Thu, 7 Feb 2013, Zhang Yanfei wrote: Since the type of netns_ipvs-sysctl_sync_qlen_max has been changed to unsigned long, type of its related proc var sync_qlen_max should be changed to unsigned long, too. Also the return type

[PATCH] KEXEC: Get rid of duplicate check for hole_end

2013-01-29 Thread Zhang Yanfei
hole_end has been checked to make sure it is = crash_res.end in the while condition check, so the if condition check is duplicate. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/kernel/kexec.c b

[PATCH] fs/proc/vmcore.c: Put if tests in the top of the while loop to reduce duplication

2013-02-03 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com In function read_vmcore, two if tests are duplicate. Change the position of them could reduce the duplication. This change does not affect the behaviour of the function. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- fs/proc/vmcore.c

Re: [PATCH v2] kexec: Use min_t to simplify logic

2013-02-25 Thread Zhang Yanfei
于 2013年02月26日 07:35, Andrew Morton 写道: On Mon, 25 Feb 2013 09:36:51 +0900 Simon Horman ho...@verge.net.au wrote: On Sun, Feb 24, 2013 at 10:37:21PM +0800, Zhang Yanfei wrote: From: Zhang Yanfei zhangyan...@cn.fujitsu.com This is just a tweak: using min_t to simplify logic of variable

[PATCH v3 1/2] kexec: fix wrong types of some local variables

2013-02-25 Thread Zhang Yanfei
...@verge.net.au Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/kexec.c b/kernel/kexec.c index 2436ffc..3cbfcc7 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -789,7 +789,7 @@ static int

[PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-25 Thread Zhang Yanfei
...@xmission.com Cc: Andrew Morton a...@linux-foundation.org Reviewed-by: Simon Horman ho...@verge.net.au Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c | 24 1 files changed, 8 insertions(+), 16 deletions(-) diff --git a/kernel/kexec.c b/kernel/kexec.c

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Zhang Yanfei
于 2013年02月26日 16:38, Joe Perches 写道: On Tue, 2013-02-26 at 13:30 +0800, Zhang Yanfei wrote: This is just a tweak: using min_t to simplify logic of variable assignments. v3: - cast type of (PAGE_SIZE - (maddr ~PAGE_MASK)) into size_t. Why? Isn't this just a redundant cast? diff --git

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Zhang Yanfei
于 2013年02月26日 16:53, Andrew Morton 写道: On Tue, 26 Feb 2013 16:49:02 +0800 Zhang Yanfei zhangyan...@cn.fujitsu.com wrote: diff --git a/kernel/kexec.c b/kernel/kexec.c [] @@ -822,13 +822,9 @@ static int kimage_load_normal_segment(struct kimage *image, [] + mchunk = min_t(size_t

Re: [PATCH v2] net: fix functions and variables related to netns_ipvs-sysctl_sync_qlen_max

2013-02-17 Thread Zhang Yanfei
-and-variables-related-to-netns_ipvs-sysctl_sync_qlen_max.patch are joined at the hip and should be redone as a single patch with a suitable changelog, please. And with a cc:net...@vger.kernel.org. Agreed, Zhang Yanfei and Simon? I'm just not sure, may be this combined patch should hit only

[PATCH] IPVS: change type of netns_ipvs-sysctl_sync_qlen_max

2013-02-19 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com This member of struct netns_ipvs is calculated from nr_free_buffer_pages so change its type to unsigned long in case of overflow. Also, type of its related proc var sync_qlen_max and the return type of function sysctl_sync_qlen_max() should be changed

Re: [PATCH] kexec: prevent double free on image allocation failure

2013-02-21 Thread Zhang Yanfei
found another malloc/free problem in this function. So I update the patch. - From 1fb76a35e4109e1435f55048c20ea58622e7f87b Mon Sep 17 00:00:00 2001 From: Zhang Yanfei zhangyan...@cn.fujitsu.com Date: Fri, 22 Feb 2013 10:34:02 +0800 Subject: [PATCH] kexec: fix allocation

Re: [PATCH] kexec: prevent double free on image allocation failure

2013-02-21 Thread Zhang Yanfei
于 2013年02月22日 11:41, Sasha Levin 写道: On 02/21/2013 09:46 PM, Zhang Yanfei wrote: 于 2013年02月22日 09:55, Eric W. Biederman 写道: Sasha Levin sasha.le...@oracle.com writes: If kimage_normal_alloc() fails to initialize an allocated kimage, it will free the image but would still set 'rimage

[PATCH] kexec: fix memory leak in function kimage_normal_alloc

2013-02-21 Thread Zhang Yanfei
...@oracle.com Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c | 18 ++ 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel/kexec.c b/kernel/kexec.c index 5e4bd78..a57face 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -223,6 +223,8

[PATCH] kexec: avoid freeing NULL pointer in function kimage_crash_alloc

2013-02-21 Thread Zhang Yanfei
Though there is no error if we free a NULL pointer, I think we could avoid this behaviour. Change the code a little in kimage_crash_alloc() could avoid this kind of unnecessary free. Cc: Eric W. Biederman ebied...@xmission.com Cc: Andrew Morton a...@linux-foundation.org Signed-off-by: Zhang

[PATCH] kexec: use min_t/max_t to avoid 'if (foo == bar)' thing

2013-02-23 Thread Zhang Yanfei
This is just a tweak: using min_t/max_t to avoid `if (foo = bar)' thing. Cc: Eric W. Biederman ebied...@xmission.com Cc: Andrew Morton a...@linux-foundation.org Cc: Simon Horman ho...@verge.net.au Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- kernel/kexec.c | 20

Re: [PATCH] kexec: use min_t/max_t to avoid 'if (foo == bar)' thing

2013-02-24 Thread Zhang Yanfei
于 2013年02月24日 18:55, Simon Horman 写道: On Sun, Feb 24, 2013 at 12:03:00PM +0800, Zhang Yanfei wrote: This is just a tweak: using min_t/max_t to avoid `if (foo = bar)' thing. - s/=/==/; s/[/]max_t// But in any case the change is more than that. I'd be happier with something like

[PATCH v2] kexec: Use min_t to simplify logic

2013-02-24 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com This is just a tweak: using min_t to simplify logic of variable assignments. v2: - Rewrite patch description as Simon suggested. - Fix an inappropriate if test introduced by v1. Thanks Simon. Cc: Eric W. Biederman ebied...@xmission.com Cc: Andrew

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

2012-07-29 Thread Zhang Yanfei
Hello Avi, Do you have any comments about this version of the patch set? 于 2012年07月12日 17:54, Zhang Yanfei 写道: 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

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

2012-07-12 Thread Zhang Yanfei
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 crash dump as VMCS format. The problem is that VMCS internal is hidden by Intel in its

[PATCH v5 1/3] KVM: Export symbols for module vmcsinfo-intel

2012-07-12 Thread Zhang Yanfei
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 v5 2/3] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO

2012-07-12 Thread Zhang Yanfei
of VMCS fields for guest debugging. + * + * Copyright (C) 2012 Fujitsu, Inc. + * + * Authors: + * Zhang Yanfei zhangyan...@cn.fujitsu.com + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#include linux

[PATCH v5 3/3] Documentation: Add ABI entry for vmcs sysfs interface

2012-07-12 Thread Zhang Yanfei
2012 +Contact: Zhang Yanfei zhangyan...@cn.fujitsu.com +Description: + A collection of vmcs fields' offsets for Intel cpu. + Also including vmcs revision identifier. + + Individual offsets are contained in subfiles named by + the filed's

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

2012-12-06 Thread Zhang Yanfei
unnecessary conditions in function cpu_emergency_clear_loaded_vmcss as Marcelo suggested. Changelog from v1 to v2: 1. remove the sysctl and clear VMCSs unconditionally. Zhang Yanfei (2): x86/kexec: VMCLEAR VMCSs loaded on all cpus if necessary KVM-INTEL: provide the vmclear function

[PATCH v11 1/2] x86/kexec: VMCLEAR VMCSs loaded on all cpus if necessary

2012-12-06 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com 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

Re: [PATCH v11 2/2] KVM-INTEL: provide the vmclear function and a bitmap to support VMCLEAR in kdump

2012-12-06 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com The vmclear function will be assigned to the callback function pointer when loading kvm-intel module. And the bitmap indicates whether we should do VMCLEAR operation in kdump. The bits in the bitmap are set/unset according to different conditions

[PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-06 Thread Zhang Yanfei
This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison expression (different address spaces) Reported-by: kbuild test robot fengguang...@intel.com Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |4

[PATCH] binfmt_elf: remove unused argument in fill_elf_header

2012-12-09 Thread Zhang Yanfei
In function fill_elf_header, elf-e_ident[EI_OSABI] is always set to ELF_OSABI, so remove the unused argument 'osabi'. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- fs/binfmt_elf.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/binfmt_elf.c b/fs

Re: [PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Zhang Yanfei
于 2012年12月11日 04:30, Marcelo Tosatti 写道: On Fri, Dec 07, 2012 at 01:40:56PM +0800, Zhang Yanfei wrote: This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison expression (different address spaces) Reported-by: kbuild test robot fengguang

Re: [PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Zhang Yanfei
于 2012年12月11日 16:10, Gleb Natapov 写道: On Tue, Dec 11, 2012 at 04:04:55PM +0800, Zhang Yanfei wrote: 于 2012年12月11日 04:30, Marcelo Tosatti 写道: On Fri, Dec 07, 2012 at 01:40:56PM +0800, Zhang Yanfei wrote: This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types

[PATCH] [RESEND] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Zhang Yanfei
This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison expression (different address spaces) Reported-by: kbuild test robot fengguang...@intel.com Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |3

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

2012-11-20 Thread Zhang Yanfei
cpu_emergency_clear_loaded_vmcss as Marcelo suggested. Changelog from v1 to v2: 1. remove the sysctl and clear VMCSs unconditionally. Zhang Yanfei (2): x86/kexec: VMCLEAR vmcss on all cpus if necessary KVM-INTEL: add a notifier and a bitmap to support VMCLEAR in kdump arch/x86/include/asm/kexec.h |2 + arch/x86/kernel

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

2012-11-20 Thread Zhang Yanfei
This patch adds an atomic notifier list named crash_notifier_list. When loading kvm-intel module, a notifier will be registered in the list to enable vmcss loaded on all cpus to be VMCLEAR'd if needed. Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/include/asm/kexec.h |2

  1   2   3   4   5   6   7   8   >