[PATCH v2 1/6] libnvdimm/namespace: Make namespace size validation arch dependent
by Aneesh Kumar K.V
The page size used to map the namespace is arch dependent. For example
architectures like ppc64 use 16MB page size for direct-mapping. If the namespace
size is not aligned to the mapping page size, we can observe kernel crash
during namespace init and destroy.
This is due to kernel doing partial map/unmap of the resource range
BUG: Unable to handle kernel data access at 0xc001000406000000
Faulting instruction address: 0xc000000000090790
NIP [c000000000090790] arch_add_memory+0xc0/0x130
LR [c000000000090744] arch_add_memory+0x74/0x130
Call Trace:
arch_add_memory+0x74/0x130 (unreliable)
memremap_pages+0x74c/0xa30
devm_memremap_pages+0x3c/0xa0
pmem_attach_disk+0x188/0x770
nvdimm_bus_probe+0xd8/0x470
really_probe+0x148/0x570
driver_probe_device+0x19c/0x1d0
device_driver_attach+0xcc/0x100
bind_store+0x134/0x1c0
drv_attr_store+0x44/0x60
sysfs_kf_write+0x74/0xc0
kernfs_fop_write+0x1b4/0x290
__vfs_write+0x3c/0x70
vfs_write+0xd0/0x260
ksys_write+0xdc/0x130
system_call+0x5c/0x68
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
---
arch/arm64/mm/flush.c | 6 ++++++
arch/powerpc/lib/pmem.c | 10 ++++++++++
arch/x86/mm/pageattr.c | 7 +++++++
include/linux/libnvdimm.h | 1 +
4 files changed, 24 insertions(+)
diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index ac485163a4a7..36b6f6353242 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -91,4 +91,10 @@ void arch_invalidate_pmem(void *addr, size_t size)
__inval_dcache_area(addr, size);
}
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
+
+unsigned long arch_namespace_align_size(void)
+{
+ return PAGE_SIZE;
+}
+EXPORT_SYMBOL_GPL(arch_namespace_align_size);
#endif
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
index 0666a8d29596..8f09d94b1469 100644
--- a/arch/powerpc/lib/pmem.c
+++ b/arch/powerpc/lib/pmem.c
@@ -26,6 +26,16 @@ void arch_invalidate_pmem(void *addr, size_t size)
}
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
+unsigned long arch_namespace_align_size(void)
+{
+
+ if (radix_enabled())
+ return PAGE_SIZE;
+ return (1UL << mmu_psize_defs[mmu_linear_psize].shift);
+
+}
+EXPORT_SYMBOL_GPL(arch_namespace_align_size);
+
/*
* CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE symbols
*/
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 0d09cc5aad61..51b8d11e7b94 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -310,6 +310,13 @@ void arch_invalidate_pmem(void *addr, size_t size)
}
EXPORT_SYMBOL_GPL(arch_invalidate_pmem);
+unsigned long arch_namespace_align_size(void)
+{
+ return PAGE_SIZE;
+}
+EXPORT_SYMBOL_GPL(arch_namespace_align_size);
+
+
static void __cpa_flush_all(void *arg)
{
unsigned long cache = (unsigned long)arg;
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index b6eddf912568..72d583fa9954 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -291,4 +291,5 @@ static inline void arch_invalidate_pmem(void *addr, size_t size)
}
#endif
+unsigned long arch_namespace_align_size(void);
#endif /* __LIBNVDIMM_H__ */
--
2.23.0
1 year, 1 month
[daxctl PATCH] daxctl/list: Avoid memory operations without
resource data
by Dan Williams
Resource data is restricted to root-only, and "daxctl list" is likely to
be run by non-root. Skip listing memory-object details when the resource
is not available.
Otherwise, "daxctl list" from non-root emits:
libdaxctl: memblock_in_dev: dax1.0: Unable to determine resource
Reported-by: Michal Biesek <michal.biesek(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
util/json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/json.c b/util/json.c
index 0abaf3a5b9c2..6745bcc19058 100644
--- a/util/json.c
+++ b/util/json.c
@@ -306,7 +306,7 @@ struct json_object *util_daxctl_dev_to_json(struct daxctl_dev *dev,
if (jobj)
json_object_object_add(jdev, "mode", jobj);
- if (mem) {
+ if (mem && daxctl_dev_get_resource(dev) != 0) {
movable = daxctl_memory_is_movable(mem);
if (movable == 1)
jobj = json_object_new_boolean(true);
1 year, 1 month
Your account was under attack! Change your access data!
by lucdiasgoncalves@hotimail.com
Hello!
I have very bad news for you.
11/08/2019 - on this day I hacked your OS and got full access to your account linux-nvdimm(a)lists.01.org.
So, you can change the password, yes.. But my malware intercepts it every time.
How I made it:
In the software of the router, through which you went online, was a vulnerability.
I just hacked this router and placed my malicious code on it.
When you went online, my trojan was installed on the OS of your device.
After that, I made a full dump of your disk (I have all your address book, history of viewing sites, all files, phone numbers and addresses of all your contacts).
A month ago, I wanted to lock your device and ask for a not big amount of btc to unlock.
But I looked at the sites that you regularly visit, and I was shocked by what I saw!!!
I'm talk you about sites for adults.
I want to say - you are a BIG pervert. Your fantasy is shifted far away from the normal course!
And I got an idea....
I made a screenshot of the adult sites where you have fun (do you understand what it is about, huh?).
After that, I made a screenshot of your joys (using the camera of your device) and glued them together.
Turned out amazing! You are so spectacular!
I'm know that you would not like to show these screenshots to your friends, relatives or colleagues.
I think $937 is a very, very small amount for my silence.
Besides, I have been spying on you for so long, having spent a lot of time!
Pay ONLY in Bitcoins!
My BTC wallet: 1PgnnLkZfG4NuSU6aTK2xtJWwg9nzuCM1A
You do not know how to use bitcoins?
Enter a query in any search engine: "how to replenish btc wallet".
It's extremely easy
For this payment I give you two days (48 hours).
As soon as this letter is opened, the timer will work.
After payment, my virus and dirty screenshots with your enjoys will be self-destruct automatically.
If I do not receive from you the specified amount, then your device will be locked, and all your contacts will receive a screenshots with your "enjoys".
I hope you understand your situation.
- Do not try to find and destroy my virus! (All your data, files and screenshots is already uploaded to a remote server)
- Do not try to contact me (this is not possible, the sender is randomized automatically)
- Various security services will not help you; formatting a disk or destroying a device will not help, since your data is already on a remote server.
P.S. You are not my single victim. so, I guarantee you that I will not disturb you again after payment!
This is the word of honor hacker.
I also ask you to regularly update your antiviruses in the future. This way you will no longer fall into a similar situation.
Do not hold evil! I just do my job.
Good luck.
1 year, 1 month
[PATCH 1/2] rename nfit_test_bus with a more generic name
by Santosh Sivaraj
This cleanup would avoid confusion when ndctl is used for testing
on non-nfit platforms.
Signed-off-by: Santosh Sivaraj <santosh(a)fossix.org>
---
test/blk-exhaust.sh | 14 +++++++-------
test/btt-check.sh | 8 ++++----
test/btt-errors.sh | 22 +++++++++++-----------
test/btt-pad-compat.sh | 12 ++++++------
test/clear.sh | 12 ++++++------
test/common | 10 +++++-----
test/create.sh | 10 +++++-----
test/daxdev-errors.sh | 14 +++++++-------
test/firmware-update.sh | 8 ++++----
test/inject-error.sh | 8 ++++----
test/inject-smart.sh | 2 +-
test/label-compat.sh | 10 +++++-----
test/max_available_extent_ns.sh | 8 ++++----
test/monitor.sh | 10 +++++-----
test/multi-dax.sh | 12 ++++++------
test/pfn-meta-errors.sh | 8 ++++----
test/pmem-errors.sh | 8 ++++----
test/rescan-partitions.sh | 8 ++++----
test/sector-mode.sh | 14 +++++++-------
test/security.sh | 14 +++++++-------
20 files changed, 106 insertions(+), 106 deletions(-)
diff --git a/test/blk-exhaust.sh b/test/blk-exhaust.sh
index 326ce73..067ed27 100755
--- a/test/blk-exhaust.sh
+++ b/test/blk-exhaust.sh
@@ -23,17 +23,17 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
# if the kernel accounting is correct we should be able to create two
# pmem and two blk namespaces on nfit_test.0
rc=1
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw
+$NDCTL create-namespace -b $TEST_BUS0 -t pmem
+$NDCTL create-namespace -b $TEST_BUS0 -t pmem
+$NDCTL create-namespace -b $TEST_BUS0 -t blk -m raw
+$NDCTL create-namespace -b $TEST_BUS0 -t blk -m raw
# clearnup and exit
_cleanup
diff --git a/test/btt-check.sh b/test/btt-check.sh
index ceabee5..c91a5ad 100755
--- a/test/btt-check.sh
+++ b/test/btt-check.sh
@@ -37,7 +37,7 @@ check_min_kver "4.14" || do_skip "may not support badblocks clearing on pmem via
create()
{
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m sector)
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m sector)
rc=2
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
@@ -50,9 +50,9 @@ create()
reset()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
# re-enable the BTT namespace, and do IO to it in an attempt to
diff --git a/test/btt-errors.sh b/test/btt-errors.sh
index cb35865..65224b3 100755
--- a/test/btt-errors.sh
+++ b/test/btt-errors.sh
@@ -54,15 +54,15 @@ trap 'err $LINENO cleanup' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
# create a btt namespace and clear errors (if any)
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m sector)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m sector)
eval "$(echo "$json" | json2var)"
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
@@ -135,11 +135,11 @@ dd if=$MNT/$FILE of=/dev/null iflag=direct bs=4096 count=1
# reset everything to get a clean log
if grep -q "$MNT" /proc/mounts; then umount $MNT; fi
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m sector)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m sector)
eval "$(echo "$json" | json2var)"
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
@@ -157,8 +157,8 @@ force_raw 0
dd if=/dev/$blockdev of=/dev/null iflag=direct bs=4096 count=1 && err $LINENO || true
# done, exit
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
_cleanup
exit 0
diff --git a/test/btt-pad-compat.sh b/test/btt-pad-compat.sh
index 2c1f271..a5fc796 100755
--- a/test/btt-pad-compat.sh
+++ b/test/btt-pad-compat.sh
@@ -31,7 +31,7 @@ trap 'err $LINENO' ERR
create()
{
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m sector)
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m sector)
rc=2
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
@@ -47,9 +47,9 @@ create()
reset()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
verify_idx()
@@ -120,7 +120,7 @@ create_oldfmt_ns()
# that supports a raw namespace with a 4K sector size, prior to
# v4.13 raw namespaces are limited to 512-byte sector size.
rc=77
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -s 64M -t pmem -m raw -l 4096 -u 00000000-0000-0000-0000-000000000000)
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -s 64M -t pmem -m raw -l 4096 -u 00000000-0000-0000-0000-000000000000)
rc=2
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
@@ -128,7 +128,7 @@ create_oldfmt_ns()
[ $size -gt 0 ] || err "$LINENO"
# reconfig it to sector mode
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -e $dev -m sector --force)
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -e $dev -m sector --force)
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
[ -n "$size" ] || err "$LINENO"
diff --git a/test/clear.sh b/test/clear.sh
index 17d5bed..f0b4a9b 100755
--- a/test/clear.sh
+++ b/test/clear.sh
@@ -23,15 +23,15 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
# create pmem
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m raw)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m raw)
eval $(echo $json | json2var)
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
[ $mode != "raw" ] && echo "fail: $LINENO" && exit 1
@@ -73,8 +73,8 @@ fi
if check_min_kver "4.9"; then
# check for re-appearance of stale badblocks from poison_list
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
# since we have cleared the errors, a disable/reenable shouldn't bring them back
if read sector len < /sys/block/$blockdev/badblocks; then
diff --git a/test/common b/test/common
index 1814a0c..54085ae 100644
--- a/test/common
+++ b/test/common
@@ -27,10 +27,10 @@ else
fi
-# NFIT_TEST_BUS[01]
+# TEST_BUS[01]
#
-NFIT_TEST_BUS0="nfit_test.0"
-NFIT_TEST_BUS1="nfit_test.1"
+TEST_BUS0="nfit_test.0"
+TEST_BUS1="nfit_test.1"
ACPI_BUS="ACPI.NFIT"
E820_BUS="e820"
@@ -82,8 +82,8 @@ check_prereq()
#
_cleanup()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL disable-region -b $NFIT_TEST_BUS1 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS1 all
modprobe -r nfit_test
}
diff --git a/test/create.sh b/test/create.sh
index 8d78797..1398c79 100755
--- a/test/create.sh
+++ b/test/create.sh
@@ -24,15 +24,15 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
# create pmem
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m raw)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m raw)
eval $(echo $json | json2var )
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
[ $mode != "raw" ] && echo "fail: $LINENO" && exit 1
@@ -53,7 +53,7 @@ $NDCTL destroy-namespace -f $dev
# create blk
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw -v)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t blk -m raw -v)
eval $(echo $json | json2var)
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
[ $mode != "raw" ] && echo "fail: $LINENO" && exit 1
diff --git a/test/daxdev-errors.sh b/test/daxdev-errors.sh
index c5adb72..c877874 100755
--- a/test/daxdev-errors.sh
+++ b/test/daxdev-errors.sh
@@ -23,16 +23,16 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
query=". | sort_by(.available_size) | reverse | .[0].dev"
-region=$($NDCTL list -b $NFIT_TEST_BUS0 -t pmem -Ri | jq -r "$query")
+region=$($NDCTL list -b $TEST_BUS0 -t pmem -Ri | jq -r "$query")
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a 4096)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -r $region -t pmem -m devdax -a 4096)
chardev=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev")
#{
@@ -53,11 +53,11 @@ chardev=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[
# }
#}
-json1=$($NDCTL list -b $NFIT_TEST_BUS0 --mode=devdax --namespaces)
+json1=$($NDCTL list -b $TEST_BUS0 --mode=devdax --namespaces)
eval $(echo $json1 | json2var)
nsdev=$dev
-json1=$($NDCTL list -b $NFIT_TEST_BUS0)
+json1=$($NDCTL list -b $TEST_BUS0)
eval $(echo $json1 | json2var)
busdev=$dev
diff --git a/test/firmware-update.sh b/test/firmware-update.sh
index 7852e58..dbd5c7f 100755
--- a/test/firmware-update.sh
+++ b/test/firmware-update.sh
@@ -12,9 +12,9 @@ trap 'err $LINENO' ERR
reset()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
if [ -f $image ]; then
rm -f $image
fi
@@ -22,7 +22,7 @@ reset()
detect()
{
- dev=$($NDCTL list -b $NFIT_TEST_BUS0 -D | jq .[0].dev | tr -d '"')
+ dev=$($NDCTL list -b $TEST_BUS0 -D | jq .[0].dev | tr -d '"')
[ -n "$dev" ] || err "$LINENO"
}
diff --git a/test/inject-error.sh b/test/inject-error.sh
index 49e68b3..3e33a1b 100755
--- a/test/inject-error.sh
+++ b/test/inject-error.sh
@@ -35,7 +35,7 @@ check_min_kver "4.15" || do_skip "kernel $KVER may not support error injection"
create()
{
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem --align=4k)
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem --align=4k)
rc=2
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
@@ -46,9 +46,9 @@ create()
reset()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
check_status()
diff --git a/test/inject-smart.sh b/test/inject-smart.sh
index 18655ba..fa18a58 100755
--- a/test/inject-smart.sh
+++ b/test/inject-smart.sh
@@ -4,7 +4,7 @@
rc=77
. ./common
-bus="$NFIT_TEST_BUS0"
+bus="$TEST_BUS0"
inj_val="42"
trap 'err $LINENO' ERR
diff --git a/test/label-compat.sh b/test/label-compat.sh
index dc6226d..a31bf4a 100755
--- a/test/label-compat.sh
+++ b/test/label-compat.sh
@@ -23,12 +23,12 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
-# grab the largest pmem region on -b $NFIT_TEST_BUS0
+# grab the largest pmem region on -b $TEST_BUS0
query=". | sort_by(.available_size) | reverse | .[0].dev"
-region=$($NDCTL list -b $NFIT_TEST_BUS0 -t pmem -Ri | jq -r "$query")
+region=$($NDCTL list -b $TEST_BUS0 -t pmem -Ri | jq -r "$query")
# we assume that $region is comprised of 4 dimms
query=". | .regions[0].mappings | sort_by(.dimm) | .[].dimm"
@@ -40,7 +40,7 @@ do
i=$((i+1))
done
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
len=$($NDCTL list -r $region -N | jq -r "length")
diff --git a/test/max_available_extent_ns.sh b/test/max_available_extent_ns.sh
index 1c7e7bf..5701195 100755
--- a/test/max_available_extent_ns.sh
+++ b/test/max_available_extent_ns.sh
@@ -13,14 +13,14 @@ check_min_kver "4.19" || do_skip "kernel $KVER may not support max_available_siz
init()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
do_test()
{
- region=$($NDCTL list -b $NFIT_TEST_BUS0 -R -t pmem | jq -r 'sort_by(-.size) | .[].dev' | head -1)
+ region=$($NDCTL list -b $TEST_BUS0 -R -t pmem | jq -r 'sort_by(-.size) | .[].dev' | head -1)
available_sz=$($NDCTL list -r $region | jq -r .[].available_size)
size=$(( available_sz/4 ))
diff --git a/test/monitor.sh b/test/monitor.sh
index 29d4ea1..c9f7224 100755
--- a/test/monitor.sh
+++ b/test/monitor.sh
@@ -20,9 +20,9 @@ check_min_kver "4.15" || do_skip "kernel $KVER may not support monitor service"
init()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
start_monitor()
@@ -36,10 +36,10 @@ start_monitor()
set_smart_supported_bus()
{
- smart_supported_bus=$NFIT_TEST_BUS0
+ smart_supported_bus=$TEST_BUS0
monitor_dimms=$(./list-smart-dimm -b $smart_supported_bus | jq -r .[0].dev)
if [ -z $monitor_dimms ]; then
- smart_supported_bus=$NFIT_TEST_BUS1
+ smart_supported_bus=$TEST_BUS1
fi
}
diff --git a/test/multi-dax.sh b/test/multi-dax.sh
index 0829bf2..1dca352 100755
--- a/test/multi-dax.sh
+++ b/test/multi-dax.sh
@@ -23,17 +23,17 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
query=". | sort_by(.available_size) | reverse | .[0].dev"
-region=$($NDCTL list -b $NFIT_TEST_BUS0 -t pmem -Ri | jq -r "$query")
+region=$($NDCTL list -b $TEST_BUS0 -t pmem -Ri | jq -r "$query")
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M)
chardev1=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev")
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -r $region -t pmem -m devdax -a 4096 -s 16M)
chardev2=$(echo $json | jq ". | select(.mode == \"devdax\") | .daxregion.devices[0].chardev")
_cleanup
diff --git a/test/pfn-meta-errors.sh b/test/pfn-meta-errors.sh
index 2b57f19..f930325 100755
--- a/test/pfn-meta-errors.sh
+++ b/test/pfn-meta-errors.sh
@@ -30,15 +30,15 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
# create a fsdax namespace and clear errors (if any)
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m fsdax)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m fsdax)
eval "$(echo "$json" | json2var)"
[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
diff --git a/test/pmem-errors.sh b/test/pmem-errors.sh
index 9553a3f..8ce57c8 100755
--- a/test/pmem-errors.sh
+++ b/test/pmem-errors.sh
@@ -28,15 +28,15 @@ trap 'err $LINENO cleanup' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
rc=1
# create pmem
dev="x"
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m raw)
+json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m raw)
eval $(echo $json | json2var)
[ $dev = "x" ] && echo "fail: $LINENO" && false
[ $mode != "raw" ] && echo "fail: $LINENO" && false
diff --git a/test/rescan-partitions.sh b/test/rescan-partitions.sh
index 9c7b7a0..5e01665 100755
--- a/test/rescan-partitions.sh
+++ b/test/rescan-partitions.sh
@@ -27,9 +27,9 @@ check_prereq "blockdev"
reset()
{
- $NDCTL disable-region -b $NFIT_TEST_BUS0 all
- $NDCTL zero-labels -b $NFIT_TEST_BUS0 all
- $NDCTL enable-region -b $NFIT_TEST_BUS0 all
+ $NDCTL disable-region -b $TEST_BUS0 all
+ $NDCTL zero-labels -b $TEST_BUS0 all
+ $NDCTL enable-region -b $TEST_BUS0 all
}
test_mode()
@@ -37,7 +37,7 @@ test_mode()
local mode="$1"
# create namespace
- json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem -m "$mode")
+ json=$($NDCTL create-namespace -b $TEST_BUS0 -t pmem -m "$mode")
rc=2
eval "$(echo "$json" | json2var)"
[ -n "$dev" ] || err "$LINENO"
diff --git a/test/sector-mode.sh b/test/sector-mode.sh
index 4b964c5..7f60452 100755
--- a/test/sector-mode.sh
+++ b/test/sector-mode.sh
@@ -20,17 +20,17 @@ trap 'err $LINENO' ERR
# setup (reset nfit_test dimms)
modprobe nfit_test
-$NDCTL disable-region -b $NFIT_TEST_BUS0 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
-$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+$NDCTL disable-region -b $TEST_BUS0 all
+$NDCTL zero-labels -b $TEST_BUS0 all
+$NDCTL enable-region -b $TEST_BUS0 all
-$NDCTL disable-region -b $NFIT_TEST_BUS1 all
-$NDCTL zero-labels -b $NFIT_TEST_BUS1 all
-$NDCTL enable-region -b $NFIT_TEST_BUS1 all
+$NDCTL disable-region -b $TEST_BUS1 all
+$NDCTL zero-labels -b $TEST_BUS1 all
+$NDCTL enable-region -b $TEST_BUS1 all
rc=1
query=". | sort_by(.size) | reverse | .[0].dev"
-NAMESPACE=$($NDCTL list -b $NFIT_TEST_BUS1 -N | jq -r "$query")
+NAMESPACE=$($NDCTL list -b $TEST_BUS1 -N | jq -r "$query")
REGION=$($NDCTL list -R --namespace=$NAMESPACE | jq -r "(.[]) | .dev")
echo 0 > /sys/bus/nd/devices/$REGION/read_only
$NDCTL create-namespace --no-autolabel -e $NAMESPACE -m sector -f -l 4K
diff --git a/test/security.sh b/test/security.sh
index c86d2c6..80d64df 100755
--- a/test/security.sh
+++ b/test/security.sh
@@ -17,14 +17,14 @@ trap 'err $LINENO' ERR
setup()
{
- $NDCTL disable-region -b "$NFIT_TEST_BUS0" all
+ $NDCTL disable-region -b "$TEST_BUS0" all
}
detect()
{
- dev="$($NDCTL list -b "$NFIT_TEST_BUS0" -D | jq -r .[0].dev)"
+ dev="$($NDCTL list -b "$TEST_BUS0" -D | jq -r .[0].dev)"
[ -n "$dev" ] || err "$LINENO"
- id="$($NDCTL list -b "$NFIT_TEST_BUS0" -D | jq -r .[0].id)"
+ id="$($NDCTL list -b "$TEST_BUS0" -D | jq -r .[0].id)"
[ -n "$id" ] || err "$LINENO"
}
@@ -83,9 +83,9 @@ lock_dimm()
# inline. Once a subsequent user arrives we can refactor this to a
# helper in test/common:
# get_test_dimm_path "nfit_test.0" "nmem3"
- handle="$($NDCTL list -b "$NFIT_TEST_BUS0" -d "$dev" -i | jq -r .[].dimms[0].handle)"
+ handle="$($NDCTL list -b "$TEST_BUS0" -d "$dev" -i | jq -r .[].dimms[0].handle)"
test_dimm_path=""
- for test_dimm in /sys/devices/platform/"$NFIT_TEST_BUS0"/nfit_test_dimm/test_dimm*; do
+ for test_dimm in /sys/devices/platform/"$TEST_BUS0"/nfit_test_dimm/test_dimm*; do
td_handle_file="$test_dimm/handle"
test -e "$td_handle_file" || continue
td_handle="$(cat "$td_handle_file")"
@@ -107,7 +107,7 @@ lock_dimm()
get_security_state()
{
- $NDCTL list -i -b "$NFIT_TEST_BUS0" -d "$dev" | jq -r .[].dimms[0].security
+ $NDCTL list -i -b "$TEST_BUS0" -d "$dev" | jq -r .[].dimms[0].security
}
setup_passphrase()
@@ -184,7 +184,7 @@ test_4_security_unlock()
echo "Incorrect security state: $sstate expected: unlocked"
err "$LINENO"
fi
- $NDCTL disable-region -b "$NFIT_TEST_BUS0" all
+ $NDCTL disable-region -b "$TEST_BUS0" all
remove_passphrase
}
--
2.21.0
1 year, 1 month
[GIT PULL] ACPI updates for v5.5-rc1
by Rafael J. Wysocki
Hi Linus,
Please pull from the tag
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
acpi-5.5-rc1
with top-most commit 782b59711e1561ee0da06bc478ca5e8249aa8d09
Merge branch 'acpi-mm'
on top of commit 31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c
Linux 5.4-rc7
to receive ACPI update for 5.5-rc1.
These update the ACPICA code in the kernel to upstream revision
20191018, add support for EFI specific purpose memory, update the
ACPI EC driver to make it work on systems with hardware-reduced ACPI,
improve ACPI-based device enumeration for some platforms, rework the
lid blacklist handling in the button driver and add more lid quirks
to it, unify ACPI _HID/_UID matching, fix assorted issues and clean
up the code and documentation.
Specifics:
- Update the ACPICA code in the kernel to upstream revision 20191018
including:
* Fixes for Clang warnings (Bob Moore).
* Fix for possible overflow in get_tick_count() (Bob Moore).
* Introduction of acpi_unload_table() (Bob Moore).
* Debugger and utilities updates (Erik Schmauss).
* Fix for unloading tables loaded via configfs (Nikolaus Voss).
- Add support for EFI specific purpose memory to optionally allow
either application-exclusive or core-kernel-mm managed access to
differentiated memory (Dan Williams).
- Fix and clean up processing of the HMAT table (Brice Goglin,
Qian Cai, Tao Xu).
- Update the ACPI EC driver to make it work on systems with
hardware-reduced ACPI (Daniel Drake).
- Always build in support for the Generic Event Device (GED) to
allow one kernel binary to work both on systems with full
hardware ACPI and hardware-reduced ACPI (Arjan van de Ven).
- Fix the table unload mechanism to unregister platform devices
created when the given table was loaded (Andy Shevchenko).
- Rework the lid blacklist handling in the button driver and add
more lid quirks to it (Hans de Goede).
- Improve ACPI-based device enumeration for some platforms based
on Intel BayTrail SoCs (Hans de Goede).
- Add an OpRegion driver for the Cherry Trail Crystal Cove PMIC
and prevent handlers from being registered for unhandled PMIC
OpRegions (Hans de Goede).
- Unify ACPI _HID/_UID matching (Andy Shevchenko).
- Clean up documentation and comments (Cao jin, James Pack, Kacper
Piwiński).
Thanks!
---------------
Andy Shevchenko (7):
ACPI / utils: Describe function parameters in kernel-doc
ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI
ACPI / utils: Introduce acpi_dev_hid_uid_match() helper
ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()
mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()
iommu/amd: Switch to use acpi_dev_hid_uid_match()
ACPI: platform: Unregister stale platform devices
Arjan van de Ven (1):
ACPI: Always build evged in
Bob Moore (5):
ACPICA: Results from Clang
ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
ACPICA: More Clang changes
ACPICA: Add new external interface, acpi_unload_table()
ACPICA: Update version to 20191018
Brice Goglin (1):
ACPI: HMAT: don't mix pxm and nid when setting memory target processor_pxm
Cao jin (1):
ACPI: OSI: Shoot duplicate word
Dan Williams (12):
ACPI: NUMA: Establish a new drivers/acpi/numa/ directory
efi: Enumerate EFI_MEMORY_SP
x86/efi: Push EFI_MEMMAP check into leaf routines
efi: Common enable/disable infrastructure for EFI soft reservation
x86/efi: EFI soft reservation to E820 enumeration
arm/efi: EFI soft reservation to memblock
x86/efi: Add efi_fake_mem support for EFI_MEMORY_SP
lib: Uplevel the pmem "region" ida to a global allocator
dax: Fix alloc_dax_region() compile warning
device-dax: Add a driver for "hmem" devices
ACPI: NUMA: HMAT: Register HMAT at device_initcall level
ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device
Daniel Drake (2):
ACPI: EC: tweak naming in preparation for GpioInt support
ACPI: EC: add support for hardware-reduced systems
Erik Schmauss (6):
ACPICA: utilities: add flag to only display data when dumping buffers
ACPICA: debugger: add command to dump all fields of particular subtype
ACPICA: debugger: surround field unit output with braces '{'
ACPICA: debugger: add field unit support for acpi_db_get_next_token
ACPICA: acpiexec: initialize all simple types and field units
from user input
ACPICA: debugger: remove leading whitespaces when converting a
string to a buffer
Hans de Goede (12):
ACPI / PMIC: Do not register handlers for unhandled OpRegions
ACPI / PMIC: Add byt prefix to Crystal Cove PMIC OpRegion driver
ACPI / PMIC: Add Cherry Trail Crystal Cove PMIC OpRegion driver
ACPI: LPSS: Add LNXVIDEO -> BYT I2C7 to lpss_device_links
ACPI: LPSS: Add LNXVIDEO -> BYT I2C1 to lpss_device_links
ACPI: LPSS: Add dmi quirk for skipping _DEP check for some device-links
ACPI: button: Refactor lid_init_state module parsing code
ACPI: button: Allow disabling LID support with the
lid_init_state module option
ACPI: button: Turn lid_blacklst DMI table into a generic quirk table
ACPI: button: Add DMI quirk for Medion Akoya E2215T
ACPI: button: Add DMI quirk for Asus T200TA
ACPI: button: Remove unused acpi_lid_notifier_[un]register() functions
James Pack (1):
ACPI: Documentation: Minor spelling fix in namespace.rst
Kacper Piwiński (1):
ACPI: video: update doc for acpi_video_bus_DOS()
Nikolaus Voss (1):
ACPICA: make acpi_load_table() return table index
Qian Cai (1):
ACPI: NUMA: HMAT: fix a section mismatch
Tao Xu (1):
ACPI: HMAT: use %u instead of %d to print u32 values
---------------
Documentation/admin-guide/kernel-parameters.txt | 19 +-
Documentation/firmware-guide/acpi/namespace.rst | 2 +-
arch/arm64/mm/mmu.c | 2 +
arch/x86/boot/compressed/eboot.c | 6 +-
arch/x86/boot/compressed/kaslr.c | 46 ++++-
arch/x86/include/asm/e820/types.h | 8 +
arch/x86/include/asm/efi.h | 17 +-
arch/x86/kernel/e820.c | 12 +-
arch/x86/kernel/setup.c | 18 +-
arch/x86/platform/efi/efi.c | 54 +++++-
arch/x86/platform/efi/quirks.c | 3 +
drivers/acpi/Kconfig | 23 +--
drivers/acpi/Makefile | 8 +-
drivers/acpi/acpi_configfs.c | 4 +-
drivers/acpi/acpi_lpss.c | 48 ++---
drivers/acpi/acpi_platform.c | 43 +++++
drivers/acpi/acpi_video.c | 8 +-
drivers/acpi/acpica/acdebug.h | 2 +
drivers/acpi/acpica/acstruct.h | 10 ++
drivers/acpi/acpica/acutils.h | 9 +-
drivers/acpi/acpica/dbconvert.c | 4 +
drivers/acpi/acpica/dbdisply.c | 2 -
drivers/acpi/acpica/dbfileio.c | 2 +-
drivers/acpi/acpica/dbinput.c | 36 +++-
drivers/acpi/acpica/dbmethod.c | 4 +
drivers/acpi/acpica/dbnames.c | 114 ++++++++++++
drivers/acpi/acpica/dbobject.c | 1 -
drivers/acpi/acpica/dscontrol.c | 2 +-
drivers/acpi/acpica/dsfield.c | 12 +-
drivers/acpi/acpica/evgpeblk.c | 11 +-
drivers/acpi/acpica/evgpeinit.c | 3 -
drivers/acpi/acpica/evmisc.c | 12 +-
drivers/acpi/acpica/evregion.c | 4 +-
drivers/acpi/acpica/evrgnini.c | 1 -
drivers/acpi/acpica/hwxfsleep.c | 3 +
drivers/acpi/acpica/nsconvert.c | 2 +-
drivers/acpi/acpica/nsdump.c | 6 +-
drivers/acpi/acpica/nsxfname.c | 4 +-
drivers/acpi/acpica/psobject.c | 7 +-
drivers/acpi/acpica/rscreate.c | 3 +
drivers/acpi/acpica/tbdata.c | 3 +
drivers/acpi/acpica/tbxfload.c | 40 ++++-
drivers/acpi/acpica/utbuffer.c | 52 +++---
drivers/acpi/acpica/utids.c | 2 -
drivers/acpi/acpica/uttrack.c | 2 +-
drivers/acpi/button.c | 139 ++++++++-------
drivers/acpi/ec.c | 195 +++++++++++++++------
drivers/acpi/hmat/Makefile | 2 -
drivers/acpi/internal.h | 3 +-
drivers/acpi/{hmat => numa}/Kconfig | 7 +
drivers/acpi/numa/Makefile | 3 +
drivers/acpi/{hmat => numa}/hmat.c | 158 ++++++++++++++---
drivers/acpi/{numa.c => numa/srat.c} | 0
drivers/acpi/osi.c | 6 +-
drivers/acpi/pmic/intel_pmic.c | 20 ++-
.../pmic/{intel_pmic_crc.c => intel_pmic_bytcrc.c} | 4 +-
drivers/acpi/pmic/intel_pmic_chtcrc.c | 44 +++++
drivers/acpi/scan.c | 1 +
drivers/acpi/utils.c | 32 ++++
drivers/dax/Kconfig | 27 ++-
drivers/dax/Makefile | 2 +
drivers/dax/bus.c | 2 +-
drivers/dax/bus.h | 2 +-
drivers/dax/dax-private.h | 2 +-
drivers/dax/hmem.c | 56 ++++++
drivers/firmware/efi/Kconfig | 21 +++
drivers/firmware/efi/Makefile | 5 +-
drivers/firmware/efi/arm-init.c | 9 +
drivers/firmware/efi/arm-runtime.c | 24 +++
drivers/firmware/efi/efi.c | 15 +-
drivers/firmware/efi/esrt.c | 3 +
drivers/firmware/efi/fake_mem.c | 26 ++-
drivers/firmware/efi/fake_mem.h | 10 ++
drivers/firmware/efi/libstub/arm32-stub.c | 5 +
drivers/firmware/efi/libstub/efi-stub-helper.c | 19 ++
drivers/firmware/efi/libstub/random.c | 4 +
drivers/firmware/efi/x86_fake_mem.c | 69 ++++++++
drivers/iommu/amd_iommu.c | 30 +---
drivers/mfd/intel_soc_pmic_crc.c | 2 +-
drivers/mmc/host/sdhci-acpi.c | 49 ++----
drivers/nvdimm/Kconfig | 1 +
drivers/nvdimm/core.c | 1 -
drivers/nvdimm/nd-core.h | 1 -
drivers/nvdimm/region_devs.c | 13 +-
include/acpi/acpi_bus.h | 8 +-
include/acpi/acpixf.h | 8 +-
include/acpi/button.h | 12 --
include/linux/acpi.h | 8 +
include/linux/efi.h | 16 +-
include/linux/ioport.h | 1 +
include/linux/memregion.h | 23 +++
lib/Kconfig | 3 +
lib/Makefile | 1 +
lib/memregion.c | 18 ++
94 files changed, 1374 insertions(+), 410 deletions(-)
1 year, 1 month
[ndctl PATCH v2] ndctl/list: Add 'target_node' to region and
namespace verbose listings
by Dan Williams
Historically the 'numa_node' attribute of a device has been the local,
or closest cpu numa node that can access the device. With the ACPI HMAT
and other platform descriptions of performance differentiated memory,
memory device targets may have their own numa identifier. The
target_node property indicates that target information and the effective
online numa node the memory range would receive if it were onlined.
While this property has been available to device-dax instances since
kernel commit 21c75763a3ae "device-dax: Add a 'target_node' attribute",
recent kernels have also started exporting for regions and namespaces.
Add it to the verbose listing.
Cc: "Aneesh Kumar K.V" <aneesh.kumar(a)linux.ibm.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
Fixed whitespace.
ndctl/lib/libndctl.c | 25 ++++++++++++++++++++++++-
ndctl/lib/libndctl.sym | 2 ++
ndctl/lib/private.h | 3 ++-
ndctl/libndctl.h | 2 ++
ndctl/list.c | 9 ++++++++-
util/json.c | 9 ++++++++-
6 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index d6a28002e7d6..469815a8f04b 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -135,6 +135,7 @@ struct ndctl_mapping {
* @generation: incremented everytime the region is disabled
* @nstype: the resulting type of namespace this region produces
* @numa_node: numa node attribute
+ * @target_node: target node were this region to be onlined
*
* A region may alias between pmem and block-window access methods. The
* region driver is tasked with parsing the label (if their is one) and
@@ -160,7 +161,7 @@ struct ndctl_region {
char *region_buf;
int buf_len;
int generation;
- int numa_node;
+ int numa_node, target_node;
struct list_head btts;
struct list_head pfns;
struct list_head daxs;
@@ -2151,6 +2152,12 @@ static void *add_region(void *parent, int id, const char *region_base)
else
region->numa_node = -1;
+ sprintf(path, "%s/target_node", region_base);
+ if (sysfs_read_attr(ctx, path, buf) == 0)
+ region->target_node = strtol(buf, NULL, 0);
+ else
+ region->target_node = -1;
+
if (region_set_type(region, path) < 0)
goto err_read;
@@ -2424,6 +2431,11 @@ NDCTL_EXPORT int ndctl_region_get_numa_node(struct ndctl_region *region)
return region->numa_node;
}
+NDCTL_EXPORT int ndctl_region_get_target_node(struct ndctl_region *region)
+{
+ return region->target_node;
+}
+
NDCTL_EXPORT struct badblock *ndctl_region_get_next_badblock(struct ndctl_region *region)
{
return badblocks_iter_next(®ion->bb_iter);
@@ -3477,6 +3489,12 @@ static void *add_namespace(void *parent, int id, const char *ndns_base)
else
ndns->numa_node = -1;
+ sprintf(path, "%s/target_node", ndns_base);
+ if (sysfs_read_attr(ctx, path, buf) == 0)
+ ndns->target_node = strtol(buf, NULL, 0);
+ else
+ ndns->target_node = -1;
+
sprintf(path, "%s/holder_class", ndns_base);
if (sysfs_read_attr(ctx, path, buf) == 0)
ndns->enforce_mode = enforce_name_to_id(buf);
@@ -4393,6 +4411,11 @@ NDCTL_EXPORT int ndctl_namespace_get_numa_node(struct ndctl_namespace *ndns)
return ndns->numa_node;
}
+NDCTL_EXPORT int ndctl_namespace_get_target_node(struct ndctl_namespace *ndns)
+{
+ return ndns->target_node;
+}
+
static int __ndctl_namespace_set_write_cache(struct ndctl_namespace *ndns,
int state)
{
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 4e767789dfe1..bf049af1393a 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -426,4 +426,6 @@ LIBNDCTL_22 {
LIBNDCTL_23 {
ndctl_namespace_is_configuration_idle;
+ ndctl_namespace_get_target_node;
+ ndctl_region_get_target_node;
} LIBNDCTL_22;
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index 1f6a01c55377..e4453013d706 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -201,6 +201,7 @@ struct badblocks_iter {
* @bdev: associated block_device of a namespace
* @size: unsigned
* @numa_node: numa node attribute
+ * @target_node: target node were this region to be onlined
*
* A 'namespace' is the resulting device after region-aliasing and
* label-parsing is resolved.
@@ -220,7 +221,7 @@ struct ndctl_namespace {
char *alt_name;
uuid_t uuid;
struct ndctl_lbasize lbasize;
- int numa_node;
+ int numa_node, target_node;
struct list_head injected_bb;
};
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 9a53049e7f61..208240b20aee 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -383,6 +383,7 @@ struct ndctl_dimm *ndctl_region_get_first_dimm(struct ndctl_region *region);
struct ndctl_dimm *ndctl_region_get_next_dimm(struct ndctl_region *region,
struct ndctl_dimm *dimm);
int ndctl_region_get_numa_node(struct ndctl_region *region);
+int ndctl_region_get_target_node(struct ndctl_region *region);
struct ndctl_region *ndctl_bus_get_region_by_physical_address(struct ndctl_bus *bus,
unsigned long long address);
#define ndctl_dimm_foreach_in_region(region, dimm) \
@@ -511,6 +512,7 @@ int ndctl_namespace_set_sector_size(struct ndctl_namespace *ndns,
int ndctl_namespace_get_raw_mode(struct ndctl_namespace *ndns);
int ndctl_namespace_set_raw_mode(struct ndctl_namespace *ndns, int raw_mode);
int ndctl_namespace_get_numa_node(struct ndctl_namespace *ndns);
+int ndctl_namespace_get_target_node(struct ndctl_namespace *ndns);
int ndctl_namespace_inject_error(struct ndctl_namespace *ndns,
unsigned long long block, unsigned long long count,
bool notify);
diff --git a/ndctl/list.c b/ndctl/list.c
index 1c3e34d58ddb..607996a85784 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -80,7 +80,7 @@ static struct json_object *region_to_json(struct ndctl_region *region,
unsigned int bb_count = 0;
unsigned long long extent;
enum ndctl_persistence_domain pd;
- int numa;
+ int numa, target;
if (!jregion)
return NULL;
@@ -130,6 +130,13 @@ static struct json_object *region_to_json(struct ndctl_region *region,
json_object_object_add(jregion, "numa_node", jobj);
}
+ target = ndctl_region_get_target_node(region);
+ if (target >= 0 && flags & UTIL_JSON_VERBOSE) {
+ jobj = json_object_new_int(target);
+ if (jobj)
+ json_object_object_add(jregion, "target_node", jobj);
+ }
+
iset = ndctl_region_get_interleave_set(region);
if (iset) {
jobj = util_json_object_hex(
diff --git a/util/json.c b/util/json.c
index 497c52ba1a00..0abaf3a5b9c2 100644
--- a/util/json.c
+++ b/util/json.c
@@ -912,7 +912,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
unsigned long align = 0;
char buf[40];
uuid_t uuid;
- int numa;
+ int numa, target;
if (!jndns)
return NULL;
@@ -1092,6 +1092,13 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
json_object_object_add(jndns, "numa_node", jobj);
}
+ target = ndctl_namespace_get_target_node(ndns);
+ if (target >= 0 && flags & UTIL_JSON_VERBOSE) {
+ jobj = json_object_new_int(target);
+ if (jobj)
+ json_object_object_add(jndns, "target_node", jobj);
+ }
+
if (pfn)
jbbs = util_pfn_badblocks_to_json(pfn, &bb_count, flags);
else if (dax)
1 year, 1 month
[ndctl PATCH] ndctl/list: Add 'target_node' to region and namespace
verbose listings
by Dan Williams
Historically the 'numa_node' attribute of a device has been the local,
or closest cpu numa node that can access the device. With the ACPI HMAT
and other platform descriptions of performance differentiated memory,
memory device targets may have their own numa identifier. The
target_node property indicates that target information and the effective
online numa node the memory range would receive if it were onlined.
While this property has been available to device-dax instances since
kernel commit 21c75763a3ae "device-dax: Add a 'target_node' attribute",
recent kernels have also started exporting for regions and namespaces.
Add it to the verbose listing.
Cc: "Aneesh Kumar K.V" <aneesh.kumar(a)linux.ibm.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
ndctl/lib/libndctl.c | 25 ++++++++++++++++++++++++-
ndctl/lib/libndctl.sym | 2 ++
ndctl/lib/private.h | 3 ++-
ndctl/libndctl.h | 2 ++
ndctl/list.c | 9 ++++++++-
util/json.c | 9 ++++++++-
6 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index d6a28002e7d6..469815a8f04b 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -135,6 +135,7 @@ struct ndctl_mapping {
* @generation: incremented everytime the region is disabled
* @nstype: the resulting type of namespace this region produces
* @numa_node: numa node attribute
+ * @target_node: target node were this region to be onlined
*
* A region may alias between pmem and block-window access methods. The
* region driver is tasked with parsing the label (if their is one) and
@@ -160,7 +161,7 @@ struct ndctl_region {
char *region_buf;
int buf_len;
int generation;
- int numa_node;
+ int numa_node, target_node;
struct list_head btts;
struct list_head pfns;
struct list_head daxs;
@@ -2151,6 +2152,12 @@ static void *add_region(void *parent, int id, const char *region_base)
else
region->numa_node = -1;
+ sprintf(path, "%s/target_node", region_base);
+ if (sysfs_read_attr(ctx, path, buf) == 0)
+ region->target_node = strtol(buf, NULL, 0);
+ else
+ region->target_node = -1;
+
if (region_set_type(region, path) < 0)
goto err_read;
@@ -2424,6 +2431,11 @@ NDCTL_EXPORT int ndctl_region_get_numa_node(struct ndctl_region *region)
return region->numa_node;
}
+NDCTL_EXPORT int ndctl_region_get_target_node(struct ndctl_region *region)
+{
+ return region->target_node;
+}
+
NDCTL_EXPORT struct badblock *ndctl_region_get_next_badblock(struct ndctl_region *region)
{
return badblocks_iter_next(®ion->bb_iter);
@@ -3477,6 +3489,12 @@ static void *add_namespace(void *parent, int id, const char *ndns_base)
else
ndns->numa_node = -1;
+ sprintf(path, "%s/target_node", ndns_base);
+ if (sysfs_read_attr(ctx, path, buf) == 0)
+ ndns->target_node = strtol(buf, NULL, 0);
+ else
+ ndns->target_node = -1;
+
sprintf(path, "%s/holder_class", ndns_base);
if (sysfs_read_attr(ctx, path, buf) == 0)
ndns->enforce_mode = enforce_name_to_id(buf);
@@ -4393,6 +4411,11 @@ NDCTL_EXPORT int ndctl_namespace_get_numa_node(struct ndctl_namespace *ndns)
return ndns->numa_node;
}
+NDCTL_EXPORT int ndctl_namespace_get_target_node(struct ndctl_namespace *ndns)
+{
+ return ndns->target_node;
+}
+
static int __ndctl_namespace_set_write_cache(struct ndctl_namespace *ndns,
int state)
{
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 4e767789dfe1..bf049af1393a 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -426,4 +426,6 @@ LIBNDCTL_22 {
LIBNDCTL_23 {
ndctl_namespace_is_configuration_idle;
+ ndctl_namespace_get_target_node;
+ ndctl_region_get_target_node;
} LIBNDCTL_22;
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index 1f6a01c55377..e4453013d706 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -201,6 +201,7 @@ struct badblocks_iter {
* @bdev: associated block_device of a namespace
* @size: unsigned
* @numa_node: numa node attribute
+ * @target_node: target node were this region to be onlined
*
* A 'namespace' is the resulting device after region-aliasing and
* label-parsing is resolved.
@@ -220,7 +221,7 @@ struct ndctl_namespace {
char *alt_name;
uuid_t uuid;
struct ndctl_lbasize lbasize;
- int numa_node;
+ int numa_node, target_node;
struct list_head injected_bb;
};
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 9a53049e7f61..208240b20aee 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -383,6 +383,7 @@ struct ndctl_dimm *ndctl_region_get_first_dimm(struct ndctl_region *region);
struct ndctl_dimm *ndctl_region_get_next_dimm(struct ndctl_region *region,
struct ndctl_dimm *dimm);
int ndctl_region_get_numa_node(struct ndctl_region *region);
+int ndctl_region_get_target_node(struct ndctl_region *region);
struct ndctl_region *ndctl_bus_get_region_by_physical_address(struct ndctl_bus *bus,
unsigned long long address);
#define ndctl_dimm_foreach_in_region(region, dimm) \
@@ -511,6 +512,7 @@ int ndctl_namespace_set_sector_size(struct ndctl_namespace *ndns,
int ndctl_namespace_get_raw_mode(struct ndctl_namespace *ndns);
int ndctl_namespace_set_raw_mode(struct ndctl_namespace *ndns, int raw_mode);
int ndctl_namespace_get_numa_node(struct ndctl_namespace *ndns);
+int ndctl_namespace_get_target_node(struct ndctl_namespace *ndns);
int ndctl_namespace_inject_error(struct ndctl_namespace *ndns,
unsigned long long block, unsigned long long count,
bool notify);
diff --git a/ndctl/list.c b/ndctl/list.c
index 1c3e34d58ddb..607996a85784 100644
--- a/ndctl/list.c
+++ b/ndctl/list.c
@@ -80,7 +80,7 @@ static struct json_object *region_to_json(struct ndctl_region *region,
unsigned int bb_count = 0;
unsigned long long extent;
enum ndctl_persistence_domain pd;
- int numa;
+ int numa, target;
if (!jregion)
return NULL;
@@ -130,6 +130,13 @@ static struct json_object *region_to_json(struct ndctl_region *region,
json_object_object_add(jregion, "numa_node", jobj);
}
+ target = ndctl_region_get_target_node(region);
+ if (target >= 0 && flags & UTIL_JSON_VERBOSE) {
+ jobj = json_object_new_int(target);
+ if (jobj)
+ json_object_object_add(jregion, "target_node", jobj);
+ }
+
iset = ndctl_region_get_interleave_set(region);
if (iset) {
jobj = util_json_object_hex(
diff --git a/util/json.c b/util/json.c
index 497c52ba1a00..1369a068398c 100644
--- a/util/json.c
+++ b/util/json.c
@@ -912,7 +912,7 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
unsigned long align = 0;
char buf[40];
uuid_t uuid;
- int numa;
+ int numa, target;
if (!jndns)
return NULL;
@@ -1092,6 +1092,13 @@ struct json_object *util_namespace_to_json(struct ndctl_namespace *ndns,
json_object_object_add(jndns, "numa_node", jobj);
}
+ target= ndctl_namespace_get_target_node(ndns);
+ if (target>= 0 && flags & UTIL_JSON_VERBOSE) {
+ jobj = json_object_new_int(target);
+ if (jobj)
+ json_object_object_add(jndns, "target_node", jobj);
+ }
+
if (pfn)
jbbs = util_pfn_badblocks_to_json(pfn, &bb_count, flags);
else if (dax)
1 year, 1 month
Security Notice. linux-nvdimm@lists.01.org was hacked! Change your password now!
by zohir.sari@groupe-chiali.com
Dear user of lists.01.org!
I am a spyware software developer.
Your account has been hacked by me in the summer of 2019.
The hacking was carried out using a hardware vulnerability through which you went online (Cisco router, vulnerability CVE-2019-12643).
I went around the security system in the router, installed an exploit there.
When you went online, my exploit downloaded my malicious code (rootkit) to your device.
This is driver software, I constantly updated it, so your antivirus is silent all time.
Since then I have been following you (I can connect to your device via the VNC protocol).
That is, I can see absolutely everything that you do, view and download your files and any data to yourself.
I also have access to the camera on your device, and I periodically take photos and videos with you.
At the moment, I have harvested a solid dirt... on you...
I saved all your email and chats from your messangers. I also saved the entire history of the sites you visit.
I note that it is useless to change the passwords. My malware update passwords from your accounts every times.
I know what you like hard funs (adult sites).
Oh, yes .. I'm know your secret life, which you are hiding from everyone.
Oh my God, what are your like... I saw THIS ... Oh, you dirty naughty person ... :)
I took photos and videos of your most passionate funs with adult content, and synchronized them in real time with the image of your camera.
Believe it turned out very high quality!
So, to the business!
I'm sure you don't want to show these files and visiting history to all your contacts.
Transfer $968 to my Bitcoin cryptocurrency wallet: 1CDKLgab6xUnAwP5q5x3jdDy8978Bt2iCZ
Just copy and paste the wallet number when transferring.
If you do not know how to do this - ask Google.
My system automatically recognizes the translation.
As soon as the specified amount is received, all your data will be destroyed from my server, and the rootkit will be automatically removed from your system.
Do not worry, I really will delete everything, since I am 'working' with many people who have fallen into your position.
You will only have to inform your provider about the vulnerabilities in the router so that other hackers will not use it.
Since opening this letter you have 48 hours.
If funds not will be received, after the specified time has elapsed, the disk of your device will be formatted,
and from my server will automatically send email and sms to all your contacts with compromising material.
P.S. Do not try to contact me (this is impossible, sender's address was randomly generated).
I advise you to remain prudent and not engage in nonsense (all files on my server).
Good luck!
1 year, 1 month
Реклама Вашего товара в ЧЕРНУЮ ПЯТНИЦУ!
by SALES-MAIL
Здравствуйте!
29 Ноября черная пятница! Закажите у нас рекламную емаил рассылку и получите ТОП продаж!
Если интересно данное предложение - пишите, ответим на Ваши вопросы!
---
С уважением
отдел рекламы Владимир Викторович
тел: +38068-680-46-52
mail: sergei.trush(a)yahoo.com
1 year, 1 month