Re: [PATCH] powerpc: Fix kernel-jump address for ppc64 wrapper boot

2021-06-08 Thread Oliver O'Halloran
On Tue, Jun 8, 2021 at 4:33 PM He Ying wrote: > > Hello, > > 在 2021/6/8 13:26, Oliver O'Halloran 写道: > > On Fri, Jun 4, 2021 at 7:39 PM He Ying wrote: > >> From "64-bit PowerPC ELF Application Binary Interface Supplement 1.9", > >> we know that the value of a function pointer in a language like

Re: [PATCH v7 01/11] mm/mremap: Fix race between MOVE_PMD mremap and pageout

2021-06-08 Thread Aneesh Kumar K.V
Hi Hugh, Hugh Dickins writes: > On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote: > >> CPU 1CPU 2 >> CPU 3 >> >> mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one >> >> mmap_write_lock_killable() >> >>

[PATCH v3 resend 01/15] mm: add setup_initial_init_mm() helper

2021-06-08 Thread Kefeng Wang
Add setup_initial_init_mm() helper to setup kernel text, data and brk. Cc: linux-snps-...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-c...@vger.kernel.org Cc: uclinux-h8-de...@lists.sourceforge.jp Cc: linux-m...@lists.linux-m68k.org Cc: openr...@lists.librecores.org Cc:

[PATCH v3 resend 11/15] powerpc: convert to setup_initial_init_mm()

2021-06-08 Thread Kefeng Wang
Use setup_initial_init_mm() helper to simplify code. Note klimit is (unsigned long) _end, with new helper, will use _end directly. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kefeng Wang --- arch/powerpc/kernel/setup-common.c | 5 + 1 f

Re: [PATCH v1 04/12] mm/memory_hotplug: remove nid parameter from arch_remove_memory()

2021-06-08 Thread Catalin Marinas
On Mon, Jun 07, 2021 at 09:54:22PM +0200, David Hildenbrand wrote: > The parameter is unused, let's remove it. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntrae

[PATCH v3 0/9] Remove DISCONTIGMEM memory model

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport Hi, SPARSEMEM memory model was supposed to entirely replace DISCONTIGMEM a (long) while ago. The last architectures that used DISCONTIGMEM were updated to use other memory models in v5.11 and it is about the time to entirely remove DISCONTIGMEM from the kernel. This set remo

[PATCH v3 1/9] alpha: remove DISCONTIGMEM and NUMA

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport NUMA is marked broken on alpha for more than 15 years and DISCONTIGMEM was replaced with SPARSEMEM in v5.11. Remove both NUMA and DISCONTIGMEM support from alpha. Signed-off-by: Mike Rapoport --- arch/alpha/Kconfig| 22 --- arch/alpha/include/asm/machvec.h

[PATCH v3 2/9] arc: update comment about HIGHMEM implementation

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport Arc does not use DISCONTIGMEM to implement high memory, update the comment describing how high memory works to reflect this. Signed-off-by: Mike Rapoport Acked-by: Vineet Gupta --- arch/arc/mm/init.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff

[PATCH v3 3/9] arc: remove support for DISCONTIGMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map in v5.11. Remove the support for DISCONTIGMEM entirely. Signed-off-by: Mike Rapoport Acked-by: Vineet Gupta --- arch/arc/Kconfig | 13 arch/arc/include/asm/mmzone.h | 40 -

[PATCH v3 4/9] m68k: remove support for DISCONTIGMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport DISCONTIGMEM was replaced by FLATMEM with freeing of the unused memory map in v5.11. Remove the support for DISCONTIGMEM entirely. Signed-off-by: Mike Rapoport Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- arch/m68k/Kconfig.cpu | 10 -

[PATCH v3 5/9] mm: remove CONFIG_DISCONTIGMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport There are no architectures that support DISCONTIGMEM left. Remove the configuration option and the dead code it was guarding in the generic memory management code. Signed-off-by: Mike Rapoport --- include/asm-generic/memory_model.h | 37 -- incl

[PATCH v3 6/9] arch, mm: remove stale mentions of DISCONIGMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport There are several places that mention DISCONIGMEM in comments or have stale code guarded by CONFIG_DISCONTIGMEM. Remove the dead code and update the comments. Signed-off-by: Mike Rapoport --- arch/ia64/kernel/topology.c | 5 ++--- arch/ia64/mm/numa.c | 5 ++

[PATCH v3 7/9] docs: remove description of DISCONTIGMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport Remove description of DISCONTIGMEM from the "Memory Models" document and update VM sysctl description so that it won't mention DISCONIGMEM. Signed-off-by: Mike Rapoport --- Documentation/admin-guide/sysctl/vm.rst | 12 +++ Documentation/vm/memory-model.rst | 45 ++

[PATCH v3 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport After removal of DISCINTIGMEM the NEED_MULTIPLE_NODES and NUMA configuration options are equivalent. Drop CONFIG_NEED_MULTIPLE_NODES and use CONFIG_NUMA instead. Done with $ sed -i 's/CONFIG_NEED_MULTIPLE_NODES/CONFIG_NUMA/' \ $(git grep -wl CONFIG_N

[PATCH v3 9/9] mm: replace CONFIG_FLAT_NODE_MEM_MAP with CONFIG_FLATMEM

2021-06-08 Thread Mike Rapoport
From: Mike Rapoport After removal of the DISCONTIGMEM memory model the FLAT_NODE_MEM_MAP configuration option is equivalent to FLATMEM. Drop CONFIG_FLAT_NODE_MEM_MAP and use CONFIG_FLATMEM instead. Signed-off-by: Mike Rapoport --- include/linux/mmzone.h | 4 ++-- kernel/crash_core.c| 2 +-

Re: [PATCH v7 01/11] mm/mremap: Fix race between MOVE_PMD mremap and pageout

2021-06-08 Thread Kirill A. Shutemov
On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote: > > Hi Hugh, > > Hugh Dickins writes: > > > On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote: > > > >> CPU 1 CPU 2 > >> CPU 3 > >> > >> mremap(old_addr, new_addr) pa

[PATCH] crash_core, vmcoreinfo: Append 'SECTION_SIZE_BITS' to vmcoreinfo

2021-06-08 Thread Pingfan Liu
As mentioned in kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: Append 'MAX_PHYSMEM_BITS' to vmcoreinfo"), SECTION_SIZE_BITS in the formula: #define SECTIONS_SHIFT(MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) Besides SECTIONS_SHIFT, SECTION_SIZE_BITS is also used to calculate PAGES_PER_SECTI

Re: [PATCH v1 04/12] mm/memory_hotplug: remove nid parameter from arch_remove_memory()

2021-06-08 Thread Michael Ellerman
David Hildenbrand writes: > The parameter is unused, let's remove it. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger > Cc: Yoshinori Sato > Cc: Rich Fe

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-06-08 Thread Ondrej Mosnacek
On Thu, Jun 3, 2021 at 7:46 PM Paul Moore wrote: > On Wed, Jun 2, 2021 at 9:40 AM Ondrej Mosnacek wrote: > > On Fri, May 28, 2021 at 3:37 AM Paul Moore wrote: [...] > > > I know you and Casey went back and forth on this in v1, but I agree > > > with Casey that having two LSM hooks here is a mist

Re: [PATCH] powerpc: Fix kernel-jump address for ppc64 wrapper boot

2021-06-08 Thread He Ying
Hello, 在 2021/6/8 12:55, Christophe Leroy 写道: Le 04/06/2021 à 11:22, He Ying a écrit :  From "64-bit PowerPC ELF Application Binary Interface Supplement 1.9", we know that the value of a function pointer in a language like C is the address of the function descriptor and the first doubleword

Re: [PATCH v1 05/12] mm/memory_hotplug: remove nid parameter from remove_memory() and friends

2021-06-08 Thread Michael Ellerman
David Hildenbrand writes: > There is only a single user remaining. We can simply try to offline all > online nodes - which is fast, because we usually span pages and can skip > such nodes right away. That makes me slightly nervous, because our big powerpc boxes tend to trip on these scaling issue

Re: [PATCH v7 01/11] mm/mremap: Fix race between MOVE_PMD mremap and pageout

2021-06-08 Thread Aneesh Kumar K.V
On 6/8/21 3:12 PM, Kirill A. Shutemov wrote: On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote: Hi Hugh, Hugh Dickins writes: On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote: CPU 1 CPU 2 CPU 3 mremap(old_addr, new_addr

Re: [PATCH v1 05/12] mm/memory_hotplug: remove nid parameter from remove_memory() and friends

2021-06-08 Thread David Hildenbrand
On 08.06.21 13:11, Michael Ellerman wrote: David Hildenbrand writes: There is only a single user remaining. We can simply try to offline all online nodes - which is fast, because we usually span pages and can skip such nodes right away. That makes me slightly nervous, because our big powerpc

Re: [PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32

2021-06-08 Thread Naveen N. Rao
Christophe Leroy wrote: Le 07/06/2021 à 19:36, Christophe Leroy a écrit : Le 07/06/2021 à 16:31, Christophe Leroy a écrit : Le 07/06/2021 à 13:34, Naveen N. Rao a écrit : Naveen N. Rao wrote: Trying to use a kprobe on ppc32 results in the below splat:     BUG: Unable to handle kernel da

[PATCH 0/4] Add perf interface to expose nvdimm

2021-06-08 Thread Kajol Jain
Patchset adds performance stats reporting support for nvdimm. Added interface includes support for pmu register/unregister functions. A structure is added called nvdimm_pmu to be used for adding arch/platform specific data such as supported events, cpumask pmu event functions like event_init/add/re

[PATCH 1/4] drivers/nvdimm: Add nvdimm pmu structure

2021-06-08 Thread Kajol Jain
A structure is added, called nvdimm_pmu, for performance stats reporting support of nvdimm devices. It can be used to add nvdimm pmu data such as supported events and pmu event functions like event_init/add/read/del with cpu hotplug support. Signed-off-by: Kajol Jain --- include/linux/nd.h | 43

[PATCH 2/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats

2021-06-08 Thread Kajol Jain
A common interface is added to get performance stats reporting support for nvdimm devices. Added interface includes support for pmu register/unregister functions, cpu hotplug and pmu event functions like event_init/add/read/del. User could use the standard perf tool to access perf events exposed vi

[PATCH 3/4] powerpc/papr_scm: Add perf interface support

2021-06-08 Thread Kajol Jain
Performance monitoring support for papr-scm nvdimm devices via perf interface is added which includes addition of pmu functions like add/del/read/event_init for nvdimm_pmu struture. A new parameter 'priv' in added to the pdev_archdata structure to save nvdimm_pmu device pointer, to handle the unre

[PATCH 4/4] powerpc/papr_scm: Document papr_scm sysfs event format entries

2021-06-08 Thread Kajol Jain
Details is added for the event, cpumask and format attributes in the ABI documentation. Signed-off-by: Kajol Jain --- Documentation/ABI/testing/sysfs-bus-papr-pmem | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-papr-pmem b/Documentat

Re: [PATCH v7 01/11] mm/mremap: Fix race between MOVE_PMD mremap and pageout

2021-06-08 Thread Kirill A. Shutemov
On Tue, Jun 08, 2021 at 04:47:19PM +0530, Aneesh Kumar K.V wrote: > On 6/8/21 3:12 PM, Kirill A. Shutemov wrote: > > On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote: > > > > > > Hi Hugh, > > > > > > Hugh Dickins writes: > > > > > > > On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:

Re: [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'

2021-06-08 Thread Christophe Leroy
Hi Michael, Le 20/05/2021 à 15:50, Christophe Leroy a écrit : This series is a cleanup of the use of 'struct ppc_inst'. A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of 'unsigned int'.

[PATCH] powerpc/signal64: Copy siginfo before changing regs->nip

2021-06-08 Thread Michael Ellerman
In commit 96d7a4e06fab ("powerpc/signal64: Rewrite handle_rt_signal64() to minimise uaccess switches") the 64-bit signal code was rearranged to use user_write_access_begin/end(). As part of that change the call to copy_siginfo_to_user() was moved later in the function, so that it could be done aft

Re: [PATCH] crash_core, vmcoreinfo: Append 'SECTION_SIZE_BITS' to vmcoreinfo

2021-06-08 Thread Baoquan He
On 06/08/21 at 06:33am, Pingfan Liu wrote: > As mentioned in kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: > Append 'MAX_PHYSMEM_BITS' to vmcoreinfo"), SECTION_SIZE_BITS in the > formula: > #define SECTIONS_SHIFT(MAX_PHYSMEM_BITS - SECTION_SIZE_BITS) > > Besides SECTIONS_SHIFT, SECT

Re: [PATCH v3 resend 11/15] powerpc: convert to setup_initial_init_mm()

2021-06-08 Thread Souptick Joarder
On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang wrote: > > Use setup_initial_init_mm() helper to simplify code. > > Note klimit is (unsigned long) _end, with new helper, > will use _end directly. With this change klimit left with no user in this file and can be moved to some appropriate header. But in

Re: [PATCH v3 resend 01/15] mm: add setup_initial_init_mm() helper

2021-06-08 Thread Souptick Joarder
On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang wrote: > > Add setup_initial_init_mm() helper to setup kernel text, > data and brk. > > Cc: linux-snps-...@lists.infradead.org > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-c...@vger.kernel.org > Cc: uclinux-h8-de...@lists.sourceforge.jp > Cc: li

Re: [PATCH v3 resend 11/15] powerpc: convert to setup_initial_init_mm()

2021-06-08 Thread Christophe Leroy
Le 08/06/2021 à 16:36, Souptick Joarder a écrit : On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang wrote: Use setup_initial_init_mm() helper to simplify code. Note klimit is (unsigned long) _end, with new helper, will use _end directly. With this change klimit left with no user in this file an

Re: [PATCH v3 resend 01/15] mm: add setup_initial_init_mm() helper

2021-06-08 Thread Christophe Leroy
Le 08/06/2021 à 16:53, Souptick Joarder a écrit : On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang wrote: Add setup_initial_init_mm() helper to setup kernel text, data and brk. Cc: linux-snps-...@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-c...@vger.kernel.org Cc: ucli

Re: [PATCH v3 resend 11/15] powerpc: convert to setup_initial_init_mm()

2021-06-08 Thread Souptick Joarder
On Tue, Jun 8, 2021 at 8:24 PM Christophe Leroy wrote: > > > > Le 08/06/2021 à 16:36, Souptick Joarder a écrit : > > On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang > > wrote: > >> > >> Use setup_initial_init_mm() helper to simplify code. > >> > >> Note klimit is (unsigned long) _end, with new helper

Re: [PATCH v3 resend 01/15] mm: add setup_initial_init_mm() helper

2021-06-08 Thread Souptick Joarder
On Tue, Jun 8, 2021 at 8:27 PM Christophe Leroy wrote: > > > > Le 08/06/2021 à 16:53, Souptick Joarder a écrit : > > On Tue, Jun 8, 2021 at 1:56 PM Kefeng Wang > > wrote: > >> > >> Add setup_initial_init_mm() helper to setup kernel text, > >> data and brk. > >> > >> Cc: linux-snps-...@lists.infr

[PATCH 02/16] MIPS: don't include in

2021-06-08 Thread Christoph Hellwig
There is no need to include genhd.h from a random arch header, and not doing so prevents the possibility for nasty include loops. Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/mach-rc32434/rb.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/mips/include/asm/mach-rc32434/r

[PATCH 03/16] bvec: fix the include guards for bvec.h

2021-06-08 Thread Christoph Hellwig
Fix the include guards to match the file naming. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index ff832e698efb..883faf5f1523 100644 --- a/include/linux/bvec.h +++

[PATCH 01/16] mm: use kmap_local_page in memzero_page

2021-06-08 Thread Christoph Hellwig
No need for kmap_atomic here. Signed-off-by: Christoph Hellwig --- include/linux/highmem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 832b49b50c7b..0dc0451cf1d1 100644 --- a/include/linux/highmem.h +++ b/include

switch the block layer to use kmap_local_page

2021-06-08 Thread Christoph Hellwig
Hi all, this series switches the core block layer code and all users of the existing bvec kmap helpers to use kmap_local_page. Drivers that currently use open coded kmap_atomic calls will converted in a follow on series. Diffstat: arch/mips/include/asm/mach-rc32434/rb.h |2 - block/bio-inte

[PATCH 04/16] bvec: add a bvec_kmap_local helper

2021-06-08 Thread Christoph Hellwig
Add a helper to call kmap_local_page on a bvec. There is no need for an unmap helper given that kunmap_local accept any address in the mapped page. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/bvec.h b/include/

[PATCH 05/16] bvec: add memcpy_{from, to}_bvec and memzero_bvec helper

2021-06-08 Thread Christoph Hellwig
Add helpers to perform common memory operation on a bvec. Signed-off-by: Christoph Hellwig --- include/linux/bvec.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index d64d6c0ceb77..ac835fa01ee3 100644 --- a/include/linux/bvec.h

[PATCH 06/16] block: use memzero_page in zero_fill_bio

2021-06-08 Thread Christoph Hellwig
Use memzero_bvec to zero each segment in the bio instead of manually mapping and zeroing the data. Signed-off-by: Christoph Hellwig --- block/bio.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/bio.c b/block/bio.c index 44205dfb6b60..1d7abdb83a39 100644 --- a

[PATCH 07/16] rbd: use memzero_bvec

2021-06-08 Thread Christoph Hellwig
Use memzero_bvec instead of reimplementing it. Signed-off-by: Christoph Hellwig --- drivers/block/rbd.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index bbb88eb009e0..eb243fc4d108 100644 --- a/drivers/block/rbd.c

[PATCH 08/16] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq

2021-06-08 Thread Christoph Hellwig
There is no need to disable interrupts in bio_copy_block, and the local only mappings helps to avoid any sort of problems with stray writes into the bio data. Signed-off-by: Christoph Hellwig --- drivers/md/dm-writecache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/

[PATCH 09/16] ps3disk: use memcpy_{from,to}_bvec

2021-06-08 Thread Christoph Hellwig
Use the bvec helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig --- drivers/block/ps3disk.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index ba3ece56cbb3..f2eb0225814f 100644 --

[PATCH 10/16] block: remove bvec_kmap_irq and bvec_kunmap_irq

2021-06-08 Thread Christoph Hellwig
These two helpers are entirely unused now. Signed-off-by: Christoph Hellwig --- include/linux/bio.h | 42 -- 1 file changed, 42 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index a0b4cfdf62a4..169b14b10c16 100644 --- a/include/linux

[PATCH 11/16] block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec

2021-06-08 Thread Christoph Hellwig
Use the proper helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig --- block/bio.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/block/bio.c b/block/bio.c index 1d7abdb83a39..c14d2e66c084 100644 --- a/block/bio.c +++ b/blo

[PATCH 12/16] block: use memcpy_to_bvec in copy_to_high_bio_irq

2021-06-08 Thread Christoph Hellwig
Use memcpy_to_bvec instead of opencoding the logic. Signed-off-by: Christoph Hellwig --- block/bounce.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/block/bounce.c b/block/bounce.c index 94081e013c58..a2fc6326b6c9 100644 --- a/block/bounce.c +++ b/block/boun

[PATCH 13/16] block: use memcpy_from_bvec in bio_copy_kern_endio_read

2021-06-08 Thread Christoph Hellwig
Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig --- block/blk-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-map.c b/block/blk-map.c index 3743158ddaeb..d1448aaad980 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@

[PATCH 14/16] block: use memcpy_from_bvec in __blk_queue_bounce

2021-06-08 Thread Christoph Hellwig
Rewrite the actual bounce buffering loop in __blk_queue_bounce to that the memcpy_to_bvec helper can be used to perform the data copies. Signed-off-by: Christoph Hellwig --- block/bounce.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/block/bounce.c b

[PATCH 16/16] block: use bvec_kmap_local in bio_integrity_process

2021-06-08 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig --- block/bio-integrity.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-

[PATCH 15/16] block: use bvec_kmap_local in t10_pi_type1_{prepare, complete}

2021-06-08 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig --- block/t10-pi.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index

Re: [PATCH v4 2/4] lazy tlb: allow lazy tlb mm refcounting to be configurable

2021-06-08 Thread Andy Lutomirski
On 6/4/21 6:42 PM, Nicholas Piggin wrote: > Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm > when it is context switched. This can be disabled by architectures that > don't require this refcounting if they clean up lazy tlb mms when the > last refcount is dropped. Currentl

Re: [PATCH 02/16] MIPS: don't include in

2021-06-08 Thread Bart Van Assche
On 6/8/21 9:05 AM, Christoph Hellwig wrote: > There is no need to include genhd.h from a random arch header, and not > doing so prevents the possibility for nasty include loops. > > Signed-off-by: Christoph Hellwig > --- > arch/mips/include/asm/mach-rc32434/rb.h | 2 -- > 1 file changed, 2 delet

Re: [PATCH 03/16] bvec: fix the include guards for bvec.h

2021-06-08 Thread Bart Van Assche
On 6/8/21 9:05 AM, Christoph Hellwig wrote: > Fix the include guards to match the file naming. Reviewed-by: Bart Van Assche

Re: [PATCH 08/16] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq

2021-06-08 Thread Bart Van Assche
On 6/8/21 9:05 AM, Christoph Hellwig wrote: > diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c > index aecc246ade26..93ca454eaca9 100644 > --- a/drivers/md/dm-writecache.c > +++ b/drivers/md/dm-writecache.c > @@ -1205,14 +1205,13 @@ static void memcpy_flushcache_optimized(void *

Re: [PATCH 08/16] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq

2021-06-08 Thread Christoph Hellwig
On Tue, Jun 08, 2021 at 09:30:56AM -0700, Bart Van Assche wrote: > >From one of the functions called by kunmap_local(): > > unsigned long addr = (unsigned long) vaddr & PAGE_MASK; > > This won't work well if bvec->bv_offset >= PAGE_SIZE I assume? It won't indeed. Both the existing and new helpe

Re: [RFC] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-06-08 Thread Pratik Sampat
I've implemented a POC using this interface for the powerpc-utils' ppc64_cpu --frequency command-line tool to utilize this information in userspace. The POC has been hosted here: https://github.com/pratiksampat/powerpc-utils/tree/H_GET_ENERGY_SCALE_INFO and based on comments I suggestions I can f

Re: [PATCH v7 00/11] Speedup mremap on ppc64

2021-06-08 Thread Linus Torvalds
On Mon, Jun 7, 2021 at 3:10 AM Nick Piggin wrote: > > I'd really rather not do this, I'm not sure if micro benchmark captures > everything. I don't much care what powerpc code does _itnernally_ for this architecture-specific mis-design issue, but I really don't want to see more complex generic i

[PATCH] powerpc/32: Remove __main()

2021-06-08 Thread Christophe Leroy
Comment says that __main() is there to make GCC happy. It's been there since the implementation of ppc arch in Linux 1.3.45. ppc32 is the only architecture having that. Even ppc64 doesn't have it. Seems like GCC is still happy without it. Drop it for good. Signed-off-by: Christophe Leroy ---

Re: [PATCH 2/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats

2021-06-08 Thread Peter Zijlstra
On Tue, Jun 08, 2021 at 05:26:58PM +0530, Kajol Jain wrote: > +static int nvdimm_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node) > +{ > + struct nvdimm_pmu *nd_pmu; > + u32 target; > + int nodeid; > + const struct cpumask *cpumask; > + > + nd_pmu = hlist_entry_safe(no

Re: [PATCH 03/16] bvec: fix the include guards for bvec.h

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:06, Christoph Hellwig wrote: > Fix the include guards to match the file naming. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 01/16] mm: use kmap_local_page in memzero_page

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:06, Christoph Hellwig wrote: > No need for kmap_atomic here. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 04/16] bvec: add a bvec_kmap_local helper

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:06, Christoph Hellwig wrote: > Add a helper to call kmap_local_page on a bvec. There is no need for > an unmap helper given that kunmap_local accept any address in the mapped > page. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 06/16] block: use memzero_page in zero_fill_bio

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:07, Christoph Hellwig wrote: > Use memzero_bvec to zero each segment in the bio instead of manually > mapping and zeroing the data. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 05/16] bvec: add memcpy_{from,to}_bvec and memzero_bvec helper

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:07, Christoph Hellwig wrote: > Add helpers to perform common memory operation on a bvec. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 12/16] block: use memcpy_to_bvec in copy_to_high_bio_irq

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:08, Christoph Hellwig wrote: > Use memcpy_to_bvec instead of opencoding the logic. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH 13/16] block: use memcpy_from_bvec in bio_copy_kern_endio_read

2021-06-08 Thread Chaitanya Kulkarni
On 6/8/21 09:09, Christoph Hellwig wrote: > Use memcpy_from_bvec instead of open coding the logic. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni

Re: [PATCH] powerpc/32: Remove __main()

2021-06-08 Thread Segher Boessenkool
On Tue, Jun 08, 2021 at 05:22:51PM +, Christophe Leroy wrote: > Comment says that __main() is there to make GCC happy. > > It's been there since the implementation of ppc arch in Linux 1.3.45. > > ppc32 is the only architecture having that. Even ppc64 doesn't have it. > > Seems like GCC is s

Re: [PATCH] crash_core, vmcoreinfo: Append 'SECTION_SIZE_BITS' to vmcoreinfo

2021-06-08 Thread Andrew Morton
On Tue, 8 Jun 2021 22:24:32 +0800 Baoquan He wrote: > On 06/08/21 at 06:33am, Pingfan Liu wrote: > > As mentioned in kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: > > Append 'MAX_PHYSMEM_BITS' to vmcoreinfo"), SECTION_SIZE_BITS in the > > formula: > > #define SECTIONS_SHIFT(MAX_PHY

[PATCH 00/11] fpga: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix A treewide followup of https://lore.kernel.org/linux-fpga/2faf6ccb-005b-063a-a2a3-e177082c4...@silicom.dk/ Change the use of 'a fpga' to 'an fpga' Ref usage in wiki https://en.wikipedia.org/wiki/Field-programmable_gate_array and Intel's 'FPGAs For Dummies' https://plan.seek.intel.c

[PATCH 01/11] dt-bindings: fpga: fpga-region: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- .../devicetree/bindings/fpga/fpga-region.txt | 22 +-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/fpga/fpga-region.txt b/Documentation/devicetre

[PATCH 03/11] Documentation: ocxl.rst: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- Documentation/userspace-api/accelerators/ocxl.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/userspace-api/accelerators/ocxl.rst b/Documentation/userspace-api/accelerators/ocxl.

[PATCH 02/11] Documentation: fpga: dfl: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- Documentation/fpga/dfl.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/fpga/dfl.rst b/Documentation/fpga/dfl.rst index ccc33f199df2a..ef9eec71f6f3a 100644 --- a/Documentation/

[PATCH 04/11] crypto: marvell: cesa: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/crypto/marvell/cesa/cesa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/marvell/cesa/cesa.h b/drivers/crypto/marvell/cesa/cesa.h index c1007f2ba79c8..d215a6bed6bc7 100644

[PATCH 00/11] fpga: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix A treewide followup of https://lore.kernel.org/linux-fpga/2faf6ccb-005b-063a-a2a3-e177082c4...@silicom.dk/ Change the use of 'a fpga' to 'an fpga' Ref usage in wiki https://en.wikipedia.org/wiki/Field-programmable_gate_array and Intel's 'FPGAs For Dummies' https://plan.seek.intel.c

[PATCH 05/11] fpga: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 33e15058d0dc7..8cd454ee20c0c 100644 --- a/drivers/fpga/Kconfig +++ b/drive

[PATCH 06/11] fpga: bridge: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/fpga-bridge.c | 22 +++--- include/linux/fpga/fpga-bridge.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-b

[PATCH 07/11] fpga-mgr: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/fpga-mgr.c | 22 +++--- include/linux/fpga/fpga-mgr.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c inde

[PATCH 08/11] fpga: region: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/fpga-region.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index c3134b89c3fe5..c5c55d2f20b92 100644 --- a/dri

[PATCH 09/11] fpga: of-fpga-region: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/of-fpga-region.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index e405309baadc1..e3c25576b6b9d 100644 --- a/d

[PATCH 10/11] fpga: stratix10-soc: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/fpga/stratix10-soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index 657a70c5fc996..2aeb53f8e9d0f 100644 --- a/drivers/fpga

[PATCH 11/11] staging: fpgaboot: change FPGA indirect article to an

2021-06-08 Thread trix
From: Tom Rix Change use of 'a fpga' to 'an fpga' Signed-off-by: Tom Rix --- drivers/staging/gs_fpgaboot/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gs_fpgaboot/README b/drivers/staging/gs_fpgaboot/README index b85a76849fc4a..ec1235a21bcc1 100644

Re: [PATCH v2] libnvdimm/pmem: Fix blk_cleanup_disk() usage

2021-06-08 Thread Jens Axboe
On 6/7/21 5:52 PM, Dan Williams wrote: > The queue_to_disk() helper can not be used after del_gendisk() > communicate @disk via the pgmap->owner. > > Otherwise, queue_to_disk() returns NULL resulting in the splat below. > > Kernel attempted to read user page (330) - exploit attempt? (uid: 0) >

Re: [RFC] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-06-08 Thread Fabiano Rosas
"Pratik R. Sampat" writes: Hi, I have some general comments and questions, mostly trying to understand design of the hcall and use cases of the sysfs data: > Adds a generic interface to represent the energy and frequency related > PAPR attributes on the system using the new H_CALL > "H_GET_ENERG

Re: [PATCH] crash_core, vmcoreinfo: Append 'SECTION_SIZE_BITS' to vmcoreinfo

2021-06-08 Thread Pingfan Liu
Correct mail address of Kazuhito On Tue, Jun 8, 2021 at 6:34 PM Pingfan Liu wrote: > > As mentioned in kernel commit 1d50e5d0c505 ("crash_core, vmcoreinfo: > Append 'MAX_PHYSMEM_BITS' to vmcoreinfo"), SECTION_SIZE_BITS in the > formula: > #define SECTIONS_SHIFT(MAX_PHYSMEM_BITS - SECTION_

Re: [PATCH v3 8/9] mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA

2021-06-08 Thread Andrew Morton
On Tue, 8 Jun 2021 12:13:15 +0300 Mike Rapoport wrote: > From: Mike Rapoport > > After removal of DISCINTIGMEM the NEED_MULTIPLE_NODES and NUMA > configuration options are equivalent. > > Drop CONFIG_NEED_MULTIPLE_NODES and use CONFIG_NUMA instead. > > Done with > > $ sed -i 's/CONFIG

Re: [PATCH v7 01/11] mm/mremap: Fix race between MOVE_PMD mremap and pageout

2021-06-08 Thread Hugh Dickins
On Tue, 8 Jun 2021, Aneesh Kumar K.V wrote: > > mm/mremap: hold the rmap lock in write mode when moving page table > entries. > > To avoid a race between rmap walk and mremap, mremap does > take_rmap_locks(). > The lock was taken to ensure that rmap walk don't miss a page table

Re: [PATCH v2 1/3] powerpc/mm/hash: Avoid resizing-down HPT on first memory hotplug

2021-06-08 Thread Leonardo Brás
On Mon, 2021-06-07 at 15:02 +1000, David Gibson wrote: > On Fri, Apr 30, 2021 at 11:36:06AM -0300, Leonardo Bras wrote: > > Because hypervisors may need to create HPTs without knowing the > > guest > > page size, the smallest used page-size (4k) may be chosen, > > resulting in > > a HPT that is pos

[PATCH v15 0/9] powerpc: Further Strict RWX support

2021-06-08 Thread Jordan Niethe
Adding more Strict RWX support on powerpc, in particular Strict Module RWX. It is now rebased on ppc next. For reference the previous revision is available here: https://lore.kernel.org/linuxppc-dev/20210517032810.129949-1-jniet...@gmail.com/ Changes for v15: Christophe Leroy (2): powerpc/mm:

[PATCH v15 1/9] powerpc/mm: Implement set_memory() routines

2021-06-08 Thread Jordan Niethe
From: Russell Currey The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be generic across powerpc's many MMUs. It's possible that this could be optimised to be faster for specific MMUs. This

[PATCH v15 2/9] powerpc/lib/code-patching: Set up Strict RWX patching earlier

2021-06-08 Thread Jordan Niethe
setup_text_poke_area() is a late init call so it runs before mark_rodata_ro() and after the init calls. This lets all the init code patching simply write to their locations. In the future, kprobes is going to allocate its instruction pages RO which means they will need setup_text__poke_area() to ha

[PATCH v15 3/9] powerpc/modules: Make module_alloc() Strict Module RWX aware

2021-06-08 Thread Jordan Niethe
Make module_alloc() use PAGE_KERNEL protections instead of PAGE_KERNEL_EXEX if Strict Module RWX is enabled. Signed-off-by: Jordan Niethe --- v14: - Split out from powerpc: Set ARCH_HAS_STRICT_MODULE_RWX - Add and use strict_module_rwx_enabled() helper --- arch/powerpc/include/asm/mmu.h | 5

[PATCH v15 4/9] powerpc/kprobes: Mark newly allocated probes as ROX

2021-06-08 Thread Jordan Niethe
From: Russell Currey Add the arch specific insn page allocator for powerpc. This allocates ROX pages if STRICT_KERNEL_RWX is enabled. These pages are only written to with patch_instruction() which is able to write RO pages. Reviewed-by: Daniel Axtens Signed-off-by: Russell Currey Signed-off-by

[PATCH v15 5/9] powerpc/bpf: Remove bpf_jit_free()

2021-06-08 Thread Jordan Niethe
Commit 74451e66d516 ("bpf: make jited programs visible in traces") added a default bpf_jit_free() implementation. Powerpc did not use the default bpf_jit_free() as powerpc did not set the images read-only. The default bpf_jit_free() called bpf_jit_binary_unlock_ro() is why it could not be used for

[PATCH v15 6/9] powerpc/bpf: Write protect JIT code

2021-06-08 Thread Jordan Niethe
Add the necessary call to bpf_jit_binary_lock_ro() to remove write and add exec permissions to the JIT image after it has finished being written. Without CONFIG_STRICT_MODULE_RWX the image will be writable and executable until the call to bpf_jit_binary_lock_ro(). Reviewed-by: Christophe Leroy S

  1   2   >