[PATCH 04/13] livepatch: move klp_find_object_module to module.c

2021-01-21 Thread Christoph Hellwig
To uncouple the livepatch code from module loader internals move a slightly refactored version of klp_find_object_module to module.c This allows to mark find_module static and removes one of the last users of module_mutex outside of module.c. Signed-off-by: Christoph Hellwig ---

Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit

2021-01-21 Thread Daniel Vetter
On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE. > > Signed-off-by: Christoph Hellwig I didn't spot any dependencies

[PATCH 09/13] module: remove each_symbol_in_section

2021-01-21 Thread Christoph Hellwig
each_symbol_in_section just contains a trivial loop over its arguments. Just open code the loop in the two callers. Signed-off-by: Christoph Hellwig --- kernel/module.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/module.c

Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit

2021-01-21 Thread Christoph Hellwig
On Thu, Jan 21, 2021 at 09:25:40AM +0100, Daniel Vetter wrote: > On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > > simple functionality. Just open code it in the only caller using > > IS_ENABLED and IS_MODULE.

[PATCH 03/13] livepatch: refactor klp_init_object

2021-01-21 Thread Christoph Hellwig
Merge three calls to klp_is_module (including one hidden inside klp_find_object_module) into a single one to simplify the code a bit. Signed-off-by: Christoph Hellwig --- kernel/livepatch/core.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 05/13] kallsyms: refactor {,module_}kallsyms_on_each_symbol

2021-01-21 Thread Christoph Hellwig
Require an explicit cll to module_kallsyms_on_each_symbol to look for symbols in modules instead of the call from kallsyms_on_each_symbol, and acquire module_mutex inside of module_kallsyms_on_each_symbol instead of leaving that up to the caller. Signed-off-by: Christoph Hellwig ---

[PATCH 08/13] drm: remove drm_fb_helper_modinit

2021-01-21 Thread Christoph Hellwig
drm_fb_helper_modinit has a lot of boilerplate for what is not very simple functionality. Just open code it in the only caller using IS_ENABLED and IS_MODULE. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_crtc_helper_internal.h | 10 - drivers/gpu/drm/drm_fb_helper.c

[PATCH 13/13] module: remove EXPORY_UNUSED_SYMBOL*

2021-01-21 Thread Christoph Hellwig
EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway. Signed-off-by: Christoph Hellwig --- arch/arm/configs/bcm2835_defconfig | 1 - arch/arm/configs/mxs_defconfig | 1 -

[PATCH 06/13] kallsyms: only build {, module_}kallsyms_on_each_symbol when required

2021-01-21 Thread Christoph Hellwig
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used by the livepatching code, so don't build them if livepatching is not enabled. Signed-off-by: Christoph Hellwig --- include/linux/kallsyms.h | 17 - include/linux/module.h | 16

[PATCH 10/13] module: merge each_symbol_section into find_symbol

2021-01-21 Thread Christoph Hellwig
each_symbol_section is only called by find_symbol, so merge the two functions. Signed-off-by: Christoph Hellwig --- kernel/module.c | 148 ++-- 1 file changed, 69 insertions(+), 79 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index

[PATCH 11/13] module: pass struct find_symbol_args to find_symbol

2021-01-21 Thread Christoph Hellwig
Simplify the calling convention by passing the find_symbol_args structure to find_symbol instead of initializing it inside the function. Signed-off-by: Christoph Hellwig --- kernel/module.c | 113 ++-- 1 file changed, 52 insertions(+), 61 deletions(-)

[PATCH 07/13] module: mark module_mutex static

2021-01-21 Thread Christoph Hellwig
Except for two lockdep asserts module_mutex is only used in module.c. Remove the two asserts given that the functions they are in are not exported and just called from the module code, and mark module_mutex static. Signed-off-by: Christoph Hellwig --- include/linux/module.h | 2 --

[PATCH 12/13] module: remove EXPORT_SYMBOL_GPL_FUTURE

2021-01-21 Thread Christoph Hellwig
As far as I can tell this has never been used at all, and certainly not any time recently. Signed-off-by: Christoph Hellwig --- arch/x86/tools/relocs.c | 4 ++-- include/asm-generic/vmlinux.lds.h | 14 -- include/linux/export.h| 1 - include/linux/module.h

Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver()

2021-01-21 Thread Geert Uytterhoeven
Hi Saravana, On Thu, Jan 21, 2021 at 1:05 AM Saravana Kannan wrote: > On Wed, Jan 20, 2021 at 3:53 PM Michael Walle wrote: > > Am 2021-01-20 20:47, schrieb Saravana Kannan: > > > On Wed, Jan 20, 2021 at 11:28 AM Michael Walle > > > wrote: > > >> > > >> [RESEND, fat-fingered the buttons of my

Re: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread Christophe Leroy
Le 21/01/2021 à 08:49, Christoph Hellwig a écrit : > Add a helper that takes modules_mutex and uses find_module to check if a > given module is loaded. This provides a better abstraction for the two > callers, and allows to unexport modules_mutex and find_module. > > Signed-off-by: Christoph

Re: [PATCH 01/13] powerpc/powernv: remove get_cxl_module

2021-01-21 Thread Andrew Donnellan
On 21/1/21 6:49 pm, Christoph Hellwig wrote: The static inline get_cxl_module function is entirely unused, remove it. Signed-off-by: Christoph Hellwig The one user of this was removed in 8bf6b91a5125a ("Revert "powerpc/powernv: Add support for the cxl kernel api on the real phb"). Thanks

RE: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread David Laight
From: Christophe Leroy > Sent: 21 January 2021 10:00 > > Le 21/01/2021 à 08:49, Christoph Hellwig a écrit : > > Add a helper that takes modules_mutex and uses find_module to check if a > > given module is loaded. This provides a better abstraction for the two > > callers, and allows to unexport

Re: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread Christophe Leroy
Le 21/01/2021 à 08:49, Christoph Hellwig a écrit : Add a helper that takes modules_mutex and uses find_module to check if a given module is loaded. This provides a better abstraction for the two callers, and allows to unexport modules_mutex and find_module. Signed-off-by: Christoph Hellwig

Re: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread Christophe Leroy
Le 21/01/2021 à 11:13, David Laight a écrit : From: Christophe Leroy Sorry I hit "Reply to the list" instead of "Reply all" Cc Christoph H. who is the author. Sent: 21 January 2021 10:00 Le 21/01/2021 à 08:49, Christoph Hellwig a écrit : Add a helper that takes modules_mutex and uses

Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit

2021-01-21 Thread Daniel Vetter
On Thu, Jan 21, 2021 at 9:28 AM Christoph Hellwig wrote: > > On Thu, Jan 21, 2021 at 09:25:40AM +0100, Daniel Vetter wrote: > > On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > > > > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > > > simple functionality.

Re: [PATCH 1/2] crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error)

2021-01-21 Thread Christophe Leroy
Le 21/01/2021 à 08:31, Ard Biesheuvel a écrit : On Thu, 21 Jan 2021 at 06:35, Christophe Leroy wrote: Le 20/01/2021 à 23:23, Ard Biesheuvel a écrit : On Wed, 20 Jan 2021 at 19:59, Christophe Leroy wrote: Talitos Security Engine AESU considers any input data size that is not a

Re: [PATCH 1/2] crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error)

2021-01-21 Thread Ard Biesheuvel
On Thu, 21 Jan 2021 at 10:54, Christophe Leroy wrote: > > > > Le 21/01/2021 à 08:31, Ard Biesheuvel a écrit : > > On Thu, 21 Jan 2021 at 06:35, Christophe Leroy > > wrote: > >> > >> > >> > >> Le 20/01/2021 à 23:23, Ard Biesheuvel a écrit : > >>> On Wed, 20 Jan 2021 at 19:59, Christophe Leroy >

Re: [PATCH 1/2] crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error)

2021-01-21 Thread Christophe Leroy
Le 21/01/2021 à 11:02, Ard Biesheuvel a écrit : On Thu, 21 Jan 2021 at 10:54, Christophe Leroy wrote: Le 21/01/2021 à 08:31, Ard Biesheuvel a écrit : On Thu, 21 Jan 2021 at 06:35, Christophe Leroy wrote: Le 20/01/2021 à 23:23, Ard Biesheuvel a écrit : On Wed, 20 Jan 2021 at 19:59,

Re: [PATCH 5/6] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE

2021-01-21 Thread Nathan Lynch
Alexey Kardashevskiy writes: > On 20/01/2021 12:17, Nathan Lynch wrote: >> Alexey Kardashevskiy writes: >>> On 16/01/2021 02:56, Nathan Lynch wrote: Alexey Kardashevskiy writes: > On 15/01/2021 09:00, Nathan Lynch wrote: >> +#define RTAS_WORK_AREA_SIZE 4096 >> + >> +/*

Re: [RFC PATCH v3 5/6] dt-bindings: of: Add restricted DMA pool

2021-01-21 Thread Rob Herring
On Wed, Jan 20, 2021 at 7:10 PM Robin Murphy wrote: > > On 2021-01-20 21:31, Rob Herring wrote: > > On Wed, Jan 20, 2021 at 11:30 AM Robin Murphy wrote: > >> > >> On 2021-01-20 16:53, Rob Herring wrote: > >>> On Wed, Jan 06, 2021 at 11:41:23AM +0800, Claire Chang wrote: > Introduce the new

Re: [PATCH 6/6] powerpc/rtas: constrain user region allocation to RMA

2021-01-21 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> Alexey Kardashevskiy writes: >>> On 16/01/2021 02:38, Nathan Lynch wrote: Alexey Kardashevskiy writes: > On 15/01/2021 09:00, Nathan Lynch wrote: >> Memory locations passed as arguments from the OS to RTAS usually need >> to

Re: [PATCH] powerpc/mm: Limit allocation of SWIOTLB on server machines

2021-01-21 Thread Konrad Rzeszutek Wilk
On Fri, Jan 08, 2021 at 09:27:01PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > On Wed, Dec 23, 2020 at 09:06:01PM -0300, Thiago Jung Bauermann wrote: > >> > >> Hi Ram, > >> > >> Thanks for reviewing this patch. > >> > >> Ram Pai writes: > >> > >> > On Fri, Dec 18, 2020 at

Re: [PATCH] powerpc/64: prevent replayed interrupt handlers from running softirqs

2021-01-21 Thread Michael Ellerman
Nicholas Piggin writes: > Running softirqs enables interrupts, which can then end up recursing > into the irq soft-mask code we're adjusting, including replaying > interrupts itself, which might be theoretically unbounded. > > This abridged trace shows how this can occur: > > ! NIP

Re: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread Christoph Hellwig
On Thu, Jan 21, 2021 at 11:00:20AM +0100, Christophe Leroy wrote: > > +bool module_loaded(const char *name); > > Maybe module_is_loaded() would be a better name. Fine with me.

[PATCH] lib/sstep: Fix incorrect return from analyze_instr()

2021-01-21 Thread Ananth N Mavinakayanahalli
We currently just percolate the return value from analyze_instr() to the caller of emulate_step(), especially if it is a -1. For one particular case (opcode = 4) for instructions that aren't currently emulated, we are returning 'should not be single-stepped' while we should have returned 0 which

Re: [RFC PATCH v3 5/6] dt-bindings: of: Add restricted DMA pool

2021-01-21 Thread Robin Murphy
On 2021-01-21 15:48, Rob Herring wrote: On Wed, Jan 20, 2021 at 7:10 PM Robin Murphy wrote: On 2021-01-20 21:31, Rob Herring wrote: On Wed, Jan 20, 2021 at 11:30 AM Robin Murphy wrote: On 2021-01-20 16:53, Rob Herring wrote: On Wed, Jan 06, 2021 at 11:41:23AM +0800, Claire Chang wrote:

Re: [PATCH] powerpc: fix AKEBONO build failures

2021-01-21 Thread Michael Ellerman
Randy Dunlap writes: > On 1/20/21 1:29 PM, Yury Norov wrote: >> Hi all, >> >> I found the power pc build broken on today's >> linux-next (647060f3b592). > > Darn, I was building linux-5.11-rc4. > > I'll try linux-next after I send this. > > --- > From: Randy Dunlap > > Fulfill AKEBONO Kconfig

[powerpc:next-test] BUILD SUCCESS 534e43a737e9ad2b438eda651272f2774484b922

2021-01-21 Thread kernel test robot
randconfig-a001-20210121 i386 randconfig-a002-20210121 i386 randconfig-a004-20210121 i386 randconfig-a006-20210121 i386 randconfig-a005-20210121 i386 randconfig-a003-20210121 x86_64 randconfig-a002-20210121

[PATCH] powerpc/8xx: export 'cpm_setbrg' for modules

2021-01-21 Thread Randy Dunlap
test robot Cc: Nick Desaulniers Cc: clang-built-li...@googlegroups.com Cc: Andrew Morton Cc: Christophe Leroy Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/platforms/8xx/cpm1.c |1 + 1 file changed, 1 insertion(+) ---

[powerpc:fixes] BUILD SUCCESS 08685be7761d69914f08c3d6211c543a385a5b9c

2021-01-21 Thread kernel test robot
powerpc allmodconfig powerpc allnoconfig i386 randconfig-a001-20210121 i386 randconfig-a002-20210121 i386 randconfig-a004-20210121 i386 randconfig-a006-20210121 i386

Re: [PATCH v2 2/2] memblock: do not start bottom-up allocations with kernel_end

2021-01-21 Thread Thiago Jung Bauermann
Mike Rapoport writes: > > Signed-off-by: Roman Gushchin > > Reviewed-by: Mike Rapoport I've seen a couple of spurious triggers of the WARN_ONCE() removed by this patch. This happens on some ppc64le bare metal (powernv) server machines with CONFIG_SWIOTLB=y and crashkernel=4G, as described in

[powerpc:fixes-test] BUILD SUCCESS 4899f32e4f2a936dc20fbfc4fde85b003387c5c2

2021-01-21 Thread kernel test robot
allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a001-20210121 i386 randconfig-a002-20210121 i386 randconfig-a004-20210121 i386 randconfig-a006-20210121

Re: [PATCH v3] powerpc/mce: Remove per cpu variables from MCE handlers

2021-01-21 Thread Ganesh
On 1/19/21 9:28 AM, Nicholas Piggin wrote: Excerpts from Ganesh Goudar's message of January 15, 2021 10:58 pm: Access to per-cpu variables requires translation to be enabled on pseries machine running in hash mmu mode, Since part of MCE handler runs in realmode and part of MCE handling code is

Re: [PATCH] powerpc: fix AKEBONO build failures

2021-01-21 Thread Randy Dunlap
On January 21, 2021 5:14:23 PM PST, Michael Ellerman wrote: >Randy Dunlap writes: >> On 1/20/21 1:29 PM, Yury Norov wrote: >>> Hi all, >>> >>> I found the power pc build broken on today's >>> linux-next (647060f3b592). >> >> Darn, I was building linux-5.11-rc4. >> >> I'll try linux-next after

Re: [PATCH] powerpc/8xx: export 'cpm_setbrg' for modules

2021-01-21 Thread Christophe Leroy
c: Nick Desaulniers Cc: clang-built-li...@googlegroups.com Cc: Andrew Morton Cc: Christophe Leroy Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/platforms/8xx/cpm1.c |1 + 1 file changed, 1 insertion(+) --- linux-n

Re: [PATCH 04/13] livepatch: move klp_find_object_module to module.c

2021-01-21 Thread Josh Poimboeuf
On Thu, Jan 21, 2021 at 08:49:50AM +0100, Christoph Hellwig wrote: > @@ -820,14 +796,25 @@ static int klp_init_object(struct klp_patch *patch, > struct klp_object *obj) > const char *name; > > obj->patched = false; > - obj->mod = NULL; Why was this line removed? > if

Re: [PATCH 1/2] ima: Free IMA measurement buffer on error

2021-01-21 Thread Tyler Hicks
On 2021-01-21 09:30:02, Lakshmi Ramasubramanian wrote: > IMA allocates kernel virtual memory to carry forward the measurement > list, from the current kernel to the next kernel on kexec system call, > in ima_add_kexec_buffer() function. In error code paths this memory > is not freed resulting in

Re: [PATCH] powerpc/64: prevent replayed interrupt handlers from running softirqs

2021-01-21 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of January 21, 2021 10:50 pm: > Nicholas Piggin writes: >> Running softirqs enables interrupts, which can then end up recursing >> into the irq soft-mask code we're adjusting, including replaying >> interrupts itself, which might be theoretically

Re: [PATCH 2/2] ima: Free IMA measurement buffer after kexec syscall

2021-01-21 Thread Tyler Hicks
On 2021-01-21 09:30:03, Lakshmi Ramasubramanian wrote: > IMA allocates kernel virtual memory to carry forward the measurement > list, from the current kernel to the next kernel on kexec system call, > in ima_add_kexec_buffer() function. This buffer is not freed before > completing the kexec

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Sukadev Bhattiprolu
Lijun Pan [lijunp...@gmail.com] wrote: > > > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c > > > b/drivers/net/ethernet/ibm/ibmvnic.c > > > index aed985e08e8a..11f28fd03057 100644 > > > --- a/drivers/net/ethernet/ibm/ibmvnic.c > > > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > > > @@ -2235,8

[PATCH] powerpc/32: Use r2 in wrtspr() instead of r0

2021-01-21 Thread Christophe Leroy
wrtspr() is a function to write an arbitrary value in a special register. It is used on 8xx to write to SPRN_NRI, SPRN_EID and SPRN_EIE. Writing any value to one of those will play with MSR EE and MSR RI regardless of that value. r0 is used many places in the generated code and using r0 for that

Re: [PATCH] lib/sstep: Fix incorrect return from analyze_instr()

2021-01-21 Thread Sandipan Das
On 21/01/21 10:18 pm, Ananth N Mavinakayanahalli wrote: > We currently just percolate the return value from analyze_instr() > to the caller of emulate_step(), especially if it is a -1. > > For one particular case (opcode = 4) for instructions that > aren't currently emulated, we are returning

[PATCH] powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan

2021-01-21 Thread Cédric Le Goater
The "ibm,arch-vec-5-platform-support" property is a list of pairs of bytes representing the options and values supported by the platform firmware. At boot time, Linux scans this list and activates the available features it recognizes : Radix and XIVE. A recent change modified the number of

Re: [PATCH] powerpc/8xx: export 'cpm_setbrg' for modules

2021-01-21 Thread Randy Dunlap
egroups.com >> Cc: Andrew Morton >> Cc: Christophe Leroy >> Cc: Michael Ellerman >> Cc: Benjamin Herrenschmidt >> Cc: Paul Mackerras >> Cc: linuxppc-dev@lists.ozlabs.org >> --- >>   arch/powerpc/platforms/8xx/cpm1.c |    1 + >>   1 file

Re: [PATCH] lib/sstep: Fix incorrect return from analyze_instr()

2021-01-21 Thread Naveen N. Rao
On 2021/01/21 10:18PM, Ananth N Mavinakayanahalli wrote: > We currently just percolate the return value from analyze_instr() > to the caller of emulate_step(), especially if it is a -1. > > For one particular case (opcode = 4) for instructions that > aren't currently emulated, we are returning

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Lijun Pan
> > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c > > b/drivers/net/ethernet/ibm/ibmvnic.c > > index aed985e08e8a..11f28fd03057 100644 > > --- a/drivers/net/ethernet/ibm/ibmvnic.c > > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > > @@ -2235,8 +2235,7 @@ static void __ibmvnic_reset(struct

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Lijun Pan
On Thu, Jan 21, 2021 at 12:42 PM Dany Madden wrote: > > On 2021-01-20 22:20, Lijun Pan wrote: > > Returning -EBUSY in ibmvnic_remove() does not actually hold the > > removal procedure since driver core doesn't care for the return > > value (see __device_release_driver() in drivers/base/dd.c > >

[PATCH 1/2] ima: Free IMA measurement buffer on error

2021-01-21 Thread Lakshmi Ramasubramanian
IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. In error code paths this memory is not freed resulting in memory leak. Free the memory allocated for the IMA measurement

[PATCH 2/2] ima: Free IMA measurement buffer after kexec syscall

2021-01-21 Thread Lakshmi Ramasubramanian
IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. This buffer is not freed before completing the kexec system call resulting in memory leak. Add ima_buffer field in

RE: [PATCH 02/13] module: add a module_loaded helper

2021-01-21 Thread David Laight
> > On Thu, Jan 21, 2021 at 11:00:20AM +0100, Christophe Leroy wrote: > > > +bool module_loaded(const char *name); > > > > Maybe module_is_loaded() would be a better name. > > Fine with me. It does look like both callers aren't 'unsafe'. But it is a bit strange returning a stale value. It did

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Dany Madden
On 2021-01-20 22:20, Lijun Pan wrote: Returning -EBUSY in ibmvnic_remove() does not actually hold the removal procedure since driver core doesn't care for the return value (see __device_release_driver() in drivers/base/dd.c calling dev->bus->remove()) though vio_bus_remove (in