Re: [PATCH v3 14/18] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-08-18 Thread Christophe Leroy
Le 19/08/2022 à 05:38, Rohan McLure a écrit : > Clear user state in gprs (assign to zero) to reduce the influence of user > registers on speculation within kernel syscall handlers. Clears occur > at the very beginning of the sc and scv 0 interrupt handlers, with > restores occurring following the

Re: [PATCH v3 11/18] powerpc: Add ZEROIZE_GPRS macros for register clears

2022-08-18 Thread Christophe Leroy
Le 19/08/2022 à 05:37, Rohan McLure a écrit : > Macros for restoring and saving registers to and from the stack exist. > Provide macros with the same interface for clearing a range of gprs by > setting each register's value in that range to zero. > > The resulting macros are called ZEROIZE_GPRS

Re: [PATCH v3 07/18] powerpc: Remove direct call to mmap2 syscall handlers

2022-08-18 Thread Christophe Leroy
Le 19/08/2022 à 05:37, Rohan McLure a écrit : > Syscall handlers should not be invoked internally by their symbol names, > as these symbols defined by the architecture-defined SYSCALL_DEFINE > macro. Move the compatibility syscall definition for mmap2 to > syscalls.c, so that all mmap implementat

Re: [PATCH v3 05/18] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-08-18 Thread Christophe Leroy
Le 19/08/2022 à 05:37, Rohan McLure a écrit : > Arch-specific implementations of syscall handlers are currently used > over generic implementations for the following reasons: > > 1. Semantics unique to powerpc > 2. Compatibility syscalls require 'argument padding' to comply with > 64-bit arg

Re: [PATCH v3 16/18] powerpc/32: Clarify interrupt restores with REST_GPR macro in entry_32.S

2022-08-18 Thread Christophe Leroy
Le 19/08/2022 à 05:38, Rohan McLure a écrit : > Restoring the register state of the interrupted thread involves issuing > a large number of predictable loads to the kernel stack frame. Issue the > REST_GPR{,S} macros to clearly signal when this is happening, and bunch > together restores at the e

Re: [PATCH v2 11/14] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-08-18 Thread Christophe Leroy
Le 15/08/2022 à 01:59, Rohan McLure a écrit : "Nullify" means "invalidate", which is not what this does or is for :-( >>> >>> Would "Zeroise" be more appropriate ? >> >> That is probably a good compromise, yes. It obviously is a verb, its >> meaning is clear and unamiguous, and there is pre

Re: [6.0-rc1] Kernel crash while running MCE tests

2022-08-18 Thread Ganesh
On 8/17/22 11:28, Michael Ellerman wrote: Sachin Sant writes: Following crash is seen while running powerpc/mce subtest on a Power10 LPAR. 1..1 # selftests: powerpc/mce: inject-ra-err [ 155.240591] BUG: Unable to handle kernel data access on read at 0xc00e00022d55b503 [ 155.240618] Faultin

Re: [PATCH] powerpc/microwatt: Add LiteX MMC driver

2022-08-18 Thread Michael Neuling
On Thu, 2022-08-04 at 11:27 +0930, Joel Stanley wrote: > Enable the LiteX MMC device and it's dependency the common clock > framework. > > Signed-off-by: Joel Stanley Acked-by: Michael Neuling > --- >  arch/powerpc/configs/microwatt_defconfig | 5 + >  1 file changed, 5 insertions(+) > > d

[PATCH v3 11/18] powerpc: Add ZEROIZE_GPRS macros for register clears

2022-08-18 Thread Rohan McLure
Macros for restoring and saving registers to and from the stack exist. Provide macros with the same interface for clearing a range of gprs by setting each register's value in that range to zero. The resulting macros are called ZEROIZE_GPRS and ZEROIZE_NVGPRS, keeping with the naming of the accompa

[PATCH v3 16/18] powerpc/32: Clarify interrupt restores with REST_GPR macro in entry_32.S

2022-08-18 Thread Rohan McLure
Restoring the register state of the interrupted thread involves issuing a large number of predictable loads to the kernel stack frame. Issue the REST_GPR{,S} macros to clearly signal when this is happening, and bunch together restores at the end of the interrupt handler where the saved value is not

[PATCH v3 07/18] powerpc: Remove direct call to mmap2 syscall handlers

2022-08-18 Thread Rohan McLure
Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Move the compatibility syscall definition for mmap2 to syscalls.c, so that all mmap implementations can share an inline helper function, as is done wit

[PATCH v3 02/18] powerpc: Use generic fallocate compatibility syscall

2022-08-18 Thread Rohan McLure
The powerpc fallocate compat syscall handler is identical to the generic implementation provided by commit 59c10c52f573f ("riscv: compat: syscall: Add compat_sys_call_table implementation"), and as such can be removed in favour of the generic implementation. A future patch series will replace more

[PATCH v3 09/18] powerpc: Enable compile-time check for syscall handlers

2022-08-18 Thread Rohan McLure
The table of syscall handlers and registered compatibility syscall handlers has in past been produced using assembly, with function references resolved at link time. This moves link-time errors to compile-time, by rewriting systbl.S in C, and including the linux/syscalls.h, linux/compat.h and asm/s

[PATCH v3 17/18] powerpc/64s: Fix comment on interrupt handler prologue

2022-08-18 Thread Rohan McLure
Interrupt handlers on 64s systems will often need to save register state from the interrupted process to make space for loading special purpose registers or for internal state. Fix a comment documenting a common code path macro in the beginning of interrupt handlers where r10 is saved to the PACA

[PATCH v3 18/18] powerpc/64s: Clear gprs on interrupt routine entry

2022-08-18 Thread Rohan McLure
Zero GPRS r0, r2-r11, r14-r31, on entry into the kernel for all other interrupt sources to limit influence of user-space values in potential speculation gadgets. The remaining gprs are overwritten by entry macros to interrupt handlers, irrespective of whether or not a given handler consumes these r

[PATCH v3 05/18] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-08-18 Thread Rohan McLure
Arch-specific implementations of syscall handlers are currently used over generic implementations for the following reasons: 1. Semantics unique to powerpc 2. Compatibility syscalls require 'argument padding' to comply with 64-bit argument convention in ELF32 abi. 3. Parameter types or order is

[PATCH v3 14/18] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-08-18 Thread Rohan McLure
Clear user state in gprs (assign to zero) to reduce the influence of user registers on speculation within kernel syscall handlers. Clears occur at the very beginning of the sc and scv 0 interrupt handlers, with restores occurring following the execution of the syscall handler. Signed-off-by: Rohan

[PATCH v3 15/18] powerpc/64s: Use {ZEROIZE,SAVE,REST}_GPRS macros in sc, scv 0 handlers

2022-08-18 Thread Rohan McLure
Use the convenience macros for saving/clearing/restoring gprs in keeping with syscall calling conventions. The plural variants of these macros can store a range of registers for concision. This works well when the user gpr value we are hoping to save is still live. In the syscall interrupt handler

[PATCH v3 13/18] powerpc: Provide syscall wrapper

2022-08-18 Thread Rohan McLure
Implement syscall wrapper as per s390, x86, arm64. When enabled cause handlers to accept parameters from a stack frame rather than from user scratch register state. This allows for user registers to be safely cleared in order to reduce caller influence on speculation within syscall routine. The wra

[PATCH v3 10/18] powerpc: Use common syscall handler type

2022-08-18 Thread Rohan McLure
Cause syscall handlers to be typed as follows when called indirectly throughout the kernel. typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); Since both 32 and 64-bit abis allow for at least the first s

[PATCH v3 03/18] powerpc/32: Remove powerpc select specialisation

2022-08-18 Thread Rohan McLure
Syscall #82 has been implemented for 32-bit platforms in a unique way on powerpc systems. This hack will in effect guess whether the caller is expecting new select semantics or old select semantics. It does so via a guess, based off the first parameter. In new select, this parameter represents the

[PATCH v3 08/18] powerpc: Include all arch-specific syscall prototypes

2022-08-18 Thread Rohan McLure
Forward declare all syscall handler prototypes where a generic prototype is not provided in either linux/syscalls.h or linux/compat.h in asm/syscalls.h. This is required for compile-time type-checking for syscall handlers, which is implemented later in this series. 32-bit compatibility syscall han

[PATCH v3 00/18] powerpc: Syscall wrapper and register clearing

2022-08-18 Thread Rohan McLure
V2 available here: Link: https://lore.kernel.org/all/20220725062039.117425-1-rmcl...@linux.ibm.com/ Implement a syscall wrapper, causing arguments to handlers to be passed via a struct pt_regs on the stack. The syscall wrapper is implemented for all platforms other than the Cell processor, from w

[PATCH v3 04/18] powerpc: Provide do_ppc64_personality helper

2022-08-18 Thread Rohan McLure
Avoid duplication in future patch that will define the ppc64_personality syscall handler in terms of the SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE macros, by extracting the common body of ppc64_personality into a helper function. Signed-off-by: Rohan McLure --- V2 -> V3: New commit. --- arch/pow

[PATCH v3 01/18] powerpc: Remove asmlinkage from syscall handler definitions

2022-08-18 Thread Rohan McLure
The asmlinkage macro has no special meaning in powerpc, and prior to this patch is used sporadically on some syscall handler definitions. On architectures that do not define asmlinkage, it resolves to extern "C" for C++ compilers and a nop otherwise. The current invocations of asmlinkage provide fa

[PATCH v3 12/18] Revert "powerpc/syscall: Save r3 in regs->orig_r3"

2022-08-18 Thread Rohan McLure
This reverts commit 8875f47b7681aa4e4484a9b612577b044725f839. Save caller's original r3 state to the kernel stackframe before entering system_call_exception. This allows for user registers to be cleared by the time system_call_exception is entered, reducing the influence of user registers on specu

[PATCH v3 06/18] powerpc: Remove direct call to personality syscall handler

2022-08-18 Thread Rohan McLure
Syscall handlers should not be invoked internally by their symbol names, as these symbols defined by the architecture-defined SYSCALL_DEFINE macro. Fortunately, in the case of ppc64_personality, its call to sys_personality can be replaced with an invocation to the equivalent ksys_personality inline

Re: [PATCH v2 1/2] mm/migrate_device.c: Copy pte dirty bit to page

2022-08-18 Thread Huang, Ying
Peter Xu writes: > On Thu, Aug 18, 2022 at 02:34:45PM +0800, Huang, Ying wrote: >> > In this specific case, the only way to do safe tlb batching in my mind is: >> > >> >pte_offset_map_lock(); >> >arch_enter_lazy_mmu_mode(); >> > // If any pending tlb, do it now >> > if (mm

Re: [PATCH] kernel: exit: cleanup release_thread()

2022-08-18 Thread Guo Ren
For csky part Acked-by: Guo Ren On Fri, Aug 19, 2022 at 9:39 AM Kefeng Wang wrote: > > Only x86 has own release_thread(), introduce a new weak > release_thread() function to clean empty definitions in > other ARCHs. > > Signed-off-by: Kefeng Wang > --- > arch/alpha/include/asm/processor.h

[PATCH] macintosh: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] cpuidle: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] block: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] powerpc: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] tty: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] soc: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

[PATCH] scsi: move from strlcpy with unused retval to strscpy

2022-08-18 Thread Wolfram Sang
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Wolfram Sang --

Re: [RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Jakub Kicinski
On Thu, 18 Aug 2022 15:14:04 -0400 Sean Anderson wrote: > > Ack, no question. I'm trying to tell you got to actually get stuff in. > > It's the first week after the merge window and people are dumping code > > the had written over the dead time on the list, while some reviewers > > and maintainers

Re: [RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Sean Anderson
On 8/18/22 2:58 PM, Jakub Kicinski wrote: > On Thu, 18 Aug 2022 14:37:23 -0400 Sean Anderson wrote: >> On 8/18/22 2:20 PM, Jakub Kicinski wrote: >> > On Thu, 18 Aug 2022 12:16:24 -0400 Sean Anderson wrote: >> >> This series contains several cleanup patches for dpaa/fman. While they >> >> are inte

Re: [RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Jakub Kicinski
On Thu, 18 Aug 2022 14:37:23 -0400 Sean Anderson wrote: > On 8/18/22 2:20 PM, Jakub Kicinski wrote: > > On Thu, 18 Aug 2022 12:16:24 -0400 Sean Anderson wrote: > >> This series contains several cleanup patches for dpaa/fman. While they > >> are intended to prepare for a phylink conversion, they s

Re: [RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Sean Anderson
Hi Jakub, On 8/18/22 2:20 PM, Jakub Kicinski wrote: > On Thu, 18 Aug 2022 12:16:24 -0400 Sean Anderson wrote: >> This series contains several cleanup patches for dpaa/fman. While they >> are intended to prepare for a phylink conversion, they stand on their >> own. This series was originally submit

Re: [RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Jakub Kicinski
On Thu, 18 Aug 2022 12:16:24 -0400 Sean Anderson wrote: > This series contains several cleanup patches for dpaa/fman. While they > are intended to prepare for a phylink conversion, they stand on their > own. This series was originally submitted as part of [1]. Still over the limit of patches in a

Re: [PATCH v1 2/5] powerpc/32: Don't always pass -mcpu=powerpc to the compiler

2022-08-18 Thread Pali Rohár
On Monday 11 July 2022 16:19:30 Christophe Leroy wrote: > Since commit 4bf4f42a2feb ("powerpc/kbuild: Set default generic > machine type for 32-bit compile"), when building a 32 bits kernel > with a bi-arch version of GCC, or when building a book3s/32 kernel, > the option -mcpu=powerpc is passed to

[PATCH] powerpc/vdso: Don't map VDSO at a fixed address on PPC32

2022-08-18 Thread Christophe Leroy
PPC64 removed default mapping address from VDSO in commit 30d0b3682887 ("powerpc: Move 64bit VDSO to improve context switch performance"). Do like PPC64 and let get_unmapped_area() place the VDSO mapping at the address it wants, don't force a default address. This allows randomisation of VDSO add

[RESEND PATCH net-next v4 17/25] net: fman: Pass params directly to mac init

2022-08-18 Thread Sean Anderson
Instead of having the mac init functions call back into the fman core to get their params, just pass them directly to the init functions. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 10 ++ .../net/ethernet/

[RESEND PATCH net-next v4 25/25] net: dpaa: Adjust queue depth on rate change

2022-08-18 Thread Sean Anderson
Instead of setting the queue depth once during probe, adjust it on the fly whenever we configure the link. This is a bit unusal, since usually the DPAA driver calls into the FMAN driver, but here we do the opposite. We need to add a netdev to struct mac_device for this, but it will soon live in the

[RESEND PATCH net-next v4 24/25] soc: fsl: qbman: Add CGR update function

2022-08-18 Thread Sean Anderson
This adds a function to update a CGR with new parameters. qman_create_cgr can almost be used for this (with flags=0), but it's not suitable because it also registers the callback function. The _safe variant was modeled off of qman_cgr_delete_safe. However, we handle multiple arguments and a return

[RESEND PATCH net-next v4 23/25] soc: fsl: qbman: Add helper for sanity checking cgr ops

2022-08-18 Thread Sean Anderson
This breaks out/combines get_affine_portal and the cgr sanity check in preparation for the next commit. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - New drivers/soc/fsl/qbman/qman.c | 29 +++

[RESEND PATCH net-next v4 22/25] net: dpaa: Use mac_dev variable in dpaa_netdev_init

2022-08-18 Thread Sean Anderson
There are several references to mac_dev in dpaa_netdev_init. Make things a bit more concise by adding a local variable for it. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - Use mac_dev for calling change_addr drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 +

[RESEND PATCH net-next v4 21/25] net: fman: Change return type of disable to void

2022-08-18 Thread Sean Anderson
When disabling, there is nothing we can do about errors. In fact, the only error which can occur is misuse of the API. Just warn in the mac driver instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 5 +

[RESEND PATCH net-next v4 20/25] net: fman: Clean up error handling

2022-08-18 Thread Sean Anderson
This removes the _return label, since something like err = -EFOO; goto _return; can be replaced by the briefer return -EFOO; Additionally, this skips going to _return_of_node_put when dev_node has already been put (preventing a double put). Signed-off-by: Sean Anderson

[RESEND PATCH net-next v4 19/25] net: fman: Specify type of mac_dev for exception_cb

2022-08-18 Thread Sean Anderson
Instead of using a void pointer for mac_dev, specify its type explicitly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - New drivers/net/ethernet/freescale/fman/fman_dtsec.c | 2 +- drivers/net/ethernet/freescale/fman/fman_mac.h | 5 +++-- d

[RESEND PATCH net-next v4 18/25] net: fman: Use mac_dev for some params

2022-08-18 Thread Sean Anderson
Some params are already present in mac_dev. Use them directly instead of passing them through params. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c| 16 +++- drivers/net/ethernet/freescale/fman/fman_

[RESEND PATCH net-next v4 16/25] net: fman: Map the base address once

2022-08-18 Thread Sean Anderson
We don't need to remap the base address from the resource twice (once in mac_probe() and again in set_fman_mac_params()). We still need the resource to get the end address, but we can use a single function call to get both at once. While we're at it, use platform_get_mem_or_io and devm_request_res

[RESEND PATCH net-next v4 03/25] net: fman: Don't pass comm_mode to enable/disable

2022-08-18 Thread Sean Anderson
mac_priv_s->enable() and ->disable() are always called with a comm_mode of COMM_MODE_RX_AND_TX. Remove this parameter, and refactor the macs appropriately. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/

[RESEND PATCH net-next v4 14/25] net: fman: Inline several functions into initialization

2022-08-18 Thread Sean Anderson
There are several small functions which were only necessary because the initialization functions didn't have access to the mac private data. Now that they do, just do things directly. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- Changes in v4: - weer -> were .../net/ethernet/frees

[RESEND PATCH net-next v4 15/25] net: fman: Remove internal_phy_node from params

2022-08-18 Thread Sean Anderson
This member was used to pass the phy node between mac_probe and the mac-specific initialization function. But now that the phy node is gotten in the initialization function, this parameter does not serve a purpose. Remove it, and do the grabbing of the node/grabbing of the phy in the same place. S

[RESEND PATCH net-next v4 13/25] net: fman: Mark mac methods static

2022-08-18 Thread Sean Anderson
These methods are no longer accessed outside of the driver file, so mark them as static. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) .../net/ethernet/freescale/fman/fman_dtsec.c | 48 ++- .../net/ethernet/freescale/fman/fman_memac.c | 45 ++

[RESEND PATCH net-next v4 12/25] net: fman: Move initialization to mac-specific files

2022-08-18 Thread Sean Anderson
This moves mac-specific initialization to mac-specific files. This will make it easier to work with individual macs. It will also make it easier to refactor the initialization to simplify the control flow. No functional change intended. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (

[RESEND PATCH net-next v4 11/25] net: fman: memac: Use params instead of priv for max_speed

2022-08-18 Thread Sean Anderson
This option is present in params, so use it instead of the fman private version. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet

[RESEND PATCH net-next v4 10/25] net: fman: Export/rename some common functions

2022-08-18 Thread Sean Anderson
In preparation for moving each of the initialization functions to their own file, export some common functions so they can be re-used. This adds an fman prefix to set_multi to make it a bit less genericly-named. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) dr

[RESEND PATCH net-next v4 09/25] net: fman: Configure fixed link in memac_initialization

2022-08-18 Thread Sean Anderson
memac is the only mac which parses fixed links. Move the parsing/configuring to its initialization function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/mac.c | 93 +++ 1 file changed, 46 insertions(+),

[RESEND PATCH net-next v4 08/25] net: fman: Move struct dev to mac_device

2022-08-18 Thread Sean Anderson
Move the reference to our device to mac_device. This way, macs can use it in their log messages. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v2) Changes in v2: - Remove some unused variables drivers/net/ethernet/freescale/fman/mac.c | 31 ---

[RESEND PATCH net-next v4 01/25] dt-bindings: net: Convert FMan MAC bindings to yaml

2022-08-18 Thread Sean Anderson
This converts the MAC portion of the FMan MAC bindings to yaml. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring Acked-by: Camelia Groza --- (no changes since v3) Changes in v3: - Incorperate some minor changes into the first FMan binding commit Changes in v2: - New .../bindings/net/f

[RESEND PATCH net-next v4 07/25] net: fman: Store initialization function in match data

2022-08-18 Thread Sean Anderson
Instead of re-matching the compatible string in order to determine the init function, just store it in the match data. The separate setup functions aren't needed anymore. Merge their content into init as well. To ensure everything compiles correctly, we move them to the bottom of the file. Signed-

[RESEND PATCH net-next v4 06/25] net: fman: Get PCS node in per-mac init

2022-08-18 Thread Sean Anderson
This moves the reading of the PCS property out of the generic probe and into the mac-specific initialization function. This reduces the mac-specific jobs done in the top-level probe function. Signed-off-by: Sean Anderson Acked-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/f

[RESEND PATCH net-next v4 05/25] net: fman: dtsec: Always gracefully stop/start

2022-08-18 Thread Sean Anderson
There are two ways that GRS can be set: graceful_stop and dtsec_isr. It is cleared by graceful_start. If it is already set before calling graceful_stop, then that means that dtsec_isr set it. In that case, we will not set GRS nor will we clear it (which seems like a bug?). For GTS the logic is simi

[RESEND PATCH net-next v4 04/25] net: fman: Store en/disable in mac_device instead of mac_priv_s

2022-08-18 Thread Sean Anderson
All macs use the same start/stop functions. The actual mac-specific code lives in enable/disable. Move these functions to an appropriate struct, and inline the phy enable/disable calls to the caller of start/stop. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza ---

[RESEND PATCH net-next v4 02/25] net: fman: Convert to SPDX identifiers

2022-08-18 Thread Sean Anderson
This converts the license text of files in the fman directory to use SPDX license identifiers instead. Signed-off-by: Sean Anderson Acked-by: Camelia Groza Tested-by: Camelia Groza --- (no changes since v1) drivers/net/ethernet/freescale/fman/fman.c| 31 ++ drivers/net/et

[RESEND PATCH net-next v4 00/25] net: dpaa: Cleanups in preparation for phylink conversion

2022-08-18 Thread Sean Anderson
This series contains several cleanup patches for dpaa/fman. While they are intended to prepare for a phylink conversion, they stand on their own. This series was originally submitted as part of [1]. [1] https://lore.kernel.org/netdev/20220715215954.1449214-1-sean.ander...@seco.com Changes in v4:

Re: [PATCH v2 1/2] mm/migrate_device.c: Copy pte dirty bit to page

2022-08-18 Thread Peter Xu
On Thu, Aug 18, 2022 at 02:34:45PM +0800, Huang, Ying wrote: > > In this specific case, the only way to do safe tlb batching in my mind is: > > > > pte_offset_map_lock(); > > arch_enter_lazy_mmu_mode(); > > // If any pending tlb, do it now > > if (mm_tlb_flush_pending()) > >

[PATCH v2 3/3 RESEND] block: sed-opal: keyring support for SED keys

2022-08-18 Thread gjoyce
From: Greg Joyce Extend the SED block driver so it can alternatively obtain a key from a sed-opal kernel keyring. The SED ioctls will indicate the source of the key, either directly in the ioctl data or from the keyring. This allows the use of SED commands in scripts such as udev scripts so that

[PATCH v2 1/3 RESEND] block: sed-opal: Implement IOC_OPAL_DISCOVERY

2022-08-18 Thread gjoyce
From: Greg Joyce Add IOC_OPAL_DISCOVERY ioctl to return raw discovery data to a SED Opal application. This allows the application to display drive capabilities and state. Signed-off-by: Greg Joyce --- block/sed-opal.c | 38 --- include/linux/sed-opa

[PATCH v2 2/3 RESEND] block: sed-opal: Implement IOC_OPAL_REVERT_LSP

2022-08-18 Thread gjoyce
From: Greg Joyce This is used in conjunction with IOC_OPAL_REVERT_TPR to return a drive to Original Factory State without erasing the data. If IOC_OPAL_REVERT_LSP is called with opal_revert_lsp.options bit OPAL_PRESERVE set prior to calling IOC_OPAL_REVERT_TPR, the drive global locking range will

[PATCH v2 0/3 RESEND] sed-opal: keyrings, discovery, revert, key store

2022-08-18 Thread gjoyce
From: Greg Joyce TCG SED Opal is a specification from The Trusted Computing Group that allows self encrypting storage devices (SED) to be locked at power on and require an authentication key to unlock the drive. The current SED Opal implementation in the block driver requires that authentication

[RFC PATCH v1] spi: fsl_spi: Convert to transfer_one

2022-08-18 Thread Christophe Leroy
Let the core handle all the chipselect bakery and replace transfer_one_message() by transfer_one() and prepare_message(). At the time being, there is fsl_spi_cs_control() to handle chipselects. That function handles both GPIO and non-GPIO chipselects. The GPIO chipselects will now be handled by th

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-18 Thread Naveen N. Rao
Christophe Leroy wrote: Le 18/08/2022 à 12:46, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings with a few instructions that are marked unreachable. Replace unreachable() with

Re: [PATCH net-next] Remove DECnet support from kernel

2022-08-18 Thread Nikolay Aleksandrov
On 18/08/2022 03:43, Stephen Hemminger wrote: > DECnet is an obsolete network protocol that receives more attention > from kernel janitors than users. It belongs in computer protocol > history museum not in Linux kernel. > > It has been "Orphaned" in kernel since 2010. The iproute2 support > for D

Re: [PATCH 05/16] powerpc: Skip objtool from running on drivers/crypto/vmx/aesp8-ppc.o

2022-08-18 Thread Sathvika Vasireddy
On 10/08/22 14:04, Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : With objtool enabled, below warnings are seen when trying to build: drivers/crypto/vmx/aesp8-ppc.o: warning: objtool: aes_p8_set_encrypt_key+0x44: unannotated intra-function call drivers/crypto/v

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-18 Thread Christophe Leroy
Le 18/08/2022 à 12:46, Naveen N. Rao a écrit : > Christophe Leroy wrote: >> >> >> Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : >>> objtool is throwing *unannotated intra-function call* >>> warnings with a few instructions that are marked >>> unreachable. Replace unreachable() with __builti

Re: [PATCH 03/16] powerpc: Fix objtool unannotated intra-function call warnings

2022-08-18 Thread Sathvika Vasireddy
On 10/08/22 14:02, Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool throws unannotated intra-function call warnings in the following assembly files. arch/powerpc/kernel/vector.o: warning: objtool: .text+0x53c: unannotated intra-function call arch/powerpc/

Re: [PATCH 02/16] powerpc: override __ALIGN() and __ALIGN_STR() macros

2022-08-18 Thread Sathvika Vasireddy
Hi Christophe, On 10/08/22 14:01, Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : Since we need an alignment of 4 bytes, override __ALIGN() and __ALIGN_STR() accordingly. Why/When do we now need an alignment of 4 bytes ? Please explain the reason in the commit mess

Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin variant in WARN_ON()

2022-08-18 Thread Naveen N. Rao
Christophe Leroy wrote: Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit : objtool is throwing *unannotated intra-function call* warnings with a few instructions that are marked unreachable. Replace unreachable() with __builtin_unreachable() to fix these warnings, as the codegen remains same

Re: [PATCH v4 2/2] selftests/powerpc: Add a test for execute-only memory

2022-08-18 Thread Nicholas Miehlbradt
On 17/8/2022 4:15 pm, Jordan Niethe wrote: On Wed, 2022-08-17 at 15:06 +1000, Russell Currey wrote: From: Nicholas Miehlbradt This selftest is designed to cover execute-only protections on the Radix MMU but will also work with Hash. The tests are based on those found in pkey_exec_test with mo