[PATCH v2 0/3] Add support for memcpy_mcsafe
by Balbir Singh
memcpy_mcsafe() is an API currently used by the pmem subsystem to convert
errors while doing a memcpy (machine check exception errors) to a return
value. This patchset consists of three patches
1. The first patch is a bug fix to handle machine check errors correctly
while walking the page tables in kernel mode, due to huge pmd/pud sizes
2. The second patch adds memcpy_mcsafe() support, this is largely derived
from existing code
3. The third patch registers for callbacks on machine check exceptions and
in them uses specialized knowledge of the type of page to decide whether
to handle the MCE as is or to return to a fixup address present in
memcpy_mcsafe(). If a fixup address is used, then we return an error
value of -EFAULT to the caller.
Testing
A large part of the testing was done under a simulator by selectively
inserting machine check exceptions in a test driver doing memcpy_mcsafe
via ioctls.
Changelog v2
- Fix the logic of shifting in addr_to_pfn
- Use shift consistently instead of PAGE_SHIFT
- Fix a typo in patch1
Balbir Singh (3):
powerpc/mce: Bug fixes for MCE handling in kernel space
powerpc/memcpy: Add memcpy_mcsafe for pmem
powerpc/mce: Handle memcpy_mcsafe
arch/powerpc/include/asm/mce.h | 3 +-
arch/powerpc/include/asm/string.h | 2 +
arch/powerpc/kernel/mce.c | 77 ++++++++++++-
arch/powerpc/kernel/mce_power.c | 26 +++--
arch/powerpc/lib/Makefile | 2 +-
arch/powerpc/lib/memcpy_mcsafe_64.S | 212 ++++++++++++++++++++++++++++++++++++
6 files changed, 308 insertions(+), 14 deletions(-)
create mode 100644 arch/powerpc/lib/memcpy_mcsafe_64.S
--
2.13.6
4 years, 1 month
[ndctl PATCH 1/2] ndctl: fix potential null dereference in the smart error handler
by Vishal Verma
Static analysis reports that can potentially dereference a NULL pointer
in the smart cmd error handler. This can particular instance won't ever
be hit in practice as the handler is only registered for smart commands,
and smart commands are currently only DIMM commands, and will always
have a dimm object. However for completeness, and to avoid future
errors, we should perform a NULL check in the handler anyway.
Cc: Keith Busch <keith.busch(a)intel.com>
Fixes: ba17700bf227 ("ndctl, intel: Fallback to smart cached shutdown_count")
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
ndctl/lib/intel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ndctl/lib/intel.c b/ndctl/lib/intel.c
index 00c65a5..b1254bb 100644
--- a/ndctl/lib/intel.c
+++ b/ndctl/lib/intel.c
@@ -67,6 +67,9 @@ static int intel_smart_handle_error(struct ndctl_cmd *cmd)
char *path = NULL, shutdown_count[16] = {};
int fd, rc = cmd->status;
+ if (!dimm)
+ return 0;
+
if (asprintf(&path, DEF_TMPFS_DIR "/%s/usc",
ndctl_dimm_get_devname(dimm)) < 0)
return rc;
--
2.14.4
4 years, 1 month
[PATCH V3 0/4] Fix kvm misconceives NVDIMM pages as reserved mmio
by Zhang Yi
For device specific memory space, when we move these area of pfn to
memory zone, we will set the page reserved flag at that time, some of
these reserved for device mmio, and some of these are not, such as
NVDIMM pmem.
Now, we map these dev_dax or fs_dax pages to kvm for DIMM/NVDIMM
backend, since these pages are reserved. the check of
kvm_is_reserved_pfn() misconceives those pages as MMIO. Therefor, we
introduce 2 page map types, MEMORY_DEVICE_FS_DAX/MEMORY_DEVICE_DEV_DAX,
to indentify these pages are from NVDIMM pmem. and let kvm treat these
as normal pages.
Without this patch, Many operations will be missed due to this
mistreatment to pmem pages. For example, a page may not have chance to
be unpinned for KVM guest(in kvm_release_pfn_clean); not able to be
marked as dirty/accessed(in kvm_set_pfn_dirty/accessed) etc.
V1:
https://lkml.org/lkml/2018/7/4/91
V2:
https://lkml.org/lkml/2018/7/10/135
V3:
[PATCH V3 1/4] Needs Comments.
[PATCH V3 2/4] Update the description of MEMORY_DEVICE_DEV_DAX: Jan
[PATCH V3 3/4] Acked-by: Jan in V2
[PATCH V3 4/4] Needs Comments.
Zhang Yi (4):
kvm: remove redundant reserved page check
mm: introduce memory type MEMORY_DEVICE_DEV_DAX
mm: add a function to differentiate the pages is from DAX device
memory
kvm: add a check if pfn is from NVDIMM pmem.
drivers/dax/pmem.c | 1 +
include/linux/memremap.h | 8 ++++++++
include/linux/mm.h | 12 ++++++++++++
virt/kvm/kvm_main.c | 16 ++++++++--------
4 files changed, 29 insertions(+), 8 deletions(-)
--
2.7.4
4 years, 1 month
With love
by aixiskra@j-wave.net
Hi dear!
Today is a magnificent day and i'am in a hurry to get in touch with you!
My name is Melike. I am single woman.
I believe in a destiny with a cheerful future for myself and that you could become a part of it.
I want to be next to a caring man.I love traveling, animals, pop music, going on adventures, and doing spontaneous things, but i feel lonely.
I 'm searching for my second half,who can give me hope and true love!
In the following letters I will send you my beautiful photos and I will tell you more about me!
If you're interested in becoming a part of my adventure and will reply back shortly!
Please write to my personal e-mail - melike29(a)izmirsehri.net
Melike.
4 years, 1 month
[PATCH v2] ACPI: nfit: remove redundant assignment if nfit_mem found
by oceanhehy@gmail.com
From: Ocean He <hehy1(a)lenovo.com>
When nfit_mem is found via list_for_each_entry, it has already been
assigned valid value. There is no need to assign it again in the following
codes.
Signed-off-by: Ocean He <hehy1(a)lenovo.com>
---
v1: https://patchwork.kernel.org/patch/10553277/
v2: Sorry for noise. I got an email problem, so I have to resend to loop
linux-nvdimm(a)lists.01.org.
drivers/acpi/nfit/core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 7c47900..85dde54 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1048,9 +1048,7 @@ static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc,
break;
}
- if (found)
- nfit_mem = found;
- else {
+ if (!found) {
nfit_mem = devm_kzalloc(acpi_desc->dev,
sizeof(*nfit_mem), GFP_KERNEL);
if (!nfit_mem)
--
1.8.3.1
4 years, 1 month
hi!
by audriafb@excite.it
Hi dear!
Today is a magnificent day and i'am in a hurry to get in touch with you!
My name is Melike. I am single woman.
I believe in a destiny with a cheerful future for myself and that you could become a part of it.
I want to be next to a caring man.I love traveling, animals, pop music, going on adventures, and doing spontaneous things, but i feel lonely.
I 'm searching for my second half,who can give me hope and true love!
In the following letters I will send you my beautiful photos and I will tell you more about me!
If you're interested in becoming a part of my adventure and will reply back shortly!
Please write to my personal e-mail - melikepretty(a)izmirsehri.net
Melike.
4 years, 1 month
With love
by ehiaqgsuq@0342.com
Hi dear!
Today is a magnificent day and i'am in a hurry to get in touch with you!
My name is Melike. I am single woman.
I believe in a destiny with a cheerful future for myself and that you could become a part of it.
I want to be next to a caring man.I love traveling, animals, pop music, going on adventures, and doing spontaneous things, but i feel lonely.
I 'm searching for my second half,who can give me hope and true love!
In the following letters I will send you my beautiful photos and I will tell you more about me!
If you're interested in becoming a part of my adventure and will reply back shortly!
Please write to my personal e-mail - melikepretty(a)izmirsehri.net
Melike.
4 years, 1 month
With love
by antbo.tageszeitungwww@bongfaschist.de
Hi dear!
Today is a magnificent day and i'am in a hurry to get in touch with you!
My name is Melike. I am single woman.
I believe in a destiny with a cheerful future for myself and that you could become a part of it.
I want to be next to a caring man.I love traveling, animals, pop music, going on adventures, and doing spontaneous things, but i feel lonely.
I 'm searching for my second half,who can give me hope and true love!
In the following letters I will send you my beautiful photos and I will tell you more about me!
If you're interested in becoming a part of my adventure and will reply back shortly!
Please write to my personal e-mail - melike29(a)izmirsehri.net
Melike.
4 years, 1 month
[ndctl PATCH] ndctl, prepare-release.sh: fix revision update checks
by Vishal Verma
The libtool versioning checks only need to prompt for a 'REVISION'
update if the library source changed. We were triggering that check even
if the utility source had changed. Fix by changing $libdir to the
corresponding */lib/ directory.
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
contrib/prepare-release.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/prepare-release.sh b/contrib/prepare-release.sh
index 45be4d8..5009eec 100755
--- a/contrib/prepare-release.sh
+++ b/contrib/prepare-release.sh
@@ -105,8 +105,8 @@ check_libtool_vers()
{
local lib="$1"
local lib_u="${lib^^}"
- local libdir="${lib##lib}"
- local symfile="${libdir}/lib/${lib}.sym"
+ local libdir="${lib##lib}/lib/"
+ local symfile="${libdir}/${lib}.sym"
local last_cur=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_CURRENT" | cut -d'=' -f2)
local last_rev=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_REVISION" | cut -d'=' -f2)
local last_age=$(git show $last_ref:Makefile.am.in | grep -E "^${lib_u}_AGE" | cut -d'=' -f2)
--
2.14.4
4 years, 1 month
[ndctl PATCHv4] ndctl: Add 'list' verbose options
by Keith Busch
The informational and miscellaneous flag options are becoming more
numerous, and can be difficult to remember what can be listed. This
patch adds a 'verbose' option that increases the detail listed by
automatically enabling options and less essential information.
The verbose option can be repeated multiple times to increase the
detail. There are currently three levels of verbose with output detail
documented in the ndctl list manpage.
Suggested-by: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Keith Busch <keith.busch(a)intel.com>
---
v3 -> v4:
Added the verbose check for namespace numa node (per Ross)
Documentation/ndctl/ndctl-list.txt | 14 ++++++++++++++
ndctl/list.c | 25 ++++++++++++++++++++++++-
ndctl/namespace.c | 2 +-
util/json.c | 32 ++++++++++++++++++++------------
util/json.h | 1 +
5 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt
index 1b5882a..c823493 100644
--- a/Documentation/ndctl/ndctl-list.txt
+++ b/Documentation/ndctl/ndctl-list.txt
@@ -201,6 +201,20 @@ include::xable-region-options.txt[]
]
}
+-v::
+--verbose::
+ Increase verbosity of the output. This can be specified
+ multiple times to be even more verbose on the informational and
+ miscellaneous output, and can be used to override omitted flags
+ for showing specific information. +
+*-v*
+In addition to the enabled namespaces default output, show the numa_node,
+raw_uuid, and bad block media errors. +
+*-vv*
+Everything '-v' provides, plus automatically enable --dimms, --buses, and --regions. +
+*-vvv*
+Everything '-vv' provides, plus --health, --idle, and --firmware.
+
include::human-option.txt[]
----
diff --git a/ndctl/list.c b/ndctl/list.c
index 82e88bb..33f111f 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -36,6 +36,7 @@ static struct {
bool media_errors;
bool human;
bool firmware;
+ int verbose;
} list;
static unsigned long listopts_to_flags(void)
@@ -50,6 +51,8 @@ static unsigned long listopts_to_flags(void)
flags |= UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS;
if (list.human)
flags |= UTIL_JSON_HUMAN;
+ if (list.verbose)
+ flags |= UTIL_JSON_VERBOSE;
return flags;
}
@@ -118,7 +121,7 @@ static struct json_object *region_to_json(struct ndctl_region *region,
json_object_object_add(jregion, "type", jobj);
numa = ndctl_region_get_numa_node(region);
- if (numa >= 0) {
+ if (numa >= 0 && flags & UTIL_JSON_VERBOSE) {
jobj = json_object_new_int(numa);
if (jobj)
json_object_object_add(jregion, "numa_node", jobj);
@@ -452,6 +455,8 @@ int cmd_list(int argc, const char **argv, void *ctx)
"include media errors"),
OPT_BOOLEAN('u', "human", &list.human,
"use human friendly number formats "),
+ OPT_INCR('v', "verbose", &list.verbose,
+ "increase output detail"),
OPT_END(),
};
const char * const u[] = {
@@ -476,6 +481,24 @@ int cmd_list(int argc, const char **argv, void *ctx)
param.mode = "dax";
}
+ switch (list.verbose) {
+ default:
+ case 3:
+ list.idle = true;
+ list.firmware = true;
+ list.health = true;
+ case 2:
+ list.dimms = true;
+ list.buses = true;
+ list.regions = true;
+ case 1:
+ list.media_errors = true;
+ list.namespaces = true;
+ list.dax = true;
+ case 0:
+ break;
+ }
+
if (num_list_flags() == 0)
list.namespaces = true;
diff --git a/ndctl/namespace.c b/ndctl/namespace.c
index cfe0559..510553c 100644
--- a/ndctl/namespace.c
+++ b/ndctl/namespace.c
@@ -423,7 +423,7 @@ static int setup_namespace(struct ndctl_region *region,
error("%s: failed to enable\n",
ndctl_namespace_get_devname(ndns));
} else {
- unsigned long flags = UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS;
+ unsigned long flags = UTIL_JSON_DAX | UTIL_JSON_DAX_DEVS | UTIL_JSON_VERBOSE;
struct json_object *jndns;
if (isatty(1))
diff --git a/util/json.c b/util/json.c
index 1332458..2d15859 100644
--- a/util/json.c
+++ b/util/json.c
@@ -664,6 +664,21 @@ static struct json_object *util_raw_uuid(struct ndctl_namespace *ndns)
return json_object_new_string(buf);
}
+static void util_raw_uuid_to_json(struct ndctl_namespace *ndns,
+ unsigned long flags,
+ struct json_object *jndns)
+{
+ struct json_object *jobj;
+
+ if (!(flags & UTIL_JSON_VERBOSE))
+ return;
+
+ jobj = util_raw_uuid(ndns);
+ if (!jobj)
+ return;
+ json_object_object_add(jndns, "raw_uuid", jobj);
+}
+
struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
unsigned long flags)
{
@@ -752,10 +767,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
if (!jobj)
goto err;
json_object_object_add(jndns, "uuid", jobj);
-
- jobj = util_raw_uuid(ndns);
- if (jobj)
- json_object_object_add(jndns, "raw_uuid", jobj);
+ util_raw_uuid_to_json(ndns, flags, jndns);
bdev = ndctl_btt_get_block_device(btt);
} else if (pfn) {
ndctl_pfn_get_uuid(pfn, uuid);
@@ -764,9 +776,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
if (!jobj)
goto err;
json_object_object_add(jndns, "uuid", jobj);
- jobj = util_raw_uuid(ndns);
- if (jobj)
- json_object_object_add(jndns, "raw_uuid", jobj);
+ util_raw_uuid_to_json(ndns, flags, jndns);
bdev = ndctl_pfn_get_block_device(pfn);
} else if (dax) {
struct daxctl_region *dax_region;
@@ -778,9 +788,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
if (!jobj)
goto err;
json_object_object_add(jndns, "uuid", jobj);
- jobj = util_raw_uuid(ndns);
- if (jobj)
- json_object_object_add(jndns, "raw_uuid", jobj);
+ util_raw_uuid_to_json(ndns, flags, jndns);
if ((flags & UTIL_JSON_DAX) && dax_region) {
jobj = util_daxctl_region_to_json(dax_region, NULL,
flags);
@@ -827,7 +835,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
* happens because they use pre-v1.2 labels or because they
* don't have a label space (devtype=nd_namespace_io).
*/
- if (sector_size < UINT_MAX) {
+ if (sector_size < UINT_MAX && flags & UTIL_JSON_VERBOSE) {
jobj = json_object_new_int(sector_size);
if (!jobj)
goto err;
@@ -857,7 +865,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
}
numa = ndctl_namespace_get_numa_node(ndns);
- if (numa >= 0) {
+ if (numa >= 0 && flags & UTIL_JSON_VERBOSE) {
jobj = json_object_new_int(numa);
if (jobj)
json_object_object_add(jndns, "numa_node", jobj);
diff --git a/util/json.h b/util/json.h
index aa2e976..e292973 100644
--- a/util/json.h
+++ b/util/json.h
@@ -23,6 +23,7 @@ enum util_json_flags {
UTIL_JSON_DAX = (1 << 2),
UTIL_JSON_DAX_DEVS = (1 << 3),
UTIL_JSON_HUMAN = (1 << 4),
+ UTIL_JSON_VERBOSE = (1 << 5),
};
struct json_object;
--
2.14.4
4 years, 1 month