[PATCH V3 06/10] x86/entry: Preserve PKRS MSR across exceptions

2020-11-06 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 V3 08/10] x86/pks: Add PKS kernel API

2020-11-06 Thread ira . weiny
(), pks_mkrdwr(), and pks_key_free(). Add 2 new macros; PAGE_KERNEL_PKEY(key) and _PAGE_PKEY(pkey). Update the protection key documentation to cover pkeys on supervisor pages. Co-developed-by: Ira Weiny Signed-off-by: Ira Weiny Signed-off-by: Fenghua Yu --- Changes from V2 From Greg

[PATCH V3 00/10] PKS: Add Protection Keys Supervisor (PKS) support V3

2020-11-06 Thread ira . weiny
From: Ira Weiny Changes from V2 [4] Rebased on tip-tree/core/entry From Thomas Gleixner Address bisectability Drop Patch: x86/entry: Move nmi entry/exit into common code From Greg KH Remove WARN_ON's

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-09-04 Thread Ira Weiny
On Tue, Sep 03, 2019 at 08:26:18AM +1000, Dave Chinner wrote: > On Wed, Aug 28, 2019 at 07:02:31PM -0700, Ira Weiny wrote: > > On Mon, Aug 26, 2019 at 03:55:10PM +1000, Dave Chinner wrote: > > > On Fri, Aug 23, 2019 at 10:08:36PM -0700, Ira Weiny wrote: > > > > On S

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-08-23 Thread Ira Weiny
On Fri, Aug 23, 2019 at 10:59:14AM +1000, Dave Chinner wrote: > On Wed, Aug 21, 2019 at 11:02:00AM -0700, Ira Weiny wrote: > > On Tue, Aug 20, 2019 at 08:55:15AM -0300, Jason Gunthorpe wrote: > > > On Tue, Aug 20, 2019 at 11:12:10AM +1000, Dave Chinner wrote: > > > >

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-08-23 Thread Ira Weiny
On Fri, Aug 23, 2019 at 01:23:45PM +1000, Dave Chinner wrote: > On Wed, Aug 21, 2019 at 01:44:21PM -0700, Ira Weiny wrote: > > On Wed, Aug 21, 2019 at 04:48:10PM -0300, Jason Gunthorpe wrote: > > > On Wed, Aug 21, 2019 at 11:57:03AM -0700, Ira Weiny wrote: > > > >

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-08-23 Thread Ira Weiny
On Sat, Aug 24, 2019 at 10:11:24AM +1000, Dave Chinner wrote: > On Fri, Aug 23, 2019 at 09:04:29AM -0300, Jason Gunthorpe wrote: > > On Fri, Aug 23, 2019 at 01:23:45PM +1000, Dave Chinner wrote: > > > > > > But the fact that RDMA, and potentially others, can "pass the > > > > pins" to other

Re: [PATCH] IB/core: Add mitigation for Spectre V1

2019-07-30 Thread Ira Weiny
it is > used as an index. > > Signed-off-by: Tony Luck Reviewed-by: Ira Weiny Tested-by: Ira Weiny > --- > > [I don't have h/w, so just compile tested] > > drivers/infiniband/core/user_mad.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/dr

Re: [PATCH] IB/core: Add mitigation for Spectre V1

2019-07-30 Thread Ira Weiny
On Tue, Jul 30, 2019 at 06:52:12PM -0500, Gustavo A. R. Silva wrote: > > > On 7/30/19 3:24 PM, Tony Luck wrote: > > Some processors may mispredict an array bounds check and > > speculatively access memory that they should not. With > > a user supplied array index we like to play things safe > >

[PATCH] fs/xfs: Fix return code of xfs_break_leased_layouts()

2019-08-19 Thread ira . weiny
From: Ira Weiny The parens used in the while loop would result in error being assigned the value 1 rather than the intended errno value. This is required to return -ETXTBSY from follow on break_layout() changes. Signed-off-by: Ira Weiny --- fs/xfs/xfs_pnfs.c | 2 +- 1 file changed, 1

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-08-19 Thread Ira Weiny
On Mon, Aug 19, 2019 at 09:38:41AM -0300, Jason Gunthorpe wrote: > On Mon, Aug 19, 2019 at 07:24:09PM +1000, Dave Chinner wrote: > > > So that leaves just the normal close() syscall exit case, where the > > application has full control of the order in which resources are > > released. We've

Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*()

2019-08-08 Thread Ira Weiny
On Thu, Aug 08, 2019 at 03:59:15PM -0700, John Hubbard wrote: > On 8/8/19 12:20 PM, John Hubbard wrote: > > On 8/8/19 4:09 AM, Vlastimil Babka wrote: > >> On 8/8/19 8:21 AM, Michal Hocko wrote: > >>> On Wed 07-08-19 16:32:08, John Hubbard wrote: > On 8/7/19 4:01 AM, Michal Hocko wrote: >

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-15 Thread Ira Weiny
On Thu, Aug 15, 2019 at 03:35:10PM +0200, Jan Kara wrote: > On Thu 15-08-19 15:26:22, Jan Kara wrote: > > On Wed 14-08-19 20:01:07, John Hubbard wrote: > > > On 8/14/19 5:02 PM, John Hubbard wrote: > > > > > > Hold on, I *was* forgetting something: this was a two part thing, and > > > you're

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread Ira Weiny
On Fri, Aug 16, 2019 at 05:41:08PM +0200, Jan Kara wrote: > On Thu 15-08-19 19:14:08, John Hubbard wrote: > > On 8/15/19 10:41 AM, John Hubbard wrote: > > > On 8/15/19 10:32 AM, Ira Weiny wrote: > > >> On Thu, Aug 15, 2019 at 03:35:10PM +0200, Jan Kara wrote: > &g

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ;-)

2019-08-16 Thread Ira Weiny
On Thu, Aug 15, 2019 at 03:05:58PM +0200, Jan Kara wrote: > On Wed 14-08-19 11:08:49, Ira Weiny wrote: > > On Wed, Aug 14, 2019 at 12:17:14PM +0200, Jan Kara wrote: > > > Hello! > > > > > > On Fri 09-08-19 15:58:14, ira.we...@int

Re: [RFC PATCH 2/2] mm/gup: introduce vaddr_pin_pages_remote()

2019-08-16 Thread Ira Weiny
On Fri, Aug 16, 2019 at 11:50:09AM -0700, John Hubbard wrote: > On 8/16/19 11:33 AM, Ira Weiny wrote: > > On Fri, Aug 16, 2019 at 05:41:08PM +0200, Jan Kara wrote: > > > On Thu 15-08-19 19:14:08, John Hubbard wrote: > > > > On 8/15/19 10:41 AM, John Hubbard wrote:

Re: [RFC PATCH v2 00/19] RDMA/FS DAX truncate proposal V1,000,002 ; -)

2019-08-16 Thread Ira Weiny
On Fri, Aug 16, 2019 at 12:05:28PM -0700, 'Ira Weiny' wrote: > On Thu, Aug 15, 2019 at 03:05:58PM +0200, Jan Kara wrote: > > On Wed 14-08-19 11:08:49, Ira Weiny wrote: > > > On Wed, Aug 14, 2019 at 12:17:14PM +0200, Jan Kara wrote: > > > > Hello! > > > >

Re: add a not device managed memremap_pages v2

2019-08-16 Thread Ira Weiny
m_region > - export the memremap_pages and munmap_pages as kvmppc can be a module Except for the questions from Andrew this does not look to change anything so: Reviewed-by: Ira Weiny > ___ > Linux-nvdimm mailing list > linux-nvd...@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-30 Thread Ira Weiny
> Place a check in the fast path. > > Signed-off-by: Pingfan Liu > Cc: Ira Weiny > Cc: Andrew Morton > Cc: Mike Rapoport > Cc: Dan Williams > Cc: Matthew Wilcox > Cc: John Hubbard > Cc: "Aneesh Kumar K.V" > Cc: Keith Busch > Cc: linux-kernel@

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-30 Thread Ira Weiny
On Thu, May 30, 2019 at 04:21:19PM -0700, John Hubbard wrote: > On 5/30/19 2:47 PM, Ira Weiny wrote: > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > [...] > >> + for (j = i; j < nr; j++) > >> +

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-31 Thread Ira Weiny
On Fri, May 31, 2019 at 07:05:27PM +0800, Pingfan Liu wrote: > On Fri, May 31, 2019 at 7:21 AM John Hubbard wrote: > > > > > > Rather lightly tested...I've compile-tested with CONFIG_CMA and !CONFIG_CMA, > > and boot tested with CONFIG_CMA, but could use a second set of eyes on > > whether > >

Re: [PATCHv3 1/2] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-06-13 Thread Ira Weiny
On Wed, Jun 12, 2019 at 09:54:58PM +0800, Pingfan Liu wrote: > On Tue, Jun 11, 2019 at 04:29:11PM +, Weiny, Ira wrote: > > > Pingfan Liu writes: > > > > > > > As for FOLL_LONGTERM, it is checked in the slow path > > > > __gup_longterm_unlocked(). But it is not checked in the fast path, > > >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > On Fri, Jun 07, 2019 at 11:25:35AM -0700, Ira Weiny wrote: > > > Are you suggesting that we have something like this from user space? >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Wed, Jun 12, 2019 at 03:54:19PM -0700, Dan Williams wrote: > On Wed, Jun 12, 2019 at 3:12 PM Ira Weiny wrote: > > > > On Wed, Jun 12, 2019 at 04:14:21PM -0300, Jason Gunthorpe wrote: > > > On Wed, Jun 12, 2019 at 02:09:07PM +0200, Jan Kara wrote: > > >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Wed, Jun 12, 2019 at 04:14:21PM -0300, Jason Gunthorpe wrote: > On Wed, Jun 12, 2019 at 02:09:07PM +0200, Jan Kara wrote: > > On Wed 12-06-19 08:47:21, Jason Gunthorpe wrote: > > > On Wed, Jun 12, 2019 at 12:29:17PM +0200, Jan Kara wrote: > > > > > > > > > The main objection to the current ODP

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 10:55:52AM +1000, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 04:30:24PM -0700, Ira Weiny wrote: > > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > > >

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 05:37:53AM -0700, Matthew Wilcox wrote: > > On Sat, Jun 08, 2019 at 10:10:36AM +1000, Dave Chinner wrote: > > > On Fri, Jun 07, 2019 at 11:25:35AM -0700, Ira Weiny wrote: > > > > A

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > > e.g. Process A has an exclusive layout lease on file F. It does an > > IO to file F. The filesystem IO path checks that Process A owns the > > lease on the file and

Re: [PATCHv4 1/3] mm/gup: rename nr as nr_pinned in get_user_pages_fast()

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 06:45:00PM +0800, Pingfan Liu wrote: > To better reflect the held state of pages and make code self-explaining, > rename nr as nr_pinned. > > Signed-off-by: Pingfan Liu Reviewed-by: Ira Weiny > Cc: Andrew Morton > Cc: Mike Rapoport > Cc: Dan Wi

Re: [PATCHv4 2/3] mm/gup: fix omission of check on FOLL_LONGTERM in gup fast path

2019-06-13 Thread Ira Weiny
n > the fast path, which means a possible leak of CMA page to longterm pinned > requirement through this crack. > > Place a check in gup_pte_range() in the fast path. > > Signed-off-by: Pingfan Liu > Cc: Ira Weiny > Cc: Andrew Morton > Cc: Mike Rapoport > Cc: Dan

Re: [PATCHv4 3/3] mm/gup_benchemark: add LONGTERM_BENCHMARK test in gup fast path

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 06:45:02PM +0800, Pingfan Liu wrote: > Introduce a GUP_LONGTERM_BENCHMARK ioctl to test longterm pin in gup fast > path. > > Signed-off-by: Pingfan Liu > Cc: Ira Weiny > Cc: Andrew Morton > Cc: Mike Rapoport > Cc: Dan Williams > Cc: Matthew

Re: [PATCHv4 3/3] mm/gup_benchemark: add LONGTERM_BENCHMARK test in gup fast path

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 02:42:47PM -0700, 'Ira Weiny' wrote: > On Thu, Jun 13, 2019 at 06:45:02PM +0800, Pingfan Liu wrote: > > Introduce a GUP_LONGTERM_BENCHMARK ioctl to test longterm pin in gup fast > > path. > > > > Signed-off-by: Pingfan Liu > > Cc: Ira Wei

Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:45:30PM -0300, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 02:13:21PM -0700, Ira Weiny wrote: > > On Thu, Jun 13, 2019 at 08:27:55AM -0700, Matthew Wilcox wrote: > > > On Thu, Jun 13, 2019 at 10:25:55AM +1000, Dave Chinner wrote: > >

Re: [PATCH 3/3] net/xdp: convert put_page() to put_user_page*()

2019-07-22 Thread Ira Weiny
On Mon, Jul 22, 2019 at 03:34:15PM -0700, john.hubb...@gmail.com wrote: > From: John Hubbard > > For pages that were retained via get_user_pages*(), release those pages > via the new put_user_page*() routines, instead of via put_page() or > release_pages(). > > This is part a tree-wide

Re: [PATCH] mm/gup: don't permit users to call get_user_pages with FOLL_LONGTERM

2020-08-19 Thread Ira Weiny
; Cc: Jérôme Glisse > Cc: "Matthew Wilcox (Oracle)" > Cc: Al Viro > Cc: Christoph Hellwig > Cc: Dan Williams > Cc: Dave Chinner > Cc: Jason Gunthorpe > Cc: Jonathan Corbet > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Shuah Khan > Cc: Vlastimil

Re: [PATCH 0/2] Cyrpto: Clean up kmap() use

2020-08-19 Thread Ira Weiny
On Mon, Aug 10, 2020 at 05:40:13PM -0700, 'Ira Weiny' wrote: > From: Ira Weiny > > While going through kmap() users the following 2 issues were found via code > inspection. Any feedback on these patches? Perhaps I've not included the correct people? Adding some people to

Re: [PATCH] drivers/dax: Use kobj_to_dev() instead

2020-08-19 Thread Ira Weiny
On Thu, Aug 13, 2020 at 11:27:02AM +0800, Wang Qing wrote: > Use kobj_to_dev() instead of container_of() > > Signed-off-by: Wang Qing LTGM Reviewed-by: Ira Weiny > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dri

[PATCH] mm/highmem: Clean up endif comments

2020-08-19 Thread ira . weiny
From: Ira Weiny The #endif at the end of the file matches up with the '#if defined(HASHED_PAGE_VIRTUAL)' on line 374. Not the CONFIG_HIGHMEM #if earlier. Fix comments on both of the #endif's to indicate the correct end of blocks for each. Signed-off-by: Ira Weiny --- mm/highmem.c | 4

Re: [PATCH v2 2/3] libnvdimm/security: the 'security' attr never show 'overwrite' state

2020-08-06 Thread Ira Weiny
flags; and when the operation > completes, it removes the bit. Hence security_show() should check the > 'overwrite' bit first, in order to indicate the actual state when multiple > bits are set in the flags. > > Signed-off-by: Jane Chu > Reviewed-by: Dave Jiang Reviewed-by

Re: [PATCH v2 1/3] libnvdimm/security: fix a typo

2020-08-06 Thread Ira Weiny
s'. > > Cc: Dan Williams > Fixes: d78c620a2e82 ("libnvdimm/security: Introduce a 'frozen' attribute") > Signed-off-by: Jane Chu > Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny > --- > drivers/nvdimm/security.c | 2 +- > 1 file changed, 1 insertion(+), 1 deleti

Re: [PATCH v2 3/3] libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr

2020-08-06 Thread Ira Weiny
rwrite nmemX" again, > the command returns instantly. > > Cc: Dave Jiang > Cc: Dan Williams > Fixes: 7d988097c546 ("acpi/nfit, libnvdimm/security: Add security DSM > overwrite support") > Signed-off-by: Jane Chu > Reviewed-by: Dave Jiang Reviewed-by: Ira

Re: [PATCH v3 33/38] virtio_pmem: convert to LE accessors

2020-08-07 Thread Ira Weiny
onfig, > + virtio_cread_le(vpmem->vdev, struct virtio_pmem_config, > size, >size); FWIW I think squashing patch 15/38 and this patch would have made more sense. Acked-by: Ira Weiny > > res.start = vpmem->start; > -- > MST >

Re: [PATCH 1/4] mm: Trial do_wp_page() simplification

2020-09-17 Thread Ira Weiny
On Thu, Sep 17, 2020 at 07:09:00PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 17, 2020 at 05:40:59PM -0400, Peter Xu wrote: > > On Thu, Sep 17, 2020 at 01:35:56PM -0700, Linus Torvalds wrote: > > > For that to happen, we'd need to have the vma flag so that we wouldn't > > > have any worry about

Re: [PATCH v2] fs: Kill DCACHE_DONTCACHE dentry even if DCACHE_REFERENCED is set

2020-09-24 Thread Ira Weiny
t, the dentry will be > killed and the inode will be evicted. In this way, if we change per-file > DAX policy, it will take effects automatically after this file is closed > by all processes. > > I also add some comments to make the code more clear. > > Signed-off-by

Re: [PATCH V2 00/10] PKS: Add Protection Keys Supervisor (PKS) support

2020-11-04 Thread Ira Weiny
On Tue, Nov 03, 2020 at 12:36:16AM +0100, Thomas Gleixner wrote: > On Mon, Nov 02 2020 at 12:53, ira weiny wrote: > > Fenghua Yu (2): > > x86/pks: Enable Protection Keys Supervisor (PKS) > > x86/pks: Add PKS kernel API > > > > Ira Weiny (7): > > x86/pke

Re: [PATCH V2 00/10] PKS: Add Protection Keys Supervisor (PKS) support

2020-11-04 Thread Ira Weiny
On Wed, Nov 04, 2020 at 11:00:04PM +0100, Thomas Gleixner wrote: > On Wed, Nov 04 2020 at 09:46, Ira Weiny wrote: > > On Tue, Nov 03, 2020 at 12:36:16AM +0100, Thomas Gleixner wrote: > >> This is the wrong ordering, really. > >> > >> x86/entry:

Re: [PATCH V2 00/10] PKS: Add Protection Keys Supervisor (PKS) support

2020-11-04 Thread Ira Weiny
On Wed, Nov 04, 2020 at 02:45:54PM -0800, 'Ira Weiny' wrote: > On Wed, Nov 04, 2020 at 11:00:04PM +0100, Thomas Gleixner wrote: > > On Wed, Nov 04 2020 at 09:46, Ira Weiny wrote: > > > On Tue, Nov 03, 2020 at 12:36:16AM +0100, Thomas Gleixner wrote: > > >> This

[PATCH] entry: Fix spelling/typo errors in irq entry code

2020-11-04 Thread ira . weiny
From: Ira Weiny s/reguired/required/ s/Interupts/Interrupts/ s/quiescient/quiescent/ s/assemenbly/assembly/ Signed-off-by: Ira Weiny --- include/linux/entry-common.h | 4 ++-- kernel/entry/common.c| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux

Re: [RFC] nvfs: a filesystem for persistent memory

2020-09-22 Thread Ira Weiny
On Mon, Sep 21, 2020 at 12:19:07PM -0400, Mikulas Patocka wrote: > > > On Tue, 15 Sep 2020, Dan Williams wrote: > > > > TODO: > > > > > > - programs run approximately 4% slower when running from Optane-based > > > persistent memory. Therefore, programs and libraries should use page cache > > >

Re: [PATCH] man/statx: Add STATX_ATTR_DAX

2020-09-28 Thread Ira Weiny
On Mon, May 04, 2020 at 05:20:16PM -0700, 'Ira Weiny' wrote: > From: Ira Weiny > > Linux 5.8 is slated to have STATX_ATTR_DAX support. > > https://lore.kernel.org/lkml/20200428002142.404144-4-ira.we...@intel.com/ > https://lore.kernel.org/lkml/20200504161352.GA13783@magnolia/

Re: [PATCH] nvdimm: Use kobj_to_dev() API

2020-09-28 Thread Ira Weiny
On Sat, Sep 26, 2020 at 02:54:17PM +0800, Wang Qing wrote: > Use kobj_to_dev() instead of container_of(). > > Signed-off-by: Wang Qing Reviewed-by: Ira Weiny > --- > drivers/nvdimm/namespace_devs.c | 2 +- > drivers/nvdimm/region_devs.c| 4 ++-- > 2 files change

Re: [PATCH] mm/vmalloc.c: check the addr first

2020-09-28 Thread Ira Weiny
On Mon, Sep 28, 2020 at 12:33:37AM +0800, Hui Su wrote: > As the comments said, if @addr is NULL, no operation > is performed, check the addr first in vfree() and > vfree_atomic() maybe a better choice. I don't see how this change helps anything. kmemleak_free() checks addr so no danger there.

Re: [PATCH 6/8] selftests/vm: gup_test: introduce the dump_pages() sub-test

2020-09-28 Thread Ira Weiny
On Sun, Sep 27, 2020 at 11:21:57PM -0700, John Hubbard wrote: > For quite a while, I was doing a quick hack to gup_test.c (previously, > gup_benchmark.c) whenever I wanted to try out my changes to dump_page(). > This makes that hack unnecessary, and instead allows anyone to easily > get the same

Re: [PATCH 7/8] selftests/vm: run_vmtest.sh: update and clean up gup_test invocation

2020-09-28 Thread Ira Weiny
On Sun, Sep 27, 2020 at 11:21:58PM -0700, John Hubbard wrote: > Run benchmarks on the _fast variants of gup and pup, as originally > intended. > > Run the new gup_test sub-test: dump pages. In addition to exercising the > dump_page() call, it also demonstrates the various options you can use > to

Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Ira Weiny
On Mon, Oct 12, 2020 at 05:44:38PM +0100, Matthew Wilcox wrote: > On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > > kmap_atomic() is always preferred over kmap()/kmap_thread(). > > kmap_atomic() is _much_ more lightweight since its TLB invalidation is > > always CPU-local and never

Re: [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Ira Weiny
On Mon, Oct 12, 2020 at 09:02:54PM +0100, Matthew Wilcox wrote: > On Mon, Oct 12, 2020 at 12:53:54PM -0700, Ira Weiny wrote: > > On Mon, Oct 12, 2020 at 05:44:38PM +0100, Matthew Wilcox wrote: > > > On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > > >

Re: [PATCH RFC V3 1/9] x86/pkeys: Create pkeys_common.h

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 10:46:16AM -0700, Dave Hansen wrote: > On 10/9/20 12:42 PM, ira.we...@intel.com wrote: > > Protection Keys User (PKU) and Protection Keys Supervisor (PKS) work > > in similar fashions and can share common defines. > > Could we be a bit less abstract? PKS and PKU each

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > On Tue, Oct 13, 2020 at 11:44:29AM -0700, Dan Williams wrote: > > On Fri, Oct 9, 2020 at 12:52 PM wrote: > > > > > > From: Ira Weiny > > > > > > The kmap() calls in this F

Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 09:01:49PM +0100, Al Viro wrote: > On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote: > > > static inline void copy_to_highpage(struct page *to, void *vfrom, unsigned > > int size) > > { > > char *vto = kmap_atomic(to); > > > > memcpy(vto, vfrom,

Re: [PATCH RFC PKS/PMEM 24/58] fs/freevxfs: Utilize new kmap_thread()

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 12:25:44PM +0100, Christoph Hellwig wrote: > > - kaddr = kmap(pp); > > + kaddr = kmap_thread(pp); > > memcpy(kaddr, vip->vii_immed.vi_immed + offset, PAGE_SIZE); > > - kunmap(pp); > > + kunmap_thread(pp); > > You only Cced me on this particular patch, which

Re: [PATCH RFC V3 2/9] x86/fpu: Refactor arch_set_user_pkey_access() for PKS support

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 10:50:05AM -0700, Dave Hansen wrote: > On 10/9/20 12:42 PM, ira.we...@intel.com wrote: > > +/* > > + * Update the pk_reg value and return it. > > How about: > > Replace disable bits for @pkey with values from @flags. Done. > > > + * Kernel users use the same

Re: [PATCH RFC V3 3/9] x86/pks: Enable Protection Keys Supervisor (PKS)

2020-10-13 Thread Ira Weiny
On Tue, Oct 13, 2020 at 11:23:08AM -0700, Dave Hansen wrote: > On 10/9/20 12:42 PM, ira.we...@intel.com wrote: > > +/* > > + * PKS is independent of PKU and either or both may be supported on a CPU. > > + * Configure PKS if the cpu supports the feature. > > + */ > > Let's at least be consistent

Re: [PATCH V2 05/10] x86/pks: Add PKS kernel API

2020-11-03 Thread Ira Weiny
On Tue, Nov 03, 2020 at 07:50:24AM +0100, Greg KH wrote: > On Mon, Nov 02, 2020 at 12:53:15PM -0800, ira.we...@intel.com wrote: > > From: Fenghua Yu > > [snip] > > diff --git a/include/linux/pkeys.h b/include/linux/pkeys.h > > index 2955ba976048..0959a4c0ca64 100644 > > ---

Re: [PATCH V2 05/10] x86/pks: Add PKS kernel API

2020-11-03 Thread Ira Weiny
On Tue, Nov 03, 2020 at 07:14:07PM +0100, Greg KH wrote: > On Tue, Nov 03, 2020 at 09:53:36AM -0800, Ira Weiny wrote: > > On Tue, Nov 03, 2020 at 07:50:24AM +0100, Greg KH wrote: > > > On Mon, Nov 02, 2020 at 12:53:15PM -0800, ira.we...@intel.com wrote: > &

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

2020-11-02 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 V2 05/10] x86/pks: Add PKS kernel API

2020-11-02 Thread ira . weiny
(), pks_mkrdwr(), and pks_key_free(). Add 2 new macros; PAGE_KERNEL_PKEY(key) and _PAGE_PKEY(pkey). Update the protection key documentation to cover pkeys on supervisor pages. Co-developed-by: Ira Weiny Signed-off-by: Ira Weiny Signed-off-by: Fenghua Yu --- Changes from V1 Per Dave

[PATCH V2 04/10] x86/pks: Preserve the PKRS MSR on context switch

2020-11-02 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 V2 07/10] x86/entry: Pass irqentry_state_t by reference

2020-11-02 Thread ira . weiny
From: Ira Weiny Currently struct irqentry_state_t only contains a single bool value which makes passing it by value is reasonable. However, future patches propose to add information to this struct, for example the PKRS register/thread state. Adding information to irqentry_state_t makes passing

[PATCH V2 00/10] PKS: Add Protection Keys Supervisor (PKS) support

2020-11-02 Thread ira . weiny
From: Ira Weiny Changes from V1 Rebase to TIP master; resolve conflicts and test Clean up some kernel docs updates missed in V1 Add irqentry_state_t kernel doc for PKRS field Removed redundant irq_state->pkrs This is only needed when we

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

2020-11-02 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 V2 09/10] x86/fault: Report the PKRS state on fault

2020-11-02 Thread ira . weiny
From: Ira Weiny When only user space pkeys are enabled faulting within the kernel was an unexpected condition which should never happen. Therefore a WARN_ON in the kernel fault handler would detect if it ever did. Now this is no longer the case if PKS is enabled and supported. Report a Pkey

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

2020-11-02 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 V2 06/10] x86/entry: Move nmi entry/exit into common code

2020-11-02 Thread ira . weiny
irqentry_state_t to carry lockdep state. Ira: Make exit_rcu and lockdep a union as they are mutually exclusive between the IRQ and NMI exceptions, and add kernel documentation for struct irqentry_state_t Signed-off-by: Thomas Gleixner Signed-off-by: Ira Weiny --- Changes from V1 Update commit

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

2020-11-02 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. Co-developed-by: Peter Zijlstra Signed-off-by: Peter Zijlstra Signed-off-by: Ira Weiny --- Changes from RFC

[PATCH V2 03/10] x86/pks: Enable Protection Keys Supervisor (PKS)

2020-11-02 Thread ira . weiny
and then enable PKS when configured and indicated by the CPU instance. While not strictly necessary in this patch, ARCH_HAS_SUPERVISOR_PKEYS separates this functionality through the patch series so it is introduced here. Co-developed-by: Ira Weiny Signed-off-by: Ira Weiny Signed-off-by: Fenghua Yu

Re: [PATCH v2 1/1] mm: Optimizing hugepage zeroing in arm64

2021-02-03 Thread Ira Weiny
ee? If not who? If you take the above patch I can drop it from the series I'm about to submit to convert btrfs kmaps. Ira >Regards, >Prathu Baronia > > On Wed, Feb 3, 2021 at 1:33 AM Ira Weiny <[2]ira.we...@intel.com> wrote: > > On Tue, Feb 02

[PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()

2021-02-01 Thread ira . weiny
From: Ira Weiny kmap is inefficient and we are trying to reduce the usage in the kernel. There is no readily apparent reason why the initp_page page needs to be allocated and kmap'ed() but sigstruct needs to be page aligned and token 512 byte aligned. In this case page_address() can be used

[PATCH] fs/coredump: Use kmap_local_page()

2021-02-03 Thread ira . weiny
From: Ira Weiny In dump_user_range() there is no reason for the mapping to be global. Use kmap_local_page() rather than kmap. Cc: Andrew Morton Cc: linux-kernel@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Signed-off-by: Ira Weiny --- fs/coredump.c | 4 ++-- 1 file changed, 2 insertions

[PATCH] fs/btrfs: Fix raid6 qstripe kmap'ing

2021-01-27 Thread ira . weiny
From: Ira Weiny When a qstripe is required an extra page is allocated and mapped. There were 3 problems. 1) There is no reason to map the qstripe page more than 1 time if the number of bits set in rbio->dbitmap is greater than one. 2) There is no reason to map the parity page and un

[PATCH] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()

2021-01-28 Thread ira . weiny
From: Ira Weiny There is no reason to alloc a page and kmap it to store this temporary data from the user. This is especially true when we are trying to remove kmap usages. Also placing the token pointer 1/2 way into the page is fragile. Replace this allocation with two kzalloc()'s which also

[PATCH V3] x86: Remove unnecessary kmap() from sgx_ioc_enclave_init()

2021-02-02 Thread ira . weiny
From: Ira Weiny kmap is inefficient and we are trying to reduce the usage in the kernel. There is no readily apparent reason why initp_page needs to be allocated and kmap'ed() but sigstruct needs to be page aligned and token 512 byte aligned. kmalloc() can give us this alignment but we need

Re: [PATCH v2 1/1] mm: Optimizing hugepage zeroing in arm64

2021-02-02 Thread Ira Weiny
--- > > Malloc test timings for 100MB anon allocation:- > > Base data:- > Number of iterations: 100 > Mean of allocation time: 31831 us > std deviation: 4286 us > > v1 data:- > Number of iterations: 100 > Mean of allocation time: 1819

[PATCH] nvdimm: Trivial comment fix

2019-09-18 Thread ira . weiny
From: Ira Weiny Signed-off-by: Ira Weiny --- include/linux/nd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nd.h b/include/linux/nd.h index f778f962d1b6..55c735997805 100644 --- a/include/linux/nd.h +++ b/include/linux/nd.h @@ -147,7 +147,7 @@ static

Re: [PATCH] libnvdimm/nfit_test: Fix acpi_handle redefinition

2019-09-18 Thread Ira Weiny
this by including linux/acpi.h in nfit_test.h, which allows us to > remove both the typedef and the forward declaration of acpi_object. > > Link: https://github.com/ClangBuiltLinux/linux/issues/660 > Signed-off-by: Nathan Chancellor Reviewed-by: Ira Weiny > --- > > I know that

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-18 Thread Ira Weiny
On Sun, May 17, 2020 at 09:29:32PM -0700, Guenter Roeck wrote: > On Sun, May 17, 2020 at 08:49:39PM -0700, Ira Weiny wrote: > > On Sat, May 16, 2020 at 03:33:06PM -0700, Guenter Roeck wrote: > > > On Thu, May 07, 2020 at 07:59:55AM -0700, ira.we...@intel.com wrote: >

Re: [PATCH V3 07/15] arch/kunmap_atomic: Consolidate duplicate code

2020-05-19 Thread Ira Weiny
On Mon, May 18, 2020 at 07:50:36PM -0700, Guenter Roeck wrote: > Hi Ira, > > On 5/18/20 5:03 PM, Ira Weiny wrote: > > On Sun, May 17, 2020 at 09:29:32PM -0700, Guenter Roeck wrote: > >> On Sun, May 17, 2020 at 08:49:39PM -0700, Ira Weiny wrote: > >>> On S

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: > > From: Ira Weiny > > > > The kunmap_atomic clean up failed to remove one set of pagefault/preempt > > enables when vaddr is not in

Re: [PATCH 3/9] fs/ext4: Disallow encryption if inode is DAX

2020-05-19 Thread Ira Weiny
On Mon, May 18, 2020 at 09:24:47AM -0700, Eric Biggers wrote: > On Sun, May 17, 2020 at 10:03:15PM -0700, Ira Weiny wrote: First off... OMG... I'm seeing some possible user pitfalls which are complicating things IMO. It probably does not matter because most users don't care and have eit

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > On Tue, May 19, 2020 at 11:40:32AM -0700, Ira Weiny wrote: > > On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > > > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: >

Re: [PATCH] arch/{mips,sparc,microblaze,powerpc}: Don't enable pagefault/preempt twice

2020-05-19 Thread Ira Weiny
On Tue, May 19, 2020 at 12:42:15PM -0700, Guenter Roeck wrote: > On Tue, May 19, 2020 at 11:40:32AM -0700, Ira Weiny wrote: > > On Tue, May 19, 2020 at 09:54:22AM -0700, Guenter Roeck wrote: > > > On Mon, May 18, 2020 at 11:48:43AM -0700, ira.we...@intel.com wrote: >

[PATCH V3 3/8] fs/ext4: Change EXT4_MOUNT_DAX to EXT4_MOUNT_DAX_ALWAYS

2020-05-19 Thread ira . weiny
From: Ira Weiny In prep for the new tri-state mount option which then introduces EXT4_MOUNT_DAX_NEVER. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny --- Changes: New patch --- fs/ext4/ext4.h | 4 ++-- fs/ext4/inode.c | 2 +- fs/ext4/super.c | 12 ++-- 3 files changed, 9

[PATCH V3 7/8] fs/ext4: Introduce DAX inode flag

2020-05-19 Thread ira . weiny
From: Ira Weiny Add a flag to preserve FS_XFLAG_DAX in the ext4 inode. Set the flag to be user visible and changeable. Set the flag to be inherited. Allow applications to change the flag at any time with the exception of if VERITY or ENCRYPT is set. Disallow setting VERITY or ENCRYPT if DAX

[PATCH V3 2/8] fs/ext4: Disallow verity if inode is DAX

2020-05-19 Thread ira . weiny
From: Ira Weiny Verity and DAX are incompatible. Changing the DAX mode due to a verity flag change is wrong without a corresponding address_space_operations update. Make the 2 options mutually exclusive by returning an error if DAX was set first. (Setting DAX is already disabled if Verity

[PATCH V3 8/8] Documentation/dax: Update DAX enablement for ext4

2020-05-19 Thread ira . weiny
From: Ira Weiny Update the document to reflect ext4 and xfs now behave the same. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny --- Changes from RFC: Update with ext2 text... --- Documentation/filesystems/dax.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH V3 0/8] Enable ext4 support for per-file/directory DAX operations

2020-05-19 Thread ira . weiny
From: Ira Weiny Changes from V2: Rework DAX exclusivity with verity and encryption based on feedback from Eric Enable the same per file DAX support in ext4 as was done for xfs. This series builds and depends on the V11 series for xfs.[1] This passes the same xfstests test

[PATCH V3 5/8] fs/ext4: Only change S_DAX on inode load

2020-05-19 Thread ira . weiny
From: Ira Weiny To prevent complications with in memory inodes we only set S_DAX on inode load. FS_XFLAG_DAX can be changed at any time and S_DAX will change after inode eviction and reload. Add init bool to ext4_set_inode_flags() to indicate if the inode is being newly initialized. Assert

[PATCH V3 6/8] fs/ext4: Make DAX mount option a tri-state

2020-05-19 Thread ira . weiny
From: Ira Weiny We add 'always', 'never', and 'inode' (default). '-o dax' continues to operate the same which is equivalent to 'always'. This new functionality is limited to ext4 only. Specifically we introduce a 2nd DAX mount flag EXT4_MOUNT2_DAX_NEVER and set it and EXT4_MOUNT_DAX_ALWAYS

[PATCH V3 4/8] fs/ext4: Update ext4_should_use_dax()

2020-05-19 Thread ira . weiny
From: Ira Weiny S_DAX should only be enabled when the underlying block device supports dax. Change ext4_should_use_dax() to check for device support prior to the over riding mount option. While we are at it change the function to ext4_should_enable_dax() as this better reflects the ask as well

[PATCH V3 1/8] fs/ext4: Narrow scope of DAX check in setflags

2020-05-19 Thread ira . weiny
From: Ira Weiny When preventing DAX and journaling on an inode. Use the effective DAX check rather than the mount option. This will be required to support per inode DAX flags. Reviewed-by: Jan Kara Signed-off-by: Ira Weiny --- fs/ext4/ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [RESEND PATCH v7 3/5] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-05-20 Thread Ira Weiny
On Wed, May 20, 2020 at 12:30:56AM +0530, Vaibhav Jain wrote: > Implement support for fetching nvdimm health information via > H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair > of 64-bit big-endian integers, bitwise-and of which is then stored in > 'struct papr_scm_priv' and

<    1   2   3   4   5   6   7   8   9   10   >