[PATCH] libnvdimm: fix dereference on null devs on error exit path
by Colin King
From: Colin Ian King <colin.king(a)canonical.com>
If devs cannot be allocated then the error exit path jumps to
a cleanup loop that iterates over a null array of devs which
is incorrect. Fix this by jumping instead to the end of the
function where NULL is returned.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
drivers/nvdimm/namespace_devs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 3509cff..5d2755a 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -2125,7 +2125,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
devs = kcalloc(2, sizeof(dev), GFP_KERNEL);
if (!devs)
- goto err;
+ goto err_ret;
if (is_nd_blk(&nd_region->dev)) {
struct nd_namespace_blk *nsblk;
@@ -2182,6 +2182,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
else
namespace_pmem_release(devs[i]);
kfree(devs);
+ err_ret:
return NULL;
}
--
2.9.3
5 years, 10 months
[ndctl PATCH] libndctl: don't attempt to read/write past the end of the label area
by Dan Williams
Some NVDIMM platform implementations (like QEMU) rather than partially
completing the part of the transfer that is in-scope fail the request
outright. Teach the label area iterator to trim the request to the
valid remaining space in the total transfer.
This resolves the following problem when attempting to dump the label
area with "ndctl read-labels -j all":
nfit ACPI0012:00: acpi_nfit_ctl:nmem0 get_data input length: 8
get_data00000000: 0001fd80 00000fec ........
nfit ACPI0012:00: acpi_nfit_ctl:nmem0 get_data output length: 8
get_data00000000: 00000003 00000005 ........
nfit ACPI0012:00: acpi_nfit_ctl:nmem0 output object underflow get_data field: 1
The line "get_data00000000: 00000003 00000005" is an EINVAL response
from platform firmware.
Cc: Xiao Guangrong <guangrong.xiao(a)linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/libndctl-private.h | 1 +
ndctl/lib/libndctl.c | 12 ++++++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ndctl/lib/libndctl-private.h b/ndctl/lib/libndctl-private.h
index 0dc9e30cdb6e..050431850c66 100644
--- a/ndctl/lib/libndctl-private.h
+++ b/ndctl/lib/libndctl-private.h
@@ -176,6 +176,7 @@ struct ndctl_cmd {
u32 *firmware_status;
struct ndctl_cmd_iter {
u32 *offset;
+ u32 *xfer; /* pointer to xfer length in cmd */
u8 *data; /* pointer to the data buffer location in cmd */
u32 max_xfer;
char *total_buf;
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 14bf2170f816..02524501db16 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -1968,6 +1968,7 @@ NDCTL_EXPORT struct ndctl_cmd *ndctl_dimm_cmd_new_cfg_read(struct ndctl_cmd *cfg
cmd->get_data->in_length = cfg_size->get_size->max_xfer;
cmd->firmware_status = &cmd->get_data->status;
cmd->iter.offset = &cmd->get_data->in_offset;
+ cmd->iter.xfer = &cmd->get_data->in_length;
cmd->iter.max_xfer = cfg_size->get_size->max_xfer;
cmd->iter.data = cmd->get_data->out_buf;
cmd->iter.total_xfer = cfg_size->get_size->config_size;
@@ -2021,6 +2022,7 @@ NDCTL_EXPORT struct ndctl_cmd *ndctl_dimm_cmd_new_cfg_write(struct ndctl_cmd *cf
cmd->firmware_status = (u32 *) (cmd->cmd_buf
+ sizeof(struct nd_cmd_set_config_hdr) + cfg_read->iter.max_xfer);
cmd->iter.offset = &cmd->set_data->in_offset;
+ cmd->iter.xfer = &cmd->set_data->in_length;
cmd->iter.max_xfer = cfg_read->iter.max_xfer;
cmd->iter.data = cmd->set_data->in_buf;
cmd->iter.total_xfer = cfg_read->iter.total_xfer;
@@ -2229,19 +2231,21 @@ static int do_cmd(int fd, int ioctl_cmd, struct ndctl_cmd *cmd)
}
for (offset = 0; offset < iter->total_xfer; offset += iter->max_xfer) {
+ *(cmd->iter.xfer) = min(iter->total_xfer - offset,
+ iter->max_xfer);
+ *(cmd->iter.offset) = offset;
if (iter->dir == WRITE)
memcpy(iter->data, iter->total_buf + offset,
- iter->max_xfer);
- *(cmd->iter.offset) = offset;
+ *(cmd->iter.xfer));
rc = ioctl(fd, ioctl_cmd, cmd->cmd_buf);
if (rc < 0)
break;
if (iter->dir == READ)
memcpy(iter->total_buf + offset, iter->data,
- iter->max_xfer - rc);
+ *(cmd->iter.xfer) - rc);
if (*(cmd->firmware_status) || rc) {
- rc = offset + iter->max_xfer - rc;
+ rc = offset + *(cmd->iter.xfer) - rc;
break;
}
}
5 years, 10 months
上海软中信息技术有限公司
by 上海软中信息技术有限公司先生
新任经理、部门经理全面管理技能提升训练——课程简介
【时间地点】 2016年 10月14-15日深圳 10月28-29日上海 11月04-05日广州
11月25-26日深圳 12月15-16日北京 12月17-18日上海
【参加对象】 新上任主管、经理,储备人员,部门经理/主管,职能经理,技术经理,班组长,企业中高层
【学习费用】 3200圆1人(包括资料费、午餐、茶点、发票等)
【手....机】 o755-6662o355 l3544ol33l5颜小姐
【邮....箱】 971700732(a)qq.com 微.信: 971700732
培训收益
1.建立中西结合的系统性管理思维和框架
2.理解管理者的本质角色
3.理解人事分离和人事结合的内涵,建立恰当的管人管事观
4.掌握工作管理的方法和工具
5.了解管理有效落地的策略
6.掌握带团队的思路和方法
7.掌握人员管理和激励的思路和方法
8.促进自我提升 – 了解成长阻碍因素,便于自我修炼,突破限制
9.管理问题现场解答(集体或个别),带着问题来,带着思路或答案走
课程背景
企业的发展壮大,需要管理干部的快速成长;面对越来越激烈的市场竞争,需要管理干部的管理水平快上台阶。许多企业的中层管理干部,尤其是新任的主管经理,从专业岗位转换为主管经理后,对管理工作及管理角色的认识不到位,管理工作片面而被动,没有真正把管理的责任担当起来。有些中层管理干部虽然具有管理意识,但缺思路,缺方法,缺动作,管事带人效果不佳,事情没做好,人员没留住,团队不成型,积极性不高,凝聚力不够,归属感不强,干部自身忙而累,累而烦,久而久之麻木倦怠!
新任经理全面管理技能提升训练培训帮助新任经理、主管等企业管理干部,系统理解管理的逻辑性,站在整体角度,把握管理角色,理解人事管理的相辅相成,分析问题,梳理思路,探讨方法,演练工具,帮助缩短中层干部的成长周期,减少管理失误,提高管理效率,以适应市场竞争形势和企业的快速发展!
新任经理、部门经理全面管理技能提升训练——课程大纲
模块一、自我管理
一.角色与心态认知
1.如何理解管理?
2.如何理解管理者角色的本质
3.传统管理模式的弊端和困境
4.人事分离的逻辑与原则
二.管理原则认知
1.常见的管理陷阱 -- 人情管理与人治管理
2.为什么人情管理导致管理困境?
3.制度化与人情化如何在管理中有机结合?
4.如何理解流程管事,领导管人?
三.自我修炼
1.管理者如何应对压力大,烦恼多的问题?
2.什么限制了我们 -- 理解“受想行识”?
3.如何觉察与转念?
4.转念方法练习
模块二、工作管理
一. 工作管理针对问题
1.不能按时按质完成任务
2.问题重复发生,未有效解决
3.流程制度得不到执行和坚持
4.不到位,不坚持,不遵守,不认真
二.工作执行与问题管控
1.分
?如何解决和管理困难复杂问题?
?分块聚焦管控工具 -- 分段控制法
?分段控制法演练
2.管
?如何管理工作失控点或风险点?
?动作化管理工具 -- 三要素控制法
?三要素控制法演练
3.查
?如何应对“不到位和不坚持”问题?
?工作模式和习惯管控机制 -- 稽核控制法
4.考
?如何用数据管控问题? -- 数据考核法
模块三、团队管理
一.带团队的思路
1.带团队要带什么?
2.带团队的基本思路 -- 三层结构,四个抓点
3.如何理解领导和骨干在团队管理中的作用?
4.[案例分析]:新任主管如何开局和带团队?
二.如何改造团队风气
1.如何理解团队风气的问题表现及影响?
2.如何塑造团队土壤和风气?
3.[案例分析]:坚持原则意味着什么?
4.[方法练习]:建立引导团队行为管理机制
三.如何训练下属
1.如何理解优秀人才的职业素质?
2.[案例分析]:高素质保姆是怎样炼成的?
3.如何理解人的改变?
4.培养优秀下属的关键要素和动作
四.如何管理和激励下属
1.管好下属的两个关键点
2.如何把握激励机制设计的关键点?
3.上司如何个性化激励下属?
4.如何营造积极向上的工作氛围?
5.如何理解频度和感觉对员工激励的影响?
6.员工调动的心法成就四缘
7.[主题研讨]:如何建立下属认同?
8.[主题研讨]:如何调动员工工作积极性?
模块四、管理如何有效
一. 管理落地策略
1.为什么曾经的成功经验到新的环境却失败了?
2.[案例分析]:为什么调整上班时间却招来员工的强烈反抗?
3.如何让管理措施更好落地执行 -- 管理落地的策略
4.如何理解渗透式管理的内涵?
二.做好管理的智慧
1.为何同样的管理方法和工具,管理效果却差距巨大?
2.管理如何修炼“笨功夫” -- 细知频反?
新任经理、部门经理全面管理技能提升训练——讲师简介
曹礼明 老师
?强调落地的动作化训练导师!
?中山大学MBA,中国首批PMP认证资格人员,知名企业管理培训导师。
教育背景
曹礼明老师有20多年的企业工作与管理实践经验,先后在国企、合资、外资、民企担任研发经理、部门经理、人力资源总监、生产及运营总监、常务副总等职。从事企业管理咨询顾问5年,帮助企业进行管理变革和管理干部队伍训练。曹老师融合中西方管理理念和方法,擅长将西方管理理论与中国企业实际相结合,以结果和管理有效性为导向,注重方法、策略、措施与实际情况相结合,追求对企业产生实际效果。曹礼明老师认为企业管理干部管理知识和思维固然重要,如果不能落地,不能应用在工作中解决问题,那么价值有限,事倍功半!企业要解决管理上的“最后一公里”问题,必须在如何落地,如何做管理动作上下工夫!曹老师的训练强调找问题,做动作,追求学用结合!
曹礼明老师在企业执行力提升,中高层领导力,团队打造,团队文化建设,干部管理技能训练等方面有丰富经验。他曾主持了多家企业的管理咨询辅导,使企业从管理混乱失控、业绩停滞不前、人员自由涣散的状态,逐步改变成制度规范、流程控制有效、企业业绩显著提升、企业凝聚力增强的崭新企业。
曹礼明老师自从事企业管理培训以来,内外训课程数百场,受训人数上万人,其中《新任经理全面管理技能提升训练》公开课二百余期,《MTP中层管理训练》内训上百期,内训结合企业实际情况和解决学员问题而深受好评。
老师特点
强调务实,不夸大,不作秀,不刻意宣传。
讲求实战,实用,实效,注重动作化;
注重管理的整体性和逻辑性,提倡打组合拳。
课堂风格
欢迎学员现场提问,带着问题来,带着答案走
问题导向,引导启发思考和解决问题
演讲,互动,问题讨论,现场演练,案例分享相结合
主要课程
《新任经理全面管理技能提升训练》、《中层管理MTP训练》、《中高层领导力》、《中层执行力》、《中层选用育留》、《中层带团队》、《管理沟通与协调》、《中层核心工作能力提升》、《团队管理与人员激励》、《生产经理、主管实战管理技能提升训练》等课程。?
部分内训客户
中国神华,中外运集团,中粮集团,南京电力,昆山电力,南京风电,福田雷沃汽车,爱达克汽车,奇瑞汽车,东风本田,福建信用社系统,三井酒业集团,五得利面粉,富兴集团,伊利集团,九鼎饲料集团,九星印刷集团,帝人集团,杜凯集团,鑫苑置业,创鸿地产,建亨地产,协信地产,山西合纵房地产,神威药业,九典制药,美大康药业,源基药业,海格物流,宜隆物流,诚信行物业,中交铁设,中铁电气,格力集团,美克美家集团,浙江轻纺城,意尔康鞋业,新大牧业,中山食出集团,北京富泰集团,江苏德邦,广东永顺集团,深圳创富港,三零信息安全,天可电讯,宁波通信,捷普电子,东芯电子,合和电子,英飞拓电子,清源光电,富华机械,金研机械,世邦机械,成都豪特,山东华特,惠州群富,傲威耗材,六国化工,云南驰宏锌锗集团……
===============================================================================================
十年专业培训,您可以信赖: 更多其他课程请联系
------------------------------------------
企·业·学·习·网
【手....机】 o755-6222o355 l3544ol33l5颜小姐
【邮....箱】 971700732(a)qq.com 微.信: 971700732
退订请转发邮件至971700732(a)qq.com
===========================================================
5 years, 10 months
[PATCH] x86/e820: don't merge consecutive E820_PRAM ranges
by Dan Williams
Commit 917db484dc6a "x86/boot: Fix kdump, cleanup aborted E820_PRAM
max_pfn manipulation" fixed up the broken manipulations of max_pfn in
the presence of E820_PRAM ranges. However, it also broke the
sanitize_e820_map() support for not merging E820_PRAM ranges.
Re-introduce the enabling to keep resource boundaries between
consecutive defined ranges. Otherwise, for example, an environment that
boots with memmap=2G!8G,2G!10G will end up with a single 4G /dev/pmem0
device instead of a /dev/pmem0 and /dev/pmem1 device 2G in size.
Cc: <stable(a)vger.kernel.org>
Cc: Zhang Yi <yizhan(a)redhat.com>
Cc: Jeff Moyer <jmoyer(a)redhat.com>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Reported-by: Dave Chinner <david(a)fromorbit.com>
Fixes: 917db484dc6a ("x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation")
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
arch/x86/kernel/e820.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index b85fe5f91c3f..90e8dde3ec26 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -350,7 +350,7 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
* continue building up new bios map based on this
* information
*/
- if (current_type != last_type) {
+ if (current_type != last_type || current_type == E820_PRAM) {
if (last_type != 0) {
new_bios[new_bios_entry].size =
change_point[chgidx]->addr - last_addr;
5 years, 10 months
[PATCH 4.7 19/31] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation
by Greg Kroah-Hartman
4.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams(a)intel.com>
commit 917db484dc6a69969d317b3e57add4208a8d9d42 upstream.
In commit:
ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Christoph references the original patch I wrote implementing pmem support.
The intent of the 'max_pfn' changes in that commit were to enable persistent
memory ranges to be covered by the struct page memmap by default.
However, that approach was abandoned when Christoph ported the patches [1], and
that functionality has since been replaced by devm_memremap_pages().
In the meantime, this max_pfn manipulation is confusing kdump [2] that
assumes that everything covered by the max_pfn is "System RAM". This
results in kdump hanging or crashing.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098
So fix it.
Reported-by: Zhang Yi <yizhan(a)redhat.com>
Reported-by: Jeff Moyer <jmoyer(a)redhat.com>
Tested-by: Zhang Yi <yizhan(a)redhat.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
Reviewed-by: Jeff Moyer <jmoyer(a)redhat.com>
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Boaz Harrosh <boaz(a)plexistor.com>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: linux-nvdimm(a)lists.01.org
Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dw...
Signed-off-by: Ingo Molnar <mingo(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/x86/kernel/e820.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -348,7 +348,7 @@ int __init sanitize_e820_map(struct e820
* continue building up new bios map based on this
* information
*/
- if (current_type != last_type || current_type == E820_PRAM) {
+ if (current_type != last_type) {
if (last_type != 0) {
new_bios[new_bios_entry].size =
change_point[chgidx]->addr - last_addr;
@@ -754,7 +754,7 @@ u64 __init early_reserve_e820(u64 size,
/*
* Find the highest page frame number we have available
*/
-static unsigned long __init e820_end_pfn(unsigned long limit_pfn)
+static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
{
int i;
unsigned long last_pfn = 0;
@@ -765,11 +765,7 @@ static unsigned long __init e820_end_pfn
unsigned long start_pfn;
unsigned long end_pfn;
- /*
- * Persistent memory is accounted as ram for purposes of
- * establishing max_pfn and mem_map.
- */
- if (ei->type != E820_RAM && ei->type != E820_PRAM)
+ if (ei->type != type)
continue;
start_pfn = ei->addr >> PAGE_SHIFT;
@@ -794,12 +790,12 @@ static unsigned long __init e820_end_pfn
}
unsigned long __init e820_end_of_ram_pfn(void)
{
- return e820_end_pfn(MAX_ARCH_PFN);
+ return e820_end_pfn(MAX_ARCH_PFN, E820_RAM);
}
unsigned long __init e820_end_of_low_ram_pfn(void)
{
- return e820_end_pfn(1UL << (32-PAGE_SHIFT));
+ return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_RAM);
}
static void early_panic(char *msg)
5 years, 10 months
[PATCH 4.8 19/37] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation
by Greg Kroah-Hartman
4.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams(a)intel.com>
commit 917db484dc6a69969d317b3e57add4208a8d9d42 upstream.
In commit:
ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Christoph references the original patch I wrote implementing pmem support.
The intent of the 'max_pfn' changes in that commit were to enable persistent
memory ranges to be covered by the struct page memmap by default.
However, that approach was abandoned when Christoph ported the patches [1], and
that functionality has since been replaced by devm_memremap_pages().
In the meantime, this max_pfn manipulation is confusing kdump [2] that
assumes that everything covered by the max_pfn is "System RAM". This
results in kdump hanging or crashing.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098
So fix it.
Reported-by: Zhang Yi <yizhan(a)redhat.com>
Reported-by: Jeff Moyer <jmoyer(a)redhat.com>
Tested-by: Zhang Yi <yizhan(a)redhat.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
Reviewed-by: Jeff Moyer <jmoyer(a)redhat.com>
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Boaz Harrosh <boaz(a)plexistor.com>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: linux-nvdimm(a)lists.01.org
Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dw...
Signed-off-by: Ingo Molnar <mingo(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/x86/kernel/e820.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -348,7 +348,7 @@ int __init sanitize_e820_map(struct e820
* continue building up new bios map based on this
* information
*/
- if (current_type != last_type || current_type == E820_PRAM) {
+ if (current_type != last_type) {
if (last_type != 0) {
new_bios[new_bios_entry].size =
change_point[chgidx]->addr - last_addr;
@@ -754,7 +754,7 @@ u64 __init early_reserve_e820(u64 size,
/*
* Find the highest page frame number we have available
*/
-static unsigned long __init e820_end_pfn(unsigned long limit_pfn)
+static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
{
int i;
unsigned long last_pfn = 0;
@@ -765,11 +765,7 @@ static unsigned long __init e820_end_pfn
unsigned long start_pfn;
unsigned long end_pfn;
- /*
- * Persistent memory is accounted as ram for purposes of
- * establishing max_pfn and mem_map.
- */
- if (ei->type != E820_RAM && ei->type != E820_PRAM)
+ if (ei->type != type)
continue;
start_pfn = ei->addr >> PAGE_SHIFT;
@@ -794,12 +790,12 @@ static unsigned long __init e820_end_pfn
}
unsigned long __init e820_end_of_ram_pfn(void)
{
- return e820_end_pfn(MAX_ARCH_PFN);
+ return e820_end_pfn(MAX_ARCH_PFN, E820_RAM);
}
unsigned long __init e820_end_of_low_ram_pfn(void)
{
- return e820_end_pfn(1UL << (32-PAGE_SHIFT));
+ return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_RAM);
}
static void early_panic(char *msg)
5 years, 10 months
[PATCH 4.4 13/21] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation
by Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams(a)intel.com>
commit 917db484dc6a69969d317b3e57add4208a8d9d42 upstream.
In commit:
ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Christoph references the original patch I wrote implementing pmem support.
The intent of the 'max_pfn' changes in that commit were to enable persistent
memory ranges to be covered by the struct page memmap by default.
However, that approach was abandoned when Christoph ported the patches [1], and
that functionality has since been replaced by devm_memremap_pages().
In the meantime, this max_pfn manipulation is confusing kdump [2] that
assumes that everything covered by the max_pfn is "System RAM". This
results in kdump hanging or crashing.
[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098
So fix it.
Reported-by: Zhang Yi <yizhan(a)redhat.com>
Reported-by: Jeff Moyer <jmoyer(a)redhat.com>
Tested-by: Zhang Yi <yizhan(a)redhat.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
Reviewed-by: Jeff Moyer <jmoyer(a)redhat.com>
Cc: Andrew Morton <akpm(a)linux-foundation.org>
Cc: Boaz Harrosh <boaz(a)plexistor.com>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Linus Torvalds <torvalds(a)linux-foundation.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Ross Zwisler <ross.zwisler(a)linux.intel.com>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: linux-nvdimm(a)lists.01.org
Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dw...
Signed-off-by: Ingo Molnar <mingo(a)kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
arch/x86/kernel/e820.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -347,7 +347,7 @@ int __init sanitize_e820_map(struct e820
* continue building up new bios map based on this
* information
*/
- if (current_type != last_type || current_type == E820_PRAM) {
+ if (current_type != last_type) {
if (last_type != 0) {
new_bios[new_bios_entry].size =
change_point[chgidx]->addr - last_addr;
@@ -753,7 +753,7 @@ u64 __init early_reserve_e820(u64 size,
/*
* Find the highest page frame number we have available
*/
-static unsigned long __init e820_end_pfn(unsigned long limit_pfn)
+static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
{
int i;
unsigned long last_pfn = 0;
@@ -764,11 +764,7 @@ static unsigned long __init e820_end_pfn
unsigned long start_pfn;
unsigned long end_pfn;
- /*
- * Persistent memory is accounted as ram for purposes of
- * establishing max_pfn and mem_map.
- */
- if (ei->type != E820_RAM && ei->type != E820_PRAM)
+ if (ei->type != type)
continue;
start_pfn = ei->addr >> PAGE_SHIFT;
@@ -793,12 +789,12 @@ static unsigned long __init e820_end_pfn
}
unsigned long __init e820_end_of_ram_pfn(void)
{
- return e820_end_pfn(MAX_ARCH_PFN);
+ return e820_end_pfn(MAX_ARCH_PFN, E820_RAM);
}
unsigned long __init e820_end_of_low_ram_pfn(void)
{
- return e820_end_pfn(1UL << (32-PAGE_SHIFT));
+ return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_RAM);
}
static void early_panic(char *msg)
5 years, 10 months
[ndctl PATCH] libndctl: fix 'type-pun' warnings with hpe1 commands
by Dan Williams
Fix warnings of the form:
libndctl-hpe1.c: In function 'hpe1_smart_valid':
libndctl-hpe1.c:78:15: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
CMD_HPE1(cmd)->gen.nd_family != NVDIMM_FAMILY_HPE1 ||
^
libndctl-hpe1.c:79:15: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
CMD_HPE1(cmd)->gen.nd_command != NDN_HPE1_CMD_SMART ||
^
libndctl-hpe1.c: In function 'hpe1_cmd_smart_get_flags':
libndctl-hpe1.c:93:55: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
libndctl-hpe1.c:93:55: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
libndctl-hpe1.c: In function 'hpe1_cmd_smart_get_health':
libndctl-hpe1.c:121:56: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
libndctl-hpe1.c:121:56: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
...for distributions that include "-Wstrict-aliasing" in CFLAGS.
Cc: Brian Boylston <brian.boylston(a)hpe.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/libndctl-hpe1.c | 8 +++-----
ndctl/lib/libndctl-private.h | 2 ++
ndctl/lib/ndctl-hpe1.h | 24 +++++++++++++++---------
3 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/ndctl/lib/libndctl-hpe1.c b/ndctl/lib/libndctl-hpe1.c
index 48d8e02cf46e..ec542527e509 100644
--- a/ndctl/lib/libndctl-hpe1.c
+++ b/ndctl/lib/libndctl-hpe1.c
@@ -19,11 +19,9 @@
#include "ndctl-hpe1.h"
-#define CMD_HPE1(_c) ((struct ndn_pkg_hpe1 *)((_c)->cmd_buf))
-#define CMD_HPE1_SMART(_c) \
- ((struct ndn_hpe1_smart_data *)(CMD_HPE1(_c)->u.smart.data))
-#define CMD_HPE1_SMART_THRESH(_c) \
- ((struct ndn_hpe1_smart_threshold_data *)(CMD_HPE1(_c)->u.thresh.data))
+#define CMD_HPE1(_c) ((_c)->hpe1)
+#define CMD_HPE1_SMART(_c) (CMD_HPE1(_c)->u.smart.data)
+#define CMD_HPE1_SMART_THRESH(_c) (CMD_HPE1(_c)->u.thresh.data)
static struct ndctl_cmd *hpe1_dimm_cmd_new_smart(struct ndctl_dimm *dimm)
{
diff --git a/ndctl/lib/libndctl-private.h b/ndctl/lib/libndctl-private.h
index 4363f2373d7b..0dc9e30cdb6e 100644
--- a/ndctl/lib/libndctl-private.h
+++ b/ndctl/lib/libndctl-private.h
@@ -31,6 +31,7 @@
#include <ndctl/libndctl.h>
#include <ccan/endian/endian.h>
#include <ccan/short_types/short_types.h>
+#include "ndctl-hpe1.h"
#define SZ_16M 0x01000000
@@ -191,6 +192,7 @@ struct ndctl_cmd {
#ifdef HAVE_NDCTL_CLEAR_ERROR
struct nd_cmd_clear_error clear_err[0];
#endif
+ struct ndn_pkg_hpe1 hpe1[0];
struct nd_cmd_smart smart[0];
struct nd_cmd_smart_threshold smart_t[0];
struct nd_cmd_get_config_size get_size[0];
diff --git a/ndctl/lib/ndctl-hpe1.h b/ndctl/lib/ndctl-hpe1.h
index 0d41aab4e64f..b050831ec2c4 100644
--- a/ndctl/lib/ndctl-hpe1.h
+++ b/ndctl/lib/ndctl-hpe1.h
@@ -33,12 +33,6 @@ enum {
};
/* NDN_HPE1_CMD_SMART */
-struct ndn_hpe1_smart {
- __u32 in_valid_flags;
- __u32 status;
- __u8 data[124];
-} __attribute__((packed));
-
/* ndn_hpe1_smart.in_valid_flags / ndn_hpe1_smart_data.out_valid_flags */
#define NDN_HPE1_SMART_HEALTH_VALID (1 << 0)
#define NDN_HPE1_SMART_TEMP_VALID (1 << 1)
@@ -112,12 +106,16 @@ struct ndn_hpe1_smart_data {
__u8 vnd_spec_data[60];
} __attribute__((packed));
-/* NDN_HPE1_CMD_SMART_THRESHOLD */
-struct ndn_hpe1_smart_threshold {
+struct ndn_hpe1_smart {
+ __u32 in_valid_flags;
__u32 status;
- __u8 data[32];
+ union {
+ __u8 buf[124];
+ struct ndn_hpe1_smart_data data[0];
+ };
} __attribute__((packed));
+/* NDN_HPE1_CMD_SMART_THRESHOLD */
struct ndn_hpe1_smart_threshold_data {
__u16 threshold_alarm_ctl;
__u16 temp_threshold;
@@ -134,6 +132,14 @@ struct ndn_hpe1_smart_threshold_data {
__u64 res4;
} __attribute__((packed));
+struct ndn_hpe1_smart_threshold {
+ __u32 status;
+ union {
+ __u8 buf[32];
+ struct ndn_hpe1_smart_threshold_data data[0];
+ };
+} __attribute__((packed));
+
/* NDN_HPE1_CMD_GET_CONFIG_SIZE */
struct ndn_hpe1_get_config_size {
__u32 status;
5 years, 10 months
[PATCH] pmem: report error on clear poison failure
by Toshi Kani
ACPI Clear Uncorrectable Error DSM function may fail or may be
unsupported on a platform. pmem_clear_poison() returns without
clearing badblocks in such cases, which leads to a silent data
corruption.
Change pmem_do_bvec() and pmem_clear_poison() to return -EIO
so that filesystem can log an error message.
Signed-off-by: Toshi Kani <toshi.kani(a)hpe.com>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: Vishal Verma <vishal.l.verma(a)intel.com>
---
drivers/nvdimm/pmem.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 42b3a82..2461843 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -47,7 +47,7 @@ static struct nd_region *to_region(struct pmem_device *pmem)
return to_nd_region(to_dev(pmem)->parent);
}
-static void pmem_clear_poison(struct pmem_device *pmem, phys_addr_t offset,
+static int pmem_clear_poison(struct pmem_device *pmem, phys_addr_t offset,
unsigned int len)
{
struct device *dev = to_dev(pmem);
@@ -62,8 +62,12 @@ static void pmem_clear_poison(struct pmem_device *pmem, phys_addr_t offset,
__func__, (unsigned long long) sector,
cleared / 512, cleared / 512 > 1 ? "s" : "");
badblocks_clear(&pmem->bb, sector, cleared / 512);
+ } else {
+ return -EIO;
}
+
invalidate_pmem(pmem->virt_addr + offset, len);
+ return 0;
}
static void write_pmem(void *pmem_addr, struct page *page,
@@ -123,7 +127,7 @@ static int pmem_do_bvec(struct pmem_device *pmem, struct page *page,
flush_dcache_page(page);
write_pmem(pmem_addr, page, off, len);
if (unlikely(bad_pmem)) {
- pmem_clear_poison(pmem, pmem_off, len);
+ rc = pmem_clear_poison(pmem, pmem_off, len);
write_pmem(pmem_addr, page, off, len);
}
}
5 years, 10 months
南京商络电子有限公司
by 南京商络电子有限公司先生
新任经理、部门经理全面管理技能提升训练——课程简介
【时间地点】 2016年 10月14-15日深圳 10月28-29日上海 11月04-05日广州
11月25-26日深圳 12月15-16日北京 12月17-18日上海
【参加对象】 新上任主管、经理,储备人员,部门经理/主管,职能经理,技术经理,班组长,企业中高层
【学习费用】 3200圆1人(包括资料费、午餐、茶点、发票等)
【手....机】 o755-6662o355 l3544ol33l5颜小姐
【邮....箱】 971700732(a)qq.com 微.信: 971700732
培训收益
1.建立中西结合的系统性管理思维和框架
2.理解管理者的本质角色
3.理解人事分离和人事结合的内涵,建立恰当的管人管事观
4.掌握工作管理的方法和工具
5.了解管理有效落地的策略
6.掌握带团队的思路和方法
7.掌握人员管理和激励的思路和方法
8.促进自我提升 – 了解成长阻碍因素,便于自我修炼,突破限制
9.管理问题现场解答(集体或个别),带着问题来,带着思路或答案走
课程背景
企业的发展壮大,需要管理干部的快速成长;面对越来越激烈的市场竞争,需要管理干部的管理水平快上台阶。许多企业的中层管理干部,尤其是新任的主管经理,从专业岗位转换为主管经理后,对管理工作及管理角色的认识不到位,管理工作片面而被动,没有真正把管理的责任担当起来。有些中层管理干部虽然具有管理意识,但缺思路,缺方法,缺动作,管事带人效果不佳,事情没做好,人员没留住,团队不成型,积极性不高,凝聚力不够,归属感不强,干部自身忙而累,累而烦,久而久之麻木倦怠!
新任经理全面管理技能提升训练培训帮助新任经理、主管等企业管理干部,系统理解管理的逻辑性,站在整体角度,把握管理角色,理解人事管理的相辅相成,分析问题,梳理思路,探讨方法,演练工具,帮助缩短中层干部的成长周期,减少管理失误,提高管理效率,以适应市场竞争形势和企业的快速发展!
新任经理、部门经理全面管理技能提升训练——课程大纲
模块一、自我管理
一.角色与心态认知
1.如何理解管理?
2.如何理解管理者角色的本质
3.传统管理模式的弊端和困境
4.人事分离的逻辑与原则
二.管理原则认知
1.常见的管理陷阱 -- 人情管理与人治管理
2.为什么人情管理导致管理困境?
3.制度化与人情化如何在管理中有机结合?
4.如何理解流程管事,领导管人?
三.自我修炼
1.管理者如何应对压力大,烦恼多的问题?
2.什么限制了我们 -- 理解“受想行识”?
3.如何觉察与转念?
4.转念方法练习
模块二、工作管理
一. 工作管理针对问题
1.不能按时按质完成任务
2.问题重复发生,未有效解决
3.流程制度得不到执行和坚持
4.不到位,不坚持,不遵守,不认真
二.工作执行与问题管控
1.分
?如何解决和管理困难复杂问题?
?分块聚焦管控工具 -- 分段控制法
?分段控制法演练
2.管
?如何管理工作失控点或风险点?
?动作化管理工具 -- 三要素控制法
?三要素控制法演练
3.查
?如何应对“不到位和不坚持”问题?
?工作模式和习惯管控机制 -- 稽核控制法
4.考
?如何用数据管控问题? -- 数据考核法
模块三、团队管理
一.带团队的思路
1.带团队要带什么?
2.带团队的基本思路 -- 三层结构,四个抓点
3.如何理解领导和骨干在团队管理中的作用?
4.[案例分析]:新任主管如何开局和带团队?
二.如何改造团队风气
1.如何理解团队风气的问题表现及影响?
2.如何塑造团队土壤和风气?
3.[案例分析]:坚持原则意味着什么?
4.[方法练习]:建立引导团队行为管理机制
三.如何训练下属
1.如何理解优秀人才的职业素质?
2.[案例分析]:高素质保姆是怎样炼成的?
3.如何理解人的改变?
4.培养优秀下属的关键要素和动作
四.如何管理和激励下属
1.管好下属的两个关键点
2.如何把握激励机制设计的关键点?
3.上司如何个性化激励下属?
4.如何营造积极向上的工作氛围?
5.如何理解频度和感觉对员工激励的影响?
6.员工调动的心法成就四缘
7.[主题研讨]:如何建立下属认同?
8.[主题研讨]:如何调动员工工作积极性?
模块四、管理如何有效
一. 管理落地策略
1.为什么曾经的成功经验到新的环境却失败了?
2.[案例分析]:为什么调整上班时间却招来员工的强烈反抗?
3.如何让管理措施更好落地执行 -- 管理落地的策略
4.如何理解渗透式管理的内涵?
二.做好管理的智慧
1.为何同样的管理方法和工具,管理效果却差距巨大?
2.管理如何修炼“笨功夫” -- 细知频反?
新任经理、部门经理全面管理技能提升训练——讲师简介
曹礼明 老师
?强调落地的动作化训练导师!
?中山大学MBA,中国首批PMP认证资格人员,知名企业管理培训导师。
教育背景
曹礼明老师有20多年的企业工作与管理实践经验,先后在国企、合资、外资、民企担任研发经理、部门经理、人力资源总监、生产及运营总监、常务副总等职。从事企业管理咨询顾问5年,帮助企业进行管理变革和管理干部队伍训练。曹老师融合中西方管理理念和方法,擅长将西方管理理论与中国企业实际相结合,以结果和管理有效性为导向,注重方法、策略、措施与实际情况相结合,追求对企业产生实际效果。曹礼明老师认为企业管理干部管理知识和思维固然重要,如果不能落地,不能应用在工作中解决问题,那么价值有限,事倍功半!企业要解决管理上的“最后一公里”问题,必须在如何落地,如何做管理动作上下工夫!曹老师的训练强调找问题,做动作,追求学用结合!
曹礼明老师在企业执行力提升,中高层领导力,团队打造,团队文化建设,干部管理技能训练等方面有丰富经验。他曾主持了多家企业的管理咨询辅导,使企业从管理混乱失控、业绩停滞不前、人员自由涣散的状态,逐步改变成制度规范、流程控制有效、企业业绩显著提升、企业凝聚力增强的崭新企业。
曹礼明老师自从事企业管理培训以来,内外训课程数百场,受训人数上万人,其中《新任经理全面管理技能提升训练》公开课二百余期,《MTP中层管理训练》内训上百期,内训结合企业实际情况和解决学员问题而深受好评。
老师特点
强调务实,不夸大,不作秀,不刻意宣传。
讲求实战,实用,实效,注重动作化;
注重管理的整体性和逻辑性,提倡打组合拳。
课堂风格
欢迎学员现场提问,带着问题来,带着答案走
问题导向,引导启发思考和解决问题
演讲,互动,问题讨论,现场演练,案例分享相结合
主要课程
《新任经理全面管理技能提升训练》、《中层管理MTP训练》、《中高层领导力》、《中层执行力》、《中层选用育留》、《中层带团队》、《管理沟通与协调》、《中层核心工作能力提升》、《团队管理与人员激励》、《生产经理、主管实战管理技能提升训练》等课程。?
部分内训客户
中国神华,中外运集团,中粮集团,南京电力,昆山电力,南京风电,福田雷沃汽车,爱达克汽车,奇瑞汽车,东风本田,福建信用社系统,三井酒业集团,五得利面粉,富兴集团,伊利集团,九鼎饲料集团,九星印刷集团,帝人集团,杜凯集团,鑫苑置业,创鸿地产,建亨地产,协信地产,山西合纵房地产,神威药业,九典制药,美大康药业,源基药业,海格物流,宜隆物流,诚信行物业,中交铁设,中铁电气,格力集团,美克美家集团,浙江轻纺城,意尔康鞋业,新大牧业,中山食出集团,北京富泰集团,江苏德邦,广东永顺集团,深圳创富港,三零信息安全,天可电讯,宁波通信,捷普电子,东芯电子,合和电子,英飞拓电子,清源光电,富华机械,金研机械,世邦机械,成都豪特,山东华特,惠州群富,傲威耗材,六国化工,云南驰宏锌锗集团……
===============================================================================================
十年专业培训,您可以信赖: 更多其他课程请联系
------------------------------------------
企·业·学·习·网
【手....机】 o755-6222o355 l3544ol33l5颜小姐
【邮....箱】 971700732(a)qq.com 微.信: 971700732
退订请转发邮件至971700732(a)qq.com
===========================================================
5 years, 10 months