[ndctl PATCH v2 0/4] Add missing firmware_status checks
by Vishal Verma
Changes in v2:
- For the new helper, return original positive rc when we can (Dan)
- Convert previously missed locations to the new submission helper
(patch 2)
- Add a new patch (4/4) to fix up all callers of ndctl_cmd_submit to
the correct return convention.
There were several places in ndctl where we neglected to check the
firmware_status from a command submission.
Add an ndctl_dimm_op target to perform error translation for a DSM
family, and provide a new helper - ndctl_cmd_submit_xlat - that will
submit the command and call an error translation routine if one has been
registered. Switch the call sites in ndctl/inject-smart.c and
ndctl/monitor.c over to the new command submission helper.
Finally, clean up all remaining callers of ndctl_cmd_submit to use the
correct return convention, i.e. only treat negative returns as an error,
and accept positive return codes as OK.
Vishal Verma (4):
libndctl, intel: Add infrastructure for firmware_status translation
ndctl, inject-smart: switch to ndctl_cmd_submit_xlat
ndctl, monitor: switch to ndctl_cmd_submit_xlat
ndctl: clean up usage of ndctl_cmd_submit
ndctl/inject-smart.c | 16 ++++++-------
ndctl/lib/dimm.c | 6 ++---
ndctl/lib/inject.c | 8 +++----
ndctl/lib/intel.c | 49 ++++++++++++++++++++++++++++++++++++++
ndctl/lib/intel.h | 1 +
ndctl/lib/libndctl.c | 28 ++++++++++++++++++++++
ndctl/lib/libndctl.sym | 6 +++++
ndctl/lib/nfit.c | 2 +-
ndctl/lib/private.h | 1 +
ndctl/libndctl.h | 3 +++
ndctl/monitor.c | 6 ++---
ndctl/util/json-firmware.c | 2 +-
ndctl/util/json-smart.c | 8 +++----
test/daxdev-errors.c | 8 +++----
test/libndctl.c | 18 +++++++-------
test/smart-notify.c | 8 +++----
16 files changed, 129 insertions(+), 41 deletions(-)
--
2.17.2
3 years, 4 months
[ndctl PATCH 0/3] Add missing firmware_status checks
by Vishal Verma
There were several places in ndctl where we neglected to check the
firmware_status from a command submission.
Add an ndctl_dimm_op target to perform error translation for a DSM
family, and provide a new helper -ndctl_cmd_submit_xlat - that will
submit the command and call an error translation routing if one has been
registered.
Finally, switch the call sites in ndctl/inject-smart.c and
ndctl/monitor.c over to the new command submission helper.
Vishal Verma (3):
libndctl, intel: Add infrastructure for firmware_status translation
ndctl, inject-smart: switch to ndctl_cmd_submit_xlat
ndctl, monitor: switch to ndctl_cmd_submit_xlat
ndctl/inject-smart.c | 8 +++----
ndctl/lib/intel.c | 49 ++++++++++++++++++++++++++++++++++++++++++
ndctl/lib/intel.h | 1 +
ndctl/lib/libndctl.c | 26 ++++++++++++++++++++++
ndctl/lib/libndctl.sym | 6 ++++++
ndctl/lib/private.h | 1 +
ndctl/libndctl.h | 3 +++
ndctl/monitor.c | 4 ++--
8 files changed, 92 insertions(+), 6 deletions(-)
--
2.17.2
3 years, 4 months
23222f8f8dce6: acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle
by Jane Chu
Hi, Tony,
I happen to be looking at the above patch, and noticed below change in
drivers/acpi/nfit/core.c
+ mutex_lock(&acpi_desc_lock);
+ list_for_each_entry(acpi_desc, &acpi_descs, list) {
+ mutex_lock(&acpi_desc->init_mutex);
+ list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
+ memdev = __to_nfit_memdev(nfit_mem);
+ if (memdev->device_handle == device_handle) {
+ mutex_unlock(&acpi_desc->init_mutex);
+ mutex_unlock(&acpi_desc_lock);
+ *flags = memdev->flags; <-----
+ return memdev->physical_id;
+ }
+ }
+ mutex_unlock(&acpi_desc->init_mutex);
+ }
+ mutex_unlock(&acpi_desc_lock);
Is there a reason to retrieve the memdev->flags value after releasing
the locks?
Thanks!
-jane
3 years, 4 months
Re: MURATA in stock
by Yumi
Hard Find Electronics Ltd.
Your trust small quantity & short lead time ISO 9001:2015 Certified distributor
Hi dear,
Happy New Year to you!
I am Yumi from Hard Find Electronics Ltd(www.hardfindelectronics.com) which is ISO 9001:2015 Certified electronics distributor with 10 years of experiences.
Do you have any inquiry of electronic components? If you need sample, please contact me.Pls check our hot offer, welcome your inquiry.
GRM1555C1H150JA01D 10K/R MURATA 2017+ 0.002usd
GRM188R60J226MEA0D 4K/R MURATA 2017+ 0.002usd
GRM1555C1H270JA01D 10K/R MURATA 2017+ 0.002usd
GRM1555C1H3R3CA01D 10K/R MURATA 2017+ 0.002usd
GRM1555C1H102JA01D 10K/R MURATA 2017+ 0.0056usd
GRM1555C1H2R7CA01D 10K/R MURATA 2017+ 0.002usd
GRM1555C1H470JZ01D 10K/R MURATA 2017+ 0.002usd
GRM155R61A105KE15D 10K/R MURATA 2017+ 0.0042usd
GRM21BR71E225KA73L 3K/R MURATA 2017+ 0.0194usd
GRM1555C1HR80BA01D 10K/R MURATA 2017+ 0.0033usd
GRM1555C1H7R5CA01D 10K/R MURATA 2017+ 0.002usd
Strong lines:Capacitors&Resistors, Diodes&Transistors, Connectors, IC, LED, Crystal Oscillator, Relay, opticalcoupler, ETC
(1 piece order; 1 year warranty; 1000000 price reference)
Best regards
Keep smiling every day (* ̄) ̄)
Yumi
Sales Manager
Hard Find Electronics Ltd.
315, Shahe Rod, Long Gang District, Shenzhen, CN, 518000
Tel: +86-755-8418 8103
Skype: yumi@hardfindelectronics.com
Linkedln:www.linkedin.com/in/yumi-gao
Facebook: facebook.com/Yumihardfind
Web: http://www.hardfindelectronics.com/
Please log in our website for more electronic components
If you don't want to receive this mail, pls return with "remove" on the subject line.
如果你不想再收到该产品的推荐邮件,请点击这里退订
3 years, 4 months
[ndctl PATCH v2 0/2] ndctl, monitor: refactor read_config_file
by QI Fuli
This patch set is used for refactoring read_config_file by using
ccan/ciniparser library.
Signed-off-by: QI Fuli <qi.fuli(a)jp.fujitsu.com>
--
Change log since v1:
- Fix the conflicts with the lastest cleanup patch of monitor
QI Fuli (2):
ndctl: add the ciniparser tool from ccan
ndctl, monitor: refactor read_config_file
Makefile.am | 6 +-
ccan/ciniparser/LICENSE | 1 +
ccan/ciniparser/ciniparser.c | 480 +++++++++++++++++++++++++++++++++++
ccan/ciniparser/ciniparser.h | 262 +++++++++++++++++++
ccan/ciniparser/dictionary.c | 266 +++++++++++++++++++
ccan/ciniparser/dictionary.h | 166 ++++++++++++
ndctl/Makefile.am | 1 +
ndctl/monitor.c | 115 +++------
ndctl/monitor.conf | 2 +
9 files changed, 1212 insertions(+), 87 deletions(-)
create mode 120000 ccan/ciniparser/LICENSE
create mode 100644 ccan/ciniparser/ciniparser.c
create mode 100644 ccan/ciniparser/ciniparser.h
create mode 100644 ccan/ciniparser/dictionary.c
create mode 100644 ccan/ciniparser/dictionary.h
--
2.20.1
3 years, 4 months
[PATCH v3 0/5] kvm "virtio pmem" device
by Pankaj Gupta
This patch series has implementation for "virtio pmem".
"virtio pmem" is fake persistent memory(nvdimm) in guest
which allows to bypass the guest page cache. This also
implements a VIRTIO based asynchronous flush mechanism.
Sharing guest kernel driver in this patchset with the
changes suggested in v2. Tested with Qemu side device
emulation for virtio-pmem [6].
Details of project idea for 'virtio pmem' flushing interface
is shared [3] & [4].
Implementation is divided into two parts:
New virtio pmem guest driver and qemu code changes for new
virtio pmem paravirtualized device.
1. Guest virtio-pmem kernel driver
---------------------------------
- Reads persistent memory range from paravirt device and
registers with 'nvdimm_bus'.
- 'nvdimm/pmem' driver uses this information to allocate
persistent memory region and setup filesystem operations
to the allocated memory.
- virtio pmem driver implements asynchronous flushing
interface to flush from guest to host.
2. Qemu virtio-pmem device
---------------------------------
- Creates virtio pmem device and exposes a memory range to
KVM guest.
- At host side this is file backed memory which acts as
persistent memory.
- Qemu side flush uses aio thread pool API's and virtio
for asynchronous guest multi request handling.
David Hildenbrand CCed also posted a modified version[6] of
qemu virtio-pmem code based on updated Qemu memory device API.
Virtio-pmem errors handling:
----------------------------------------
Checked behaviour of virtio-pmem for below types of errors
Need suggestions on expected behaviour for handling these errors?
- Hardware Errors: Uncorrectable recoverable Errors:
a] virtio-pmem:
- As per current logic if error page belongs to Qemu process,
host MCE handler isolates(hwpoison) that page and send SIGBUS.
Qemu SIGBUS handler injects exception to KVM guest.
- KVM guest then isolates the page and send SIGBUS to guest
userspace process which has mapped the page.
b] Existing implementation for ACPI pmem driver:
- Handles such errors with MCE notifier and creates a list
of bad blocks. Read/direct access DAX operation return EIO
if accessed memory page fall in bad block list.
- It also starts backgound scrubbing.
- Similar functionality can be reused in virtio-pmem with MCE
notifier but without scrubbing(no ACPI/ARS)? Need inputs to
confirm if this behaviour is ok or needs any change?
Changes from PATCH v2: [1]
- Disable MAP_SYNC for ext4 & XFS filesystems - [Dan]
- Use name 'virtio pmem' in place of 'fake dax'
Changes from PATCH v1: [2]
- 0-day build test for build dependency on libnvdimm
Changes suggested by - [Dan Williams]
- Split the driver into two parts virtio & pmem
- Move queuing of async block request to block layer
- Add "sync" parameter in nvdimm_flush function
- Use indirect call for nvdimm_flush
- Don’t move declarations to common global header e.g nd.h
- nvdimm_flush() return 0 or -EIO if it fails
- Teach nsio_rw_bytes() that the flush can fail
- Rename nvdimm_flush() to generic_nvdimm_flush()
- Use 'nd_region->provider_data' for long dereferencing
- Remove virtio_pmem_freeze/restore functions
- Remove BSD license text with SPDX license text
- Add might_sleep() in virtio_pmem_flush - [Luiz]
- Make spin_lock_irqsave() narrow
Changes from RFC v3
- Rebase to latest upstream - Luiz
- Call ndregion->flush in place of nvdimm_flush- Luiz
- kmalloc return check - Luiz
- virtqueue full handling - Stefan
- Don't map entire virtio_pmem_req to device - Stefan
- request leak, correct sizeof req- Stefan
- Move declaration to virtio_pmem.c
Changes from RFC v2:
- Add flush function in the nd_region in place of switching
on a flag - Dan & Stefan
- Add flush completion function with proper locking and wait
for host side flush completion - Stefan & Dan
- Keep userspace API in uapi header file - Stefan, MST
- Use LE fields & New device id - MST
- Indentation & spacing suggestions - MST & Eric
- Remove extra header files & add licensing - Stefan
Changes from RFC v1:
- Reuse existing 'pmem' code for registering persistent
memory and other operations instead of creating an entirely
new block driver.
- Use VIRTIO driver to register memory information with
nvdimm_bus and create region_type accordingly.
- Call VIRTIO flush from existing pmem driver.
Pankaj Gupta (5):
libnvdimm: nd_region flush callback support
virtio-pmem: Add virtio-pmem guest driver
libnvdimm: add nd_region buffered dax_dev flag
ext4: disable map_sync for virtio pmem
xfs: disable map_sync for virtio pmem
[2] https://lkml.org/lkml/2018/8/31/407
[3] https://www.spinics.net/lists/kvm/msg149761.html
[4] https://www.spinics.net/lists/kvm/msg153095.html
[5] https://lkml.org/lkml/2018/8/31/413
[6] https://marc.info/?l=qemu-devel&m=153555721901824&w=2
drivers/acpi/nfit/core.c | 4 -
drivers/dax/super.c | 17 +++++
drivers/nvdimm/claim.c | 6 +
drivers/nvdimm/nd.h | 1
drivers/nvdimm/pmem.c | 15 +++-
drivers/nvdimm/region_devs.c | 45 +++++++++++++-
drivers/nvdimm/virtio_pmem.c | 84 ++++++++++++++++++++++++++
drivers/virtio/Kconfig | 10 +++
drivers/virtio/Makefile | 1
drivers/virtio/pmem.c | 125 +++++++++++++++++++++++++++++++++++++++
fs/ext4/file.c | 11 +++
fs/xfs/xfs_file.c | 8 ++
include/linux/dax.h | 9 ++
include/linux/libnvdimm.h | 11 +++
include/linux/virtio_pmem.h | 60 ++++++++++++++++++
include/uapi/linux/virtio_ids.h | 1
include/uapi/linux/virtio_pmem.h | 10 +++
17 files changed, 406 insertions(+), 12 deletions(-)
3 years, 4 months
[PATCH] libnvdimm/dimm: Fix security capability detection for non-Intel NVDIMMs
by Dan Williams
Kees reports a crash with the following signature...
RIP: 0010:nvdimm_visible+0x79/0x80
[..]
Call Trace:
internal_create_group+0xf4/0x380
sysfs_create_groups+0x46/0xb0
device_add+0x331/0x680
nd_async_device_register+0x15/0x60
async_run_entry_fn+0x38/0x100
...when starting a QEMU environment with "label-less" DIMM. Without
labels QEMU does not publish any DSM methods. Without defined methods
the NVDIMM_FAMILY type is not established and the nfit driver will skip
registering security operations.
In that case the security state should be initialized to a negative
value in __nvdimm_create() and nvdimm_visible() should skip
interrogating the specific ops. However, since 'enum
nvdimm_security_state' was only defined to contain positive values the
"if (nvdimm->sec.state < 0)" check always fails.
Define a negative error state to allow negative state values to be
handled as expected.
Fixes: f2989396553a ("acpi/nfit, libnvdimm: Introduce nvdimm_security_ops")
Cc: Dave Jiang <dave.jiang(a)intel.com>
Reported-by: Kees Cook <keescook(a)chromium.org>
Tested-by: Kees Cook <keescook(a)chromium.org>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
include/linux/libnvdimm.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 5440f11b0907..7315977b64da 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -160,6 +160,7 @@ static inline struct nd_blk_region_desc *to_blk_region_desc(
}
enum nvdimm_security_state {
+ NVDIMM_SECURITY_ERROR = -1,
NVDIMM_SECURITY_DISABLED,
NVDIMM_SECURITY_UNLOCKED,
NVDIMM_SECURITY_LOCKED,
3 years, 4 months
[PATCH v3 4/5] ext4: disable map_sync for virtio pmem
by Pankaj Gupta
Virtio pmem provides asynchronous host page cache flush
mechanism. We don't support 'MAP_SYNC' with virtio pmem
and ext4.
Signed-off-by: Pankaj Gupta <pagupta(a)redhat.com>
---
fs/ext4/file.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 69d65d4..e54f48b 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -360,8 +360,10 @@ static const struct vm_operations_struct ext4_file_vm_ops = {
static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
{
struct inode *inode = file->f_mapping->host;
+ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
+ struct dax_device *dax_dev = sbi->s_daxdev;
- if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
+ if (unlikely(ext4_forced_shutdown(sbi)))
return -EIO;
/*
@@ -371,6 +373,13 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
if (!IS_DAX(file_inode(file)) && (vma->vm_flags & VM_SYNC))
return -EOPNOTSUPP;
+ /* We don't support synchronous mappings with guest direct access
+ * and virtio based host page cache flush mechanism.
+ */
+ if (IS_DAX(file_inode(file)) && virtio_pmem_host_cache_enabled(dax_dev)
+ && (vma->vm_flags & VM_SYNC))
+ return -EOPNOTSUPP;
+
file_accessed(file);
if (IS_DAX(file_inode(file))) {
vma->vm_ops = &ext4_dax_vm_ops;
--
2.9.3
3 years, 4 months
[PATCH] ACPI/nfit: delete the function to_acpi_nfit_desc
by Xiaochun Lee
From: Xiaochun Lee <lixc17(a)lenovo.com>
The function to_acpi_nfit_desc and function to_acpi_desc
do the same things,So delete the function to_acpi_nfit_desc,
and keep the inline function to_acpi_desc.
The calling function to_acpi_nfit_desc,have been changed
to the calling function to_acpi_desc.
Xiaochun Lee (1):
ACPI/nfit: delete the function to_acpi_nfit_desc
drivers/acpi/nfit/core.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
--
1.8.3.1
3 years, 4 months
[PATCH] ACPI/nfit: delete the redundant header file
by Xiaochun Lee
From: Xiaochun Lee <lixc17(a)lenovo.com>
The header file "intel.h" is repeated here, So delete one.
Xiaochun Lee (1):
ACPI/nfit: delete the redundant header file
drivers/acpi/nfit/core.c | 1 -
1 file changed, 1 deletion(-)
--
1.8.3.1
3 years, 4 months