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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
--
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
--
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
--
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
--
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
--
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
--
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
--
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
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
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
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
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
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
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
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/
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
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
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 +++
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 +
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 +
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
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
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_
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
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/
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
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
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 ++
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
---
(
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
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
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(+),
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 ---
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
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-
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
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
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
---
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
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:
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())
> >
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
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
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
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
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
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
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
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
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
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/
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
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
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
83 matches
Mail list logo