[GIT PULL] NVDIMM and DAX for 6.10

2024-05-15 Thread Ira Weiny
to the current kernel interfaces such as using const for struct device_type and changing the platform remove callback signature. Thank you, Ira Weiny --- The following changes since commit ed30a4a51bb196781c8058073ea720133a65596f: Linux 6.9-rc5 (2024-04-21 12:35:54 -0700) are available in the Git

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-15 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 17:33:18 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 14:19:19 -0800 > > Ira Weiny wrote: > > > > > > > Jonathan Cameron wrote: > > > > > > > > >

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Ira Weiny wrote: > Jonathan Cameron wrote: > > On Wed, 14 Feb 2024 10:23:10 -0500 > > Steven Rostedt wrote: > > > > > On Wed, 14 Feb 2024 12:11:53 + > > > Jonathan Cameron wrote: > > > > > > > So I'm thinking this

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 10:23:10 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 12:11:53 + > > Jonathan Cameron wrote: > > > > > So I'm thinking this is a won't fix - wait for the printk rework to land > > > and > > > assume this will be resolved as well?

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 10:23:10 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 12:11:53 + > > Jonathan Cameron wrote: > > > > > So I'm thinking this is a won't fix - wait for the printk rework to land > > > and > > > assume this will be resolved as well?

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Ira Weiny wrote: > Jonathan Cameron wrote: > > On Tue, 06 Feb 2024 14:15:32 -0800 > > Ira Weiny wrote: > > > > [snip] > > > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > > index 9ff8a439d674..7ee45f22f56f 100644 > > --- a/

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Tue, 06 Feb 2024 14:15:32 -0800 > Ira Weiny wrote: > > > Smatch caught that cxl_cper_post_event() is called with a spinlock held > > or preemption disabled.[1] The callback takes the device lock to > > perform address translatio

[GIT PULL] NVDIMM/NFIT changes for 6.8

2024-01-10 Thread Ira Weiny
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.8 ... to get updates to the nvdimm tree. They are a mix of bug fixes and updates to interfaces used by nvdimm. Updates to interfaces include: Use the new scope based

Re: [PATCH 3/3] nvdimm/namespace: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
Randy Dunlap wrote: > > > On 12/21/23 14:32, Ira Weiny wrote: > > Randy Dunlap wrote: > > > > [snip] > > > >> @@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi > >> /** > >> * create_namespace_pmem - validate interle

Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
Ira Weiny wrote: > Randy Dunlap wrote: [snip] > > diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c > > --- a/drivers/nvdimm/dimm_devs.c > > +++ b/drivers/nvdimm/dimm_devs.c > > @@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d > > &g

Re: [PATCH 3/3] nvdimm/namespace: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
t; + * @nd_mapping: container of dpa-resource-root + labels > * @nd_label: target pmem namespace label to evaluate > + * > + * Returns: the created device on success or -errno on error NIT: should this be ERR_PTR(-errno) on error? Generally good to me though. Reviewed-by: Ira Weiny >

Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
found for return value of > 'nvdimm_allocated_dpa' > > Signed-off-by: Randy Dunlap > Cc: Dan Williams > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny > Cc: nvd...@lists.linux.dev > --- > drivers/nvdimm/dimm_devs.c | 14 -- > 1 file changed, 12 inse

Re: [PATCH 1/3] nvdimm/btt: fix btt_blk_cleanup() kernel-doc

2023-12-21 Thread Ira Weiny
gt; Signed-off-by: Randy Dunlap > Cc: Vishal Verma > Cc: Dan Williams > Cc: Dave Jiang > Cc: Ira Weiny Reviewed-by: Ira Weiny > Cc: nvd...@lists.linux.dev > --- > drivers/nvdimm/btt.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH v3] ACPI: NFIT: Use cleanup.h helpers instead of devm_*()

2023-12-21 Thread Ira Weiny
Rafael J. Wysocki wrote: > On Wed, Oct 18, 2023 at 6:28 AM Dan Williams wrote: > > > > Michal Wilczynski wrote: > > > The new cleanup.h facilities that arrived in v6.5-rc1 can replace the > > > the usage of devm semantics in acpi_nfit_init_interleave_set(). That > > > routine appears to only be

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-19 Thread Ira Weiny
dinghao.liu@ wrote: > > Ira Weiny wrote: > > > Dinghao Liu wrote: > > > > [snip] > > > > -static int btt_freelist_init(struct arena_info *arena) > > +static int btt_freelist_init(struct device *dev, struct arena_info *arena) > > > >

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-15 Thread Ira Weiny
Ira Weiny wrote: > Dinghao Liu wrote: [snip] > > > > -static int btt_maplocks_init(struct arena_info *arena) > > +static int btt_maplocks_init(struct device *dev, struct arena_info *arena) > > { > > u32 i; > > > > - arena->map_locks =

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-14 Thread Ira Weiny
Dinghao Liu wrote: > Resources allocated by kcalloc() in btt_freelist_init(), > btt_rtt_init(), and btt_maplocks_init() are not correctly > released in their callers when an error happens. For > example, when an error happens in btt_freelist_init(), its > caller discover_arenas() will directly

Re: [PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-13 Thread Ira Weiny
prevent new ones from appearing. > > Link: > http://lore.kernel.org/r/657897453dda8_269bd29...@dwillia2-mobl3.amr.corp.intel.com.notmuch > Link: > http://lore.kernel.org/r/6577b0c2a02df_a04c529...@dwillia2-xfh.jf.intel.com.notmuch > Cc: Vishal Verma > Cc: Ira Weiny Reviewed-b

Re: [PATCH v4 2/3] dax/bus: Introduce guard(device) for device_{lock,unlock} flows

2023-12-12 Thread Ira Weiny
e, so change these > where applicable. > > Cc: Joao Martins > Suggested-by: Dan Williams > Signed-off-by: Vishal Verma > Reviewed-by: Ira Weiny

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-08 Thread Ira Weiny
dinghao.liu@ wrote: > > Dave Jiang wrote: [snip] > > That said, this patch does not completely fix freelist from leaking in the > > following error path. > > > > discover_arenas() > > btt_freelist_init() -> ok (memory allocated) > > btt_rtt_init() -> fail > >

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread Ira Weiny
Dave Jiang wrote: > [snip] First off thanks for the patch. This code seems to have a few things to clean up. > > On 12/6/23 20:43, Dinghao Liu wrote: > > When an error happens in btt_freelist_init(), its caller > > discover_arenas() will directly free arena, which makes > > arena->freelist

[GIT PULL] NVDIMM for 6.7

2023-11-01 Thread Ira Weiny
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.7 ... to get updates to the nvdimm tree. They are a mix of bug fixes and updates to interfaces used by nvdimm. Bug fixes include: Fix a sleep during spinlock in

Re: [PATCH] testing: nvdimm: make struct class structures constant

2023-10-11 Thread Ira Weiny
Dan Williams > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny Tested-by: Ira Weiny Reviewed-by: Ira Weiny > Signed-off-by: Greg Kroah-Hartman > --- > tools/testing/nvdimm/test/ndtest.c | 17 + > tools/testing/nvdimm/test/nfit.c | 14 +++--- &

Re: [PATCH v2] nd_btt: Make BTT lanes preemptible

2023-09-25 Thread Ira Weiny
> Fixes: 5212e11fde4d ("nd_btt: atomic sector updates") > Signed-off-by: Tomas Glozar Thanks for the clarification. Reviewed-by: Ira Weiny

Re: [PATCH] nd_btt: Make BTT lanes preemptible

2023-09-18 Thread Ira Weiny
Tomas Glozar wrote: > čt 14. 9. 2023 v 22:18 odesílatel Ira Weiny napsal: > > Is the bug in 1 of 2 places? > > > > 1) When btt_write_pg()->lock_map() (when the number of lanes is < number > >of cpus) and the lane is acquired is called? > > > >

Re: [PATCH v3] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value

2023-09-15 Thread Ira Weiny
Chen Ni wrote: > Use devm_kstrdup() instead of kstrdup() and check its return value to > avoid memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Chen Ni Reviewed-by: Ira Weiny > --- > Cha

Re: [PATCH v2 2/2] ACPI: NFIT: use struct_size() helper

2023-09-15 Thread Ira Weiny
Yu Liao wrote: > Make use of the struct_size() helper instead of an open-coded version, > in order to avoid any potential type mistakes or integer overflows that, > in the worst scenario, could lead to heap overflows. > > Signed-off-by: Yu Liao > Reviewed-by: Dave Jiang Revi

Re: [PATCH v2 1/2] ACPI: NFIT: Fix incorrect calculation of idt size

2023-09-15 Thread Ira Weiny
ddDVKsqQX@kreacher/ > > Fixes: 2a5ab99847bd ("ACPICA: struct acpi_nfit_interleave: Replace 1-element > array with flexible array") > Cc: sta...@vger.kernel.org # v6.4+ > Signed-off-by: Yu Liao > Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny > --- > v1 ->

Re: [PATCH] nd_btt: Make BTT lanes preemptible

2023-09-14 Thread Ira Weiny
Tomáš Glozar wrote: > From: Tomas Glozar > > nd_region_acquire_lane uses get_cpu, which disables preemption. This is > an issue on PREEMPT_RT kernels, since btt_write_pg and also > nd_region_acquire_lane itself take a spin lock, resulting in BUG: > sleeping function called from invalid context.

Re: [PATCH v3] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value

2023-09-14 Thread Ira Weiny
Dave Jiang wrote: > > > On 9/14/23 00:03, Chen Ni wrote: [snip] > > diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c > > index 1b9f5b8a6167..5765674b36f2 100644 > > --- a/drivers/nvdimm/of_pmem.c > > +++ b/drivers/nvdimm/of_pmem.c > > @@ -30,7 +30,13 @@ static int

Re: [PATCH v2] nvdimm: of_pmem: Check return value and add kfree for kstrdup

2023-08-29 Thread Ira Weiny
Chen Ni wrote: > Check the return value of kstrdup() and add kfree() for kstrdup() to > avoid memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Chen Ni > --- > Changelog: > > v1 -> v2: > > 1.Add a fixes tag. > 2.Update

Re: [PATCH v3] libnvdimm/of_pmem: Replace kstrdup with devm_kstrdup and add check

2023-07-10 Thread Ira Weiny
;) > Signed-off-by: Jiasheng Jiang LTGM Reviewed-by: Ira Weiny > --- > Changelog: > > v2 -> v3: > > 1. Correct the usage of devm_kstrdup(). > > v1 -> v2: > > 1. Replace kstrdup() with devm_kstrdup(). > --- > drivers/nvdimm/of_pmem.c | 7 ++- &g

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-23 Thread Ira Weiny
Jiasheng Jiang wrote: > On Wed, Jun 21, 2023 at 00:04:36 +0800, Ira Weiny wrote: > > Ira Weiny wrote: > >> Jiasheng Jiang wrote: [snip] > >> > >> Nice catch! > >> > >> However, this free needs to happen in of_pmem_region_remove() as wel

Re: [PATCH] libnvdimm/of_pmem: Replace kstrdup with devm_kstrdup and add check

2023-06-23 Thread Ira Weiny
Jiasheng Jiang wrote: > Replace kstrdup() with devm_kstrdup() to avoid memory leak and > add check for the return value of the devm_kstrdup() to avoid > NULL pointer dereference > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Jiasheng

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-20 Thread Ira Weiny
Ira Weiny wrote: > Jiasheng Jiang wrote: > > Add check for the return value of kstrdup() and return the error > > if it fails in order to avoid NULL pointer dereference. > > Moreover, use kfree() in the later error handling in order to avoid > > memory leak. &

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-20 Thread Ira Weiny
Jiasheng Jiang wrote: > Add check for the return value of kstrdup() and return the error > if it fails in order to avoid NULL pointer dereference. > Moreover, use kfree() in the later error handling in order to avoid > memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique

Re: [PATCH] dax: include bus.h for definition of run_dax()

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The run_dax() prototype is defined in "bus.h" but drivers/dax/super.c > does not include this. Include bus.h to silece the following sparse > warning: > > drivers/dax/super.c:337:6: warning: symbol 'run_dax' was not declared. Should > it be static? A different version of this

Re: [PATCH] nvdimm: make nd_class variable static

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse > is generating the following warning. Remove this by making it static: > > drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. > Should it be static? Reviewe

[PATCH RFC 4/4] dax/bus: Remove unnecessary reference in alloc_dax_region()

2023-06-02 Thread Ira Weiny
later. Cc: Yongqiang Liu Cc: Dan Williams Cc: Paul Cassella Signed-off-by: Ira Weiny --- drivers/dax/bus.c | 13 ++--- drivers/dax/cxl.c | 4 drivers/dax/hmem/hmem.c | 3 --- drivers/dax/pmem.c | 8 +--- 4 files changed, 7 insertions(+), 21 deletions(-) diff

[PATCH RFC 3/4] dax/cxl: Fix refcount leak in cxl_dax_region_probe()

2023-06-02 Thread Ira Weiny
: 09d09e04d2fc ("cxl/dax: Create dax devices for CXL RAM regions") Cc: Dan Williams Cc: linux-...@vger.kernel.org Signed-off-by: Ira Weiny --- This work was inspired by Yongqiang Liu here: https://lore.kernel.org/all/20221203095858.612027-1-liuyongqian...@huawei.com/ --- drivers/dax/cxl.c |

[PATCH RFC 1/4] dax/bus: Fix leaked reference in alloc_dax_region()

2023-06-02 Thread Ira Weiny
") Cc: Dan Williams Signed-off-by: Ira Weiny --- drivers/dax/bus.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 227800053309..899e29d107b4 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -583,6 +583,7 @@ s

[PATCH RFC 2/4] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread ira . weiny
evice to hmem_register_device") Reviewed-by: Ira Weiny Signed-off-by: Yongqiang Liu --- drivers/dax/hmem/hmem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dax/hmem/hmem.c b/drivers/dax/hmem/hmem.c index e5fe8b39fb94..b4831a3d3934 100644 --- a/drivers/dax/h

[PATCH RFC 0/4] dax: Clean up dax_region references

2023-06-02 Thread Ira Weiny
/20221203095858.612027-1-liuyongqian...@huawei.com/ Signed-off-by: Ira Weiny --- Ira Weiny (3): dax/bus: Fix leaked reference in alloc_dax_region() dax/cxl: Fix refcount leak in cxl_dax_region_probe() dax/bus: Remove unnecessary reference in alloc_dax_region() Yongqiang Liu (1): dax/hmem

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread Ira Weiny
Paul Cassella wrote: > On Fri, 2 Jun 2023, Ira Weiny wrote: > > Paul Cassella wrote: > > > On Sat, 3 Dec 2022, Ira Weiny wrote: > > > > On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > > > > > > We should always ca

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread Ira Weiny
Paul Cassella wrote: > On Sat, 3 Dec 2022, Ira Weiny wrote: > > On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > > > > We should always call dax_region_put() whenever devm_create_dev_dax() > > > succeed or fail to avoid refcount leak of dax_regio

Re: [PATCH -next] libnvdimm: Fix some kernel-doc comments

2023-02-23 Thread Ira Weiny
ter 'nvdimm' > description in 'nvdimm_allocated_dpa > > Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4118 Reviewed-by: Ira Weiny > Signed-off-by: Yang Li > --- > drivers/nvdimm/dimm_devs.c | 4 ++-- > 1 file changed, 2 insertions(+),

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2022-12-03 Thread Ira Weiny
On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > We should always call dax_region_put() whenever devm_create_dev_dax() > succeed or fail to avoid refcount leak of dax_region. Move the return > value check after dax_region_put(). I think dax_region_put is called from

Re: [PATCH] dax: Remove usage of the deprecated ida_simple_xxx API

2022-09-26 Thread Ira Weiny
On Sun, Sep 25, 2022 at 09:26:35PM -0400, Bo Liu wrote: > Use ida_alloc_xxx()/ida_free() instead of > ida_simple_get()/ida_simple_remove(). > The latter is deprecated and more verbose. > > Signed-off-by: Bo Liu Reviewed-by: Ira Weiny > --- > drivers/dax/super.c | 6 +++

Re: [PATCH v2] arch/cacheflush: Introduce flush_all_caches()

2022-08-19 Thread Ira Weiny
On Fri, Aug 19, 2022 at 10:10:24AM -0700, Davidlohr Bueso wrote: > With CXL security features, global CPU cache flushing nvdimm requirements > are no longer specific to that subsystem, even beyond the scope of > security_ops. CXL will need such semantics for features not necessarily > limited to

Re: [PATCH] dax: Check dev_set_name() return value

2022-08-05 Thread Ira Weiny
On Fri, Aug 05, 2022 at 01:33:19AM -0400, Bo Liu wrote: > It's possible that dev_set_name() returns -ENOMEM, catch and handle this. Did this cause a bug or some other problem when the name was not set? I think it is an ok change but without digging into the code I'm not clear why you did this.

Re: [PATCH] fs: Call kmap_local_page() in copy_string_kernel()

2022-07-21 Thread Ira Weiny
mappings can be > acquired from any context (including interrupts). > > Therefore, use kmap_local_page() in copy_string_kernel() instead of > kmap_atomic(). > > Tested with xfstests on a QEMU + KVM 32-bits VM booting a kernel with > HIGHMEM64GB enabled. > > Suggested-by:

Re: [PATCH] fs: Replace kmap{,_atomic}() with kmap_local_page()

2022-07-08 Thread Ira Weiny
he mappings can be acquired from any > context (including interrupts). > > Therefore, use kmap_local_page() in exec.c because these mappings are per > thread, CPU local, and not globally visible. > > Tested with xfstests on a QEMU + KVM 32-bits VM booting a kernel with > HIGHMEM64GB e

Re: [PATCH] tools/testing/nvdimm: remove unneeded flush_workqueue

2022-04-25 Thread Ira Weiny
On Sun, Apr 24, 2022 at 06:26:55AM +, cgel@gmail.com wrote: > From: ran jianping > > All work currently pending will be done first by calling destroy_workqueue, > so there is no need to flush it explicitly. > > Reported-by: Zeal Robot > Signed-off-by: ran jianpi

Re: [PATCH v3 8/8] nvdimm: Fix firmware activation deadlock scenarios

2022-04-22 Thread Ira Weiny
On Thu, Apr 21, 2022 at 08:33:51AM -0700, Dan Williams wrote: > Lockdep reports the following deadlock scenarios for CXL root device > power-management, device_prepare(), operations, and device_shutdown() > operations for 'nd_region' devices: > > --- > Chain exists of: >_region_key -->

Re: [PATCH v3 7/8] device-core: Kill the lockdep_mutex

2022-04-22 Thread Ira Weiny
Link: > https://lore.kernel.org/r/ylf0dewci8myl...@hirez.programming.kicks-ass.net [1] > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Suggested-by: Peter Zijlstra > Signed-off-by: Dan Williams Reviewed-by: Ira Weiny > --- > drivers/base/core.c|3 --- >

Re: [PATCH v3 6/8] nvdimm: Drop nd_device_lock()

2022-04-22 Thread Ira Weiny
On Thu, Apr 21, 2022 at 08:33:39AM -0700, Dan Williams wrote: > Now that all NVDIMM subsystem locking is validated with custom lock > classes, there is no need for the custom usage of the lockdep_mutex. > > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny > Signed

Re: [PATCH v3 5/8] ACPI: NFIT: Drop nfit_device_lock()

2022-04-22 Thread Ira Weiny
> dropped. > > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny > Signed-off-by: Dan Williams Reviewed-by: Ira Weiny > --- > drivers/acpi/nfit/core.c | 30 +++--- > drivers/acpi/nfit/nfit.h | 24 > 2 files

Re: [PATCH v3 4/8] nvdimm: Replace lockdep_mutex with local lock classes

2022-04-22 Thread Ira Weiny
ink: > https://lore.kernel.org/r/164982968798.684294.15817853329823976469.st...@dwillia2-desk3.amr.corp.intel.com > [1] > Link: > https://lore.kernel.org/r/ylf0dewci8myl...@hirez.programming.kicks-ass.net [2] > Suggested-by: Peter Zijlstra > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Wein

Re: [PATCH v3 3/8] cxl: Drop cxl_device_lock()

2022-04-22 Thread Ira Weiny
On Thu, Apr 21, 2022 at 08:33:23AM -0700, Dan Williams wrote: > Now that all CXL subsystem locking is validated with custom lock > classes, there is no need for the custom usage of the lockdep_mutex. > > Cc: Alison Schofield > Cc: Vishal Verma > Cc: Ira Weiny > Cc: Ben Wid

Re: [PATCH v3 2/8] cxl/acpi: Add root device lockdep validation

2022-04-22 Thread Ira Weiny
ere in the acpi code. So given that it looks to me like ACPI is just using the default no validate class... Reviewed-by: Ira Weiny > However, the lockdep API does support changing the lock class "live" for > situations like this. Add a device_lock_set_class() helper that a driver &g

Re: [PATCH v3 1/8] cxl: Replace lockdep_mutex with local lock classes

2022-04-22 Thread Ira Weiny
.kernel.org/r/ylf0dewci8myl...@hirez.programming.kicks-ass.net [2] > Suggested-by: Peter Zijlstra > Cc: Ingo Molnar > Cc: Will Deacon > Cc: Waiman Long > Cc: Boqun Feng > Cc: Alison Schofield > Cc: Vishal Verma > Cc: Ira Weiny > Cc: Ben Widawsky > Cc: Jonathan Ca

Re: [PATCH] fs/dax: Fix run_dax() missing prototype

2022-03-10 Thread Ira Weiny
On Wed, Mar 09, 2022 at 09:08:36PM -0800, Dan Williams wrote: > On Fri, Mar 4, 2022 at 12:38 PM wrote: > > > > From: Ira Weiny > > > > The function run_dax() was missing a prototype when compiling with > > warnings. > > > > Add bus.h to

[PATCH] fs/dax: Fix missing kdoc for dax_device

2022-03-04 Thread ira . weiny
From: Ira Weiny struct dax_device has a member named ops which was undocumented. Add the kdoc. Signed-off-by: Ira Weiny --- drivers/dax/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 5c003cc73d04..2fd3a01ba34b 100644 --- a/drivers

[PATCH] fs/dax: Fix run_dax() missing prototype

2022-03-04 Thread ira . weiny
From: Ira Weiny The function run_dax() was missing a prototype when compiling with warnings. Add bus.h to fix this. Signed-off-by: Ira Weiny --- drivers/dax/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index e3029389d809..5c003cc73d04

Re: [PATCH] dax: make sure inodes are flushed before destroy cache

2022-02-14 Thread Ira Weiny
On Mon, Feb 14, 2022 at 12:09:54PM -0800, Dan Williams wrote: > On Mon, Feb 14, 2022 at 9:59 AM Ira Weiny wrote: > > > > On Fri, Feb 11, 2022 at 11:11:11PM -0800, Tong Zhang wrote: > > > A bug can be triggered by following command > > > > > >

Re: [PATCH] dax: make sure inodes are flushed before destroy cache

2022-02-14 Thread Ira Weiny
On Fri, Feb 11, 2022 at 11:11:11PM -0800, Tong Zhang wrote: > A bug can be triggered by following command > > $ modprobe nd_pmem && modprobe -r nd_pmem > > [ 10.060014] BUG dax_cache (Not tainted): Objects remaining in dax_cache on > __kmem_cache_shutdown() > [ 10.060938] Slab

Re: [PATCH -next] nvdimm/btt: Fix btt_init() kernel-doc comment

2021-12-30 Thread Ira Weiny
ng: Function parameter or member > 'nd_region' not described in 'btt_init' > drivers/nvdimm/btt.c:1584: warning: Excess function parameter 'maxlane' > description in 'btt_init' > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Reviewed-by: Ira Weiny > --- > drivers/nvdi

Re: [PATCH V7 03/18] x86/pks: Add additional PKEY helper macros

2021-12-07 Thread Ira Weiny
On Thu, Nov 25, 2021 at 03:25:09PM +0100, Thomas Gleixner wrote: > On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > > @@ -200,16 +200,14 @@ __setup("init_pkru=", setup_init_pkru); > > */ > > u32 update_pkey_val(u32 pk_reg, int pkey, unsigned int flags) >

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-12-06 Thread Ira Weiny
On Mon, Dec 06, 2021 at 05:54:23PM -0800, 'Ira Weiny' wrote: [snip] > > > > Though, if you look at the xen_pv_evtchn_do_upcall() part where you > > added this extra invocation you might figure out that adding > > pkrs_restore_irq() to irqentry_exit_cond_r

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-12-06 Thread Ira Weiny
Thomas, Thanks for the review. Sorry for being so late to respond I was sick all last week and so it took me longer to figure out some of this stuff. On Thu, Nov 25, 2021 at 03:12:47PM +0100, Thomas Gleixner wrote: > Ira, > > On Tue, Aug 03 2021 at 21:32, ira we

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-11-12 Thread Ira Weiny
On Tue, Aug 03, 2021 at 09:32:21PM -0700, 'Ira Weiny' wrote: > From: Ira Weiny > > The PKRS MSR is not managed by XSAVE. It is preserved through a context > switch but this support leaves exception handling code open to memory > accesses during exceptions. > > 2 possible

Re: [PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-08 Thread Ira Weiny
On Sun, Nov 07, 2021 at 06:20:14PM +0100, Christophe JAILLET wrote: > Le 07/11/2021 à 18:11, Ira Weiny a écrit : > > On Sat, Nov 06, 2021 at 06:27:11PM +0100, Christophe JAILLET wrote: > > > If 'devm_init_badblocks()' fails, a previous 'blk_alloc_disk()' call must > > >

Re: [PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-07 Thread Ira Weiny
On Sat, Nov 06, 2021 at 06:27:11PM +0100, Christophe JAILLET wrote: > If 'devm_init_badblocks()' fails, a previous 'blk_alloc_disk()' call must > be undone. I think this is a problem... > > Signed-off-by: Christophe JAILLET > --- > This patch is speculative. Several fixes on error handling

Re: [PATCH] libnvdimm.h: Remove duplicate struct declaration

2021-04-19 Thread Ira Weiny
On Mon, Apr 19, 2021 at 07:27:25PM +0800, Wan Jiabing wrote: > struct device is declared at 133rd line. > The declaration here is unnecessary. Remove it. > > Signed-off-by: Wan Jiabing > --- > include/linux/libnvdimm.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git

Re: [PATCH V6 00/10] PKS: Add Protection Key Supervisor support

2021-04-16 Thread Ira Weiny
On Thu, Apr 01, 2021 at 03:58:23PM -0700, 'Ira Weiny' wrote: > From: Ira Weiny > > Introduce a new page protection mechanism for supervisor pages, Protection Key > Supervisor (PKS). Is there any feedback on this series? Perhaps I should ping for specific feedback or an ack? Maybe

Re: [PATCH v1] libnvdimm, dax: Fix a missing check in nd_dax_probe()

2021-04-09 Thread Ira Weiny
On Thu, Apr 08, 2021 at 06:58:26PM -0700, wangyingji...@126.com wrote: > From: Yingjie Wang > > In nd_dax_probe(), 'nd_dax' is allocated by nd_dax_alloc(). > nd_dax_alloc() may fail and return NULL, so we should better check Avoid the use of 'we'. > it's return value to avoid a NULL pointer

[PATCH V6 05/10] x86/pks: Add PKS setup code

2021-04-01 Thread ira . weiny
From: Ira Weiny Protection Keys for Supervisor pages (PKS) enables fast, hardware thread specific, manipulation of permission restrictions on supervisor page mappings. It uses the same mechanism of Protection Keys as those on User mappings but applies that mechanism to supervisor mappings using

[PATCH V6 06/10] x86/fault: Adjust WARN_ON for PKey fault

2021-04-01 Thread ira . weiny
From: Ira Weiny Previously if a Protection key fault occurred it indicated something very wrong because user page mappings are not supposed to be in the kernel address space. Now PKey faults may happen on kernel mappings if the feature is enabled. Remove the warning in the fault path and allow

[PATCH V6 10/10] x86/pks: Add PKS test code

2021-04-01 Thread ira . weiny
From: Ira Weiny The core PKS functionality provides an interface for kernel users to reserve keys to their domains set up the page tables with those keys and control access to those domains when needed. Define test code which exercises the core functionality of PKS via a debugfs entry. Basic

[PATCH V6 08/10] x86/entry: Preserve PKRS MSR across exceptions

2021-04-01 Thread ira . weiny
From: Ira Weiny The PKRS MSR is not managed by XSAVE. It is preserved through a context switch but this support leaves exception handling code open to memory accesses during exceptions. 2 possible places for preserving this state were considered, irqentry_state_t or pt_regs.[1] pt_regs

[PATCH V6 07/10] x86/pks: Preserve the PKRS MSR on context switch

2021-04-01 Thread ira . weiny
From: Ira Weiny The PKRS MSR is defined as a per-logical-processor register. This isolates memory access by logical CPU. Unfortunately, the MSR is not managed by XSAVE. Therefore, tasks must save/restore the MSR value on context switch. Define a saved PKRS value in the task struct, as well

[PATCH V6 09/10] x86/pks: Add PKS kernel API

2021-04-01 Thread ira . weiny
-developed-by: Ira Weiny Signed-off-by: Ira Weiny Signed-off-by: Fenghua Yu --- Changes from V5: Dave Hansen Remove 'we' from comments Changes from V4: From Sean Christopherson Add what happens if the pkey is violated Changes from V3: From Dan

[PATCH V6 04/10] x86/pks: Add PKS defines and Kconfig options

2021-04-01 Thread ira . weiny
From: Ira Weiny Protection Keys for Supervisor pages (PKS) enables fast, hardware thread specific, manipulation of permission restrictions on supervisor page mappings. It uses the same mechanism of Protection Keys as those on User mappings but applies that mechanism to supervisor mappings using

[PATCH V6 03/10] x86/pks: Add additional PKEY helper macros

2021-04-01 Thread ira . weiny
From: Ira Weiny Avoid open coding shift and mask operations by defining and using helper macros for PKey operations. Reviewed-by: Dan Williams Signed-off-by: Ira Weiny --- Changes from V3: new patch suggested by Dan Williams to use macros better. --- arch/x86/include/asm/pgtable.h

[PATCH V6 02/10] x86/fpu: Refactor arch_set_user_pkey_access() for PKS support

2021-04-01 Thread ira . weiny
From: Ira Weiny Define a helper, update_pkey_val(), which will be used to support both Protection Key User (PKU) and the new Protection Key for Supervisor (PKS) in subsequent patches. Reviewed-by: Dan Williams Co-developed-by: Peter Zijlstra Signed-off-by: Peter Zijlstra Signed-off-by: Ira

[PATCH V6 00/10] PKS: Add Protection Key Supervisor support

2021-04-01 Thread ira . weiny
From: Ira Weiny Introduce a new page protection mechanism for supervisor pages, Protection Key Supervisor (PKS). Generally PKS enables protections on 'domains' of supervisor pages to limit supervisor mode access to pages beyond the normal paging protections. PKS works in a similar fashion

[PATCH V6 01/10] x86/pkeys: Create pkeys_common.h

2021-04-01 Thread ira . weiny
From: Ira Weiny Protection Keys User (PKU) and Protection Keys Supervisor (PKS) work in similar fashions and can share common defines. Specifically PKS and PKU each have: 1. A single control register 2. The same number of keys 3. The same number of bits in the register

Re: [PATCH V5 08/10] x86/entry: Preserve PKRS MSR across exceptions

2021-03-31 Thread Ira Weiny
On Wed, Mar 31, 2021 at 12:31:56PM -0700, Dave Hansen wrote: > On 3/31/21 12:14 PM, ira.we...@intel.com wrote: > > + * To protect against exceptions having access to this memory we save the > > + * current running value and sets the PKRS value to be used during the > > + * exception. > > This

[PATCH V5 10/10] x86/pks: Add PKS test code

2021-03-31 Thread ira . weiny
From: Ira Weiny The core PKS functionality provides an interface for kernel users to reserve keys to their domains set up the page tables with those keys and control access to those domains when needed. Define test code which exercises the core functionality of PKS via a debugfs entry. Basic

[PATCH V5 08/10] x86/entry: Preserve PKRS MSR across exceptions

2021-03-31 Thread ira . weiny
From: Ira Weiny The PKRS MSR is not managed by XSAVE. It is preserved through a context switch but this support leaves exception handling code open to memory accesses during exceptions. 2 possible places for preserving this state were considered, irqentry_state_t or pt_regs.[1] pt_regs

[PATCH V5 07/10] x86/pks: Preserve the PKRS MSR on context switch

2021-03-31 Thread ira . weiny
From: Ira Weiny The PKRS MSR is defined as a per-logical-processor register. This isolates memory access by logical CPU. Unfortunately, the MSR is not managed by XSAVE. Therefore, tasks must save/restore the MSR value on context switch. Define a saved PKRS value in the task struct, as well

[PATCH V5 04/10] x86/pks: Add PKS defines and Kconfig options

2021-03-31 Thread ira . weiny
From: Ira Weiny Protection Keys for Supervisor pages (PKS) enables fast, hardware thread specific, manipulation of permission restrictions on supervisor page mappings. It uses the same mechanism of Protection Keys as those on User mappings but applies that mechanism to supervisor mappings using

[PATCH V5 09/10] x86/pks: Add PKS kernel API

2021-03-31 Thread ira . weiny
-developed-by: Ira Weiny Signed-off-by: Ira Weiny Signed-off-by: Fenghua Yu --- Changes from V4: From Sean Christopherson Add what happens if the pkey is violated Changes from V3: From Dan Williams Remove flags from pks_key_alloc

[PATCH V5 02/10] x86/fpu: Refactor arch_set_user_pkey_access() for PKS support

2021-03-31 Thread ira . weiny
From: Ira Weiny Define a helper, update_pkey_val(), which will be used to support both Protection Key User (PKU) and the new Protection Key for Supervisor (PKS) in subsequent patches. Reviewed-by: Dan Williams Co-developed-by: Peter Zijlstra Signed-off-by: Peter Zijlstra Signed-off-by: Ira

[PATCH V5 06/10] x86/fault: Adjust WARN_ON for PKey fault

2021-03-31 Thread ira . weiny
From: Ira Weiny Previously if a Protection key fault occurred it indicated something very wrong because user page mappings are not supposed to be in the kernel address space. Now PKey faults may happen on kernel mappings if the feature is enabled. Remove the warning in the fault path and allow

[PATCH V5 00/10] PKS: Add Protection Key Supervisor support

2021-03-31 Thread ira . weiny
From: Ira Weiny Introduce a new page protection mechanism for supervisor pages, Protection Key Supervisor (PKS). Generally PKS enables protections on 'domains' of supervisor pages to limit supervisor mode access to pages beyond the normal paging protections. PKS works in a similar fashion

[PATCH V5 03/10] x86/pks: Add additional PKEY helper macros

2021-03-31 Thread ira . weiny
From: Ira Weiny Avoid open coding shift and mask operations by defining and using helper macros for PKey operations. Reviewed-by: Dan Williams Signed-off-by: Ira Weiny --- Changes from V3: new patch suggested by Dan Williams to use macros better. --- arch/x86/include/asm/pgtable.h

[PATCH V5 01/10] x86/pkeys: Create pkeys_common.h

2021-03-31 Thread ira . weiny
From: Ira Weiny Protection Keys User (PKU) and Protection Keys Supervisor (PKS) work in similar fashions and can share common defines. Specifically PKS and PKU each have: 1. A single control register 2. The same number of keys 3. The same number of bits in the register

[PATCH V5 05/10] x86/pks: Add PKS setup code

2021-03-31 Thread ira . weiny
From: Ira Weiny Protection Keys for Supervisor pages (PKS) enables fast, hardware thread specific, manipulation of permission restrictions on supervisor page mappings. It uses the same mechanism of Protection Keys as those on User mappings but applies that mechanism to supervisor mappings using

Re: [PATCH V4 07/10] x86/pks: Preserve the PKRS MSR on context switch

2021-03-30 Thread Ira Weiny
[snip] The test bot reported build errors on i386 yesterday. Not sure why they were not caught before... Anyway that caused me to look at this patch again and I've found a couple of issues noted below. Combined with Sean's review I'll be re-spinning a new v5. > diff --git

  1   2   3   4   5   6   7   8   9   10   >