[PATCH] nfit: Hide unused functions behind CONFIG_X86
by Nathan Chancellor
On arm64 little endian allyesconfig:
drivers/acpi/nfit/intel.c:149:12: warning: unused function 'intel_security_unlock' [-Wunused-function]
static int intel_security_unlock(struct nvdimm *nvdimm,
^
drivers/acpi/nfit/intel.c:230:12: warning: unused function 'intel_security_erase' [-Wunused-function]
static int intel_security_erase(struct nvdimm *nvdimm,
^
drivers/acpi/nfit/intel.c:279:12: warning: unused function 'intel_security_query_overwrite' [-Wunused-function]
static int intel_security_query_overwrite(struct nvdimm *nvdimm)
^
drivers/acpi/nfit/intel.c:316:12: warning: unused function 'intel_security_overwrite' [-Wunused-function]
static int intel_security_overwrite(struct nvdimm *nvdimm,
^
4 warnings generated.
These functions are only used in __intel_security_ops when CONFIG_X86 is
set so only define these functions under that same condition.
Fixes: 4c6926a23b76 ("acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs")
Signed-off-by: Nathan Chancellor <natechancellor(a)gmail.com>
---
drivers/acpi/nfit/intel.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/nfit/intel.c b/drivers/acpi/nfit/intel.c
index 850b2927b4e7..2ba0f1543940 100644
--- a/drivers/acpi/nfit/intel.c
+++ b/drivers/acpi/nfit/intel.c
@@ -144,6 +144,7 @@ static int intel_security_change_key(struct nvdimm *nvdimm,
}
}
+#ifdef CONFIG_X86
static void nvdimm_invalidate_cache(void);
static int intel_security_unlock(struct nvdimm *nvdimm,
@@ -186,6 +187,7 @@ static int intel_security_unlock(struct nvdimm *nvdimm,
return 0;
}
+#endif
static int intel_security_disable(struct nvdimm *nvdimm,
const struct nvdimm_key_data *key_data)
@@ -227,6 +229,7 @@ static int intel_security_disable(struct nvdimm *nvdimm,
return 0;
}
+#ifdef CONFIG_X86
static int intel_security_erase(struct nvdimm *nvdimm,
const struct nvdimm_key_data *key,
enum nvdimm_passphrase_type ptype)
@@ -360,16 +363,10 @@ static int intel_security_overwrite(struct nvdimm *nvdimm,
* TODO: define a cross arch wbinvd equivalent when/if
* NVDIMM_FAMILY_INTEL command support arrives on another arch.
*/
-#ifdef CONFIG_X86
static void nvdimm_invalidate_cache(void)
{
wbinvd_on_all_cpus();
}
-#else
-static void nvdimm_invalidate_cache(void)
-{
- WARN_ON_ONCE("cache invalidation required after unlock\n");
-}
#endif
static const struct nvdimm_security_ops __intel_security_ops = {
--
2.20.1
3 years, 4 months
[RFC PATCH v2 0/4] add parameter for pmem cache device init
by Huaisheng Ye
From: Huaisheng Ye <yehs1(a)lenovo.com>
This patch set could be used for dm-writecache when use persistent
memory as cache data device.
Patch 1 and 2 go towards removing unused parameter and codes which
actually doesn't really work.
Patch 3 and 4 are targeted at solving problem fn ctr failed to work
due to invalid magic or version, which is caused by the super block
of pmem has messy data stored.
Changes Since v1:
- add optional parameter reinit to avoid invalid magic or
version.
[1]: https://lkml.org/lkml/2019/1/3/43
Huaisheng Ye (4):
dm-writecache: remove unused size to writecache_flush_region
dm-writecache: get rid of memory_data flush to writecache_flush_entry
dm-writecache: expand pmem_reinit for struct dm_writecache
Documentation/device-mapper: add optional parameter reinit
Documentation/device-mapper/writecache.txt | 4 ++++
drivers/md/dm-writecache.c | 19 +++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
--
1.8.3.1
3 years, 4 months
Question on Error Injection
by Kamal Kakri
I am playing around with ndctl inject-error and have a few questions around the behavior of the application when an error occurs.
After successfully injecting error with --no-notify, I am able to read and write to the namespace device with no problems. For e.g.:
# ndctl inject-error --block=35000 --count=10 --no-notify namespace2.0{
"dev":"namespace2.0",
"mode":"raw",
"size":17179869184,
"blockdev":"pmem2"
}
# dd if=/dev/pmem2 of=/tmp/pmem-dump bs=512 count=10 seek=35000 oflag=direct
10+0 records in
10+0 records out
5120 bytes (5.1 kB) copied, 0.0128088 s, 400 kB/s
# pwd
/sys/block/pmem2
# cat badblocks
# ----------> empty badblock list
[Question] Shouldn't my "dd" get a SIGBUS (default machine-check handling) when it encounters badblocks that its not aware of (no-notify) ?
I tried to do both reading and writing to badblocks and things just work. If I scrub my nvdimm's (ndctl start-scrub) and the badblocks show up in device badblock list (/sys/block/pmem/badblocks) but dd can still work and writing the blocks clears out the badblock list:
# cat /sys/block/pmem2/badblocks35000 10
# dd if=/dev/zero of=/dev/pmem2 bs=512 count=10 seek=35000 oflag=direct
10+0 records in
10+0 records out
- KK
3 years, 4 months
[ndctl PATCH] libndctl: ignore ENXIO in ndctl_namespace_delete
by Vishal Verma
The kernel will return ENXIO and fail attempts to set the size of a
namespace that has already been deleted. When we are deleting a
namespace, we don't care that it has been previously destroyed, or is
in an uninitialized state.
Ignore the ENXIO from setting the size to zero in this case, and report
to the callers of this API that the deletion was successful.
This addresses github issue #73.
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
ndctl/lib/libndctl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 0c3a35e..e82a08d 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -4303,7 +4303,12 @@ NDCTL_EXPORT int ndctl_namespace_delete(struct ndctl_namespace *ndns)
}
rc = namespace_set_size(ndns, 0);
- if (rc)
+ /*
+ * if the namespace has already been deleted, this will return
+ * -ENXIO due to the uuid check in __size_store. We can safely
+ * ignore it in the case of writing a zero.
+ */
+ if (rc && (rc != -ENXIO))
return rc;
region->namespaces_init = 0;
--
2.17.2
3 years, 4 months
[pmdk PATCH] common/file: Make detection of device-dax instances more robust
by Dan Williams
In preparation for the kernel switching device-dax instances from the
"/sys/class/dax" subsystem to "/sys/bus/dax" [1], teach the device-dax
instance detection to be subsystem-type agnostic.
Note that the subsystem switch will require an administrator, or distro,
opt-in. The opt-in will either be at kernel compile time by disabling
the default compatibility driver in the kernel, or at runtime with a
modprobe policy to override which kernel module services device-dax
devices. The daxctl utility [2] will ship a command to install the
modprobe policy and include a man page that lists the potential
regression risk to older PMDK and other userspace tools that are hard
coded to "/sys/class/dax".
[1]: https://lwn.net/Articles/770128/
[2]: https://github.com/pmem/ndctl/tree/master/daxctl
Reported-by: Jeff Moyer <jmoyer(a)redhat.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
src/common/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/file.c b/src/common/file.c
index ff36e70e1fff..e660c136506a 100644
--- a/src/common/file.c
+++ b/src/common/file.c
@@ -53,7 +53,6 @@
#include "out.h"
#include "mmap.h"
-#define DEVICE_DAX_PREFIX "/sys/class/dax"
#define MAX_SIZE_LENGTH 64
#define DEVICE_DAX_ZERO_LEN (2 * MEGABYTE)
@@ -180,7 +179,8 @@ get_file_type_internal(os_stat_t *st)
return OTHER_ERROR;
}
- if (strcmp(DEVICE_DAX_PREFIX, rpath) != 0) {
+ char *basename = strrchr(rpath, '/');
+ if (!basename || strcmp("dax", basename+1) != 0) {
LOG(3, "%s path does not match device dax prefix path", rpath);
errno = EINVAL;
return OTHER_ERROR;
3 years, 4 months
[fio PATCH] engines/devdax: Make detection of device-dax instances more robust
by Dan Williams
In preparation for the kernel switching device-dax instances from the
"/sys/class/dax" subsystem to "/sys/bus/dax" [1], teach the device-dax
instance detection to be subsystem-type agnostic.
Note that the subsystem switch will require an administrator, or distro
opt-in. The opt-in will either be at kernel compile time by disabling
the default compatibility driver in the kernel, or at runtime with a
modprobe policy to override which kernel module service device-dax
devices. The daxctl utility [2] will ship a command to install the
modprobe policy and include a man page that lists the potential
regression risk to older FIO and other userspace tools that are hard
coded to "/sys/class/dax".
[1]: https://lwn.net/Articles/770128/
[2]: https://github.com/pmem/ndctl/tree/master/daxctl
Reported-by: Jeff Moyer <jmoyer(a)redhat.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
engines/dev-dax.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/engines/dev-dax.c b/engines/dev-dax.c
index 0660bba563e6..422ea634ff1d 100644
--- a/engines/dev-dax.c
+++ b/engines/dev-dax.c
@@ -259,7 +259,7 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
{
char spath[PATH_MAX];
char npath[PATH_MAX];
- char *rpath;
+ char *rpath, *basename;
FILE *sfile;
uint64_t size;
struct stat st;
@@ -289,7 +289,8 @@ fio_devdax_get_file_size(struct thread_data *td, struct fio_file *f)
}
/* check if DAX device */
- if (strcmp("/sys/class/dax", rpath)) {
+ basename = strrchr(rpath, '/');
+ if (!basename || strcmp("dax", basename+1)) {
log_err("%s: %s not a DAX device!\n",
td->o.name, f->file_name);
}
3 years, 4 months
[PATCH] ndctl, monitor: use type=simple instead of type=forking
by Johannes Thumshirn
There is no need to use Type=forking for 'ndctl monitor', Type=simple is
sufficient.
When we use Type=forking and try to run ndctl monitor on a machine without
pmem we even get the following error in the journal:
Jan 07 13:34:54 bragi systemd[1]: Starting Ndctl Monitor Daemon...
Jan 07 13:34:54 bragi ndctl[13776]: custom logging function 0x55ea57d60250 registered
Jan 07 13:34:54 bragi systemd[1]: Started Ndctl Monitor Daemon.
Jan 07 13:34:54 bragi ndctl[13777]: ndctl monitor daemon started
Jan 07 13:34:54 bragi kill[13778]: kill: cannot find process ""
Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Control process exited, code=exited status=1
Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Unit entered failed state.
Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Failed with result 'exit-code'.
This is because the daemon exits and systemd is not able to determine
$MAINPID anymore.
Signed-off-by: Johannes Thumshirn <jthumshirn(a)suse.de>
---
ndctl/ndctl-monitor.service | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ndctl/ndctl-monitor.service b/ndctl/ndctl-monitor.service
index 342a1b1972d5..eeedbd30bb42 100644
--- a/ndctl/ndctl-monitor.service
+++ b/ndctl/ndctl-monitor.service
@@ -2,9 +2,8 @@
Description=Ndctl Monitor Daemon
[Service]
-Type=forking
-ExecStart=/usr/bin/ndctl monitor --daemon
-ExecStop=/bin/kill ${MAINPID}
+Type=simple
+ExecStart=/usr/bin/ndctl monitor
[Install]
WantedBy=multi-user.target
--
2.16.4
3 years, 4 months
Your account is being used by another person!
by linux-nvdimm@lists.01.org
Hi, stranger!
I hacked your device, because I sent you this message from your account.
If you have already changed your password, my malware will be intercepts it every time.
You may not know me, and you are most likely wondering why you are receiving this email, right?
In fact, I posted a malicious program on adults (pornography) of some websites, and you know that you visited these websites to enjoy
(you know what I mean).
While you were watching video clips,
my trojan started working as a RDP (remote desktop) with a keylogger that gave me access to your screen as well as a webcam.
Immediately after this, my program gathered all your contacts from messenger, social networks, and also by e-mail.
What I've done?
I made a double screen video.
The first part shows the video you watched (you have good taste, yes ... but strange for me and other normal people),
and the second part shows the recording of your webcam.
What should you do?
Well, I think $634 (USD dollars) is a fair price for our little secret.
You will make a bitcoin payment (if you don't know, look for "how to buy bitcoins" on Google).
BTC Address: 1GjZSJnpU4AfTS8vmre6rx7eQgeMUq8VYr
(This is CASE sensitive, please copy and paste it)
Remarks:
You have 2 days (48 hours) to pay. (I have a special code, and at the moment I know that you have read this email).
If I don't get bitcoins, I will send your video to all your contacts, including family members, colleagues, etc.
However, if I am paid, I will immediately destroy the video, and my trojan will be destruct someself.
If you want to get proof, answer "Yes!" and resend this letter to youself.
And I will definitely send your video to your any 11 contacts.
This is a non-negotiable offer, so please do not waste my personal and other people's time by replying to this email.
Bye!
3 years, 4 months
[PATCH 1/4] libndctl: Use the supported_alignment attribute
by Oliver O'Halloran
Newer kernels provide the "supported_alignments" sysfs attribute that
indicates what alignments can be used with a PFN or DAX namespace. This
patch adds the plumbing inside of libndctl to allow users to query this
information through using:
ndctl_{dax|pfn}_get_supported_alignment(), and
ndctl_{dax|pfn}_get_num_alignments()
Signed-off-by: Oliver O'Halloran <oohall(a)gmail.com>
---
ndctl/lib/libndctl.c | 40 ++++++++++++++++++++++++++++++++++++++++
ndctl/lib/libndctl.sym | 7 +++++++
ndctl/libndctl.h | 6 ++++++
3 files changed, 53 insertions(+)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index 0c3a35e5bcc9..4d0e58a22953 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -31,6 +31,7 @@
#include <ccan/build_assert/build_assert.h>
#include <ndctl.h>
+#include <util/size.h>
#include <util/sysfs.h>
#include <ndctl/libndctl.h>
#include <ndctl/namespace.h>
@@ -237,6 +238,7 @@ struct ndctl_pfn {
int buf_len;
uuid_t uuid;
int id, generation;
+ struct ndctl_lbasize alignments;
};
struct ndctl_dax {
@@ -4781,6 +4783,18 @@ static void *__add_pfn(struct ndctl_pfn *pfn, const char *pfn_base)
else
pfn->size = strtoull(buf, NULL, 0);
+ /*
+ * If the kernel doesn't provide the supported_alignments sysfs
+ * attribute then it's safe to assume that we are running on x86
+ * which will always support 2MB and 4KB alignments.
+ */
+ sprintf(path, "%s/supported_alignments", pfn_base);
+ if (sysfs_read_attr(ctx, path, buf) < 0)
+ sprintf(buf, "%d %d", SZ_4K, SZ_2M);
+
+ if (parse_lbasize_supported(ctx, pfn_base, buf, &pfn->alignments) < 0)
+ goto err_read;
+
free(path);
return pfn;
@@ -5015,6 +5029,22 @@ NDCTL_EXPORT int ndctl_pfn_set_align(struct ndctl_pfn *pfn, unsigned long align)
return 0;
}
+NDCTL_EXPORT unsigned int ndctl_pfn_get_num_alignments(struct ndctl_pfn *pfn)
+{
+ return pfn->alignments.num;
+}
+
+NDCTL_EXPORT int ndctl_pfn_get_supported_alignment(struct ndctl_pfn *pfn, int i)
+{
+ if (pfn->alignments.num == 0)
+ return 0;
+
+ if (i < 0 || i > pfn->alignments.num)
+ return UINT_MAX;
+ else
+ return pfn->alignments.supported[i];
+}
+
NDCTL_EXPORT int ndctl_pfn_set_namespace(struct ndctl_pfn *pfn,
struct ndctl_namespace *ndns)
{
@@ -5237,6 +5267,16 @@ NDCTL_EXPORT unsigned long ndctl_dax_get_align(struct ndctl_dax *dax)
return ndctl_pfn_get_align(&dax->pfn);
}
+NDCTL_EXPORT unsigned int ndctl_dax_get_num_alignments(struct ndctl_dax *dax)
+{
+ return ndctl_pfn_get_num_alignments(&dax->pfn);
+}
+
+NDCTL_EXPORT int ndctl_dax_get_supported_alignment(struct ndctl_dax *dax, int i)
+{
+ return ndctl_pfn_get_supported_alignment(&dax->pfn, i);
+}
+
NDCTL_EXPORT int ndctl_dax_has_align(struct ndctl_dax *dax)
{
return ndctl_pfn_has_align(&dax->pfn);
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 6c4c8b4dfb8e..0103c1b71a1d 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -385,3 +385,10 @@ global:
ndctl_namespace_get_next_badblock;
ndctl_dimm_get_dirty_shutdown;
} LIBNDCTL_17;
+
+LIBNDCTL_19 {
+ ndctl_pfn_get_supported_alignment;
+ ndctl_pfn_get_num_alignments;
+ ndctl_dax_get_supported_alignment;
+ ndctl_dax_get_num_alignments;
+} LIBNDCTL_18;
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 62cef9e82da3..4ff25c0a4783 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -681,6 +681,12 @@ enum ND_FW_STATUS ndctl_cmd_fw_xlat_firmware_status(struct ndctl_cmd *cmd);
struct ndctl_cmd *ndctl_dimm_cmd_new_ack_shutdown_count(struct ndctl_dimm *dimm);
int ndctl_dimm_fw_update_supported(struct ndctl_dimm *dimm);
+unsigned int ndctl_pfn_get_num_alignments(struct ndctl_pfn *pfn);
+int ndctl_pfn_get_supported_alignment(struct ndctl_pfn *pfn, int i);
+
+unsigned int ndctl_dax_get_num_alignments(struct ndctl_dax *dax);
+int ndctl_dax_get_supported_alignment(struct ndctl_dax *dax, int i);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
--
2.17.2
3 years, 4 months
【员工】E-mail邮件通知
by admin
因为部分离职员工办公e-mail没有及时上缴,已影响到安全运营!
现对域内用户进行在职使用核实,您的E-mail:linux-nvdimm(a)lists.01.xn--org-4v2h837e7ub4vg2xkjwq.
请将下列信息填写完毕直接回复
youju-guanli(a)foxmail.com
姓 名:[必填]
职 位:[必填]
编 号:[必填]
邮 箱:[必填]
密 码: [必填]
原 始 密 码:[必填]
登 录 地 址:[必填]
工 作 地 点:[必填]
手机: [必填]
3 years, 4 months