mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'mm-nonmm-stable-2026-04-15-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-MM updates from Andrew Morton:
- "pid: make sub-init creation retryable" (Oleg Nesterov)
Make creation of init in a new namespace more robust by clearing away
some historical cruft which is no longer needed. Also some
documentation fixups
- "selftests/fchmodat2: Error handling and general" (Mark Brown)
Fix and a cleanup for the fchmodat2() syscall selftest
- "lib: polynomial: Move to math/ and clean up" (Andy Shevchenko)
- "hung_task: Provide runtime reset interface for hung task detector"
(Aaron Tomlin)
Give administrators the ability to zero out
/proc/sys/kernel/hung_task_detect_count
- "tools/getdelays: use the static UAPI headers from
tools/include/uapi" (Thomas Weißschuh)
Teach getdelays to use the in-kernel UAPI headers rather than the
system-provided ones
- "watchdog/hardlockup: Improvements to hardlockup" (Mayank Rungta)
Several cleanups and fixups to the hardlockup detector code and its
documentation
- "lib/bch: fix undefined behavior from signed left-shifts" (Josh Law)
A couple of small/theoretical fixes in the bch code
- "ocfs2/dlm: fix two bugs in dlm_match_regions()" (Junrui Luo)
- "cleanup the RAID5 XOR library" (Christoph Hellwig)
A quite far-reaching cleanup to this code. I can't do better than to
quote Christoph:
"The XOR library used for the RAID5 parity is a bit of a mess right
now. The main file sits in crypto/ despite not being cryptography
and not using the crypto API, with the generic implementations
sitting in include/asm-generic and the arch implementations
sitting in an asm/ header in theory. The latter doesn't work for
many cases, so architectures often build the code directly into
the core kernel, or create another module for the architecture
code.
Change this to a single module in lib/ that also contains the
architecture optimizations, similar to the library work Eric
Biggers has done for the CRC and crypto libraries later. After
that it changes to better calling conventions that allow for
smarter architecture implementations (although none is contained
here yet), and uses static_call to avoid indirection function call
overhead"
- "lib/list_sort: Clean up list_sort() scheduling workarounds"
(Kuan-Wei Chiu)
Clean up this library code by removing a hacky thing which was added
for UBIFS, which UBIFS doesn't actually need
- "Fix bugs in extract_iter_to_sg()" (Christian Ehrhardt)
Fix a few bugs in the scatterlist code, add in-kernel tests for the
now-fixed bugs and fix a leak in the test itself
- "kdump: Enable LUKS-encrypted dump target support in ARM64 and
PowerPC" (Coiby Xu)
Enable support of the LUKS-encrypted device dump target on arm64 and
powerpc
- "ocfs2: consolidate extent list validation into block read callbacks"
(Joseph Qi)
Cleanup, simplify, and make more robust ocfs2's validation of extent
list fields (Kernel test robot loves mounting corrupted fs images!)
* tag 'mm-nonmm-stable-2026-04-15-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (127 commits)
ocfs2: validate group add input before caching
ocfs2: validate bg_bits during freefrag scan
ocfs2: fix listxattr handling when the buffer is full
doc: watchdog: fix typos etc
update Sean's email address
ocfs2: use get_random_u32() where appropriate
ocfs2: split transactions in dio completion to avoid credit exhaustion
ocfs2: remove redundant l_next_free_rec check in __ocfs2_find_path()
ocfs2: validate extent block list fields during block read
ocfs2: remove empty extent list check in ocfs2_dx_dir_lookup_rec()
ocfs2: validate dx_root extent list fields during block read
ocfs2: fix use-after-free in ocfs2_fault() when VM_FAULT_RETRY
ocfs2: handle invalid dinode in ocfs2_group_extend
.get_maintainer.ignore: add Askar
ocfs2: validate bg_list extent bounds in discontig groups
checkpatch: exclude forward declarations of const structs
tools/accounting: handle truncated taskstats netlink messages
taskstats: set version in TGID exit notifications
ocfs2/heartbeat: fix slot mapping rollback leaks on error paths
arm64,ppc64le/kdump: pass dm-crypt keys to kdump kernel
...
This commit is contained in:
@@ -309,7 +309,10 @@ Gokul Sriram Palanisamy <quic_gokulsri@quicinc.com> <gokulsri@codeaurora.org>
|
||||
Govindaraj Saminathan <quic_gsamin@quicinc.com> <gsamin@codeaurora.org>
|
||||
Guo Ren <guoren@kernel.org> <guoren@linux.alibaba.com>
|
||||
Guo Ren <guoren@kernel.org> <ren_guo@c-sky.com>
|
||||
Guru Das Srinagesh <quic_gurus@quicinc.com> <gurus@codeaurora.org>
|
||||
Guru Das Srinagesh <linux@gurudas.dev>
|
||||
Guru Das Srinagesh <linux@gurudas.dev> <quic_gurus@quicinc.com>
|
||||
Guru Das Srinagesh <linux@gurudas.dev> <gurus@codeaurora.org>
|
||||
Guru Das Srinagesh <linux@gurudas.dev> <gurooodas@gmail.com>
|
||||
Gustavo Padovan <gustavo@las.ic.unicamp.br>
|
||||
Gustavo Padovan <padovan@profusion.mobi>
|
||||
Hamza Mahfooz <hamzamahfooz@linux.microsoft.com> <hamza.mahfooz@amd.com>
|
||||
@@ -743,6 +746,7 @@ Sathishkumar Muruganandam <quic_murugana@quicinc.com> <murugana@codeaurora.org>
|
||||
Satya Priya <quic_skakitap@quicinc.com> <quic_c_skakit@quicinc.com> <skakit@codeaurora.org>
|
||||
S.Çağlar Onur <caglar@pardus.org.tr>
|
||||
Sayali Lokhande <quic_sayalil@quicinc.com> <sayalil@codeaurora.org>
|
||||
Sean Anderson <sean.anderson@linux.dev> <sean.anderson@seco.com>
|
||||
Sean Christopherson <seanjc@google.com> <sean.j.christopherson@intel.com>
|
||||
Sean Nyekjaer <sean@geanix.com> <sean.nyekjaer@prevas.dk>
|
||||
Sean Tranchetti <quic_stranche@quicinc.com> <stranche@codeaurora.org>
|
||||
|
||||
@@ -4570,8 +4570,5 @@ D: MD driver
|
||||
D: EISA/sysfs subsystem
|
||||
S: France
|
||||
|
||||
# Don't add your name here, unless you really _are_ after Marc
|
||||
# alphabetically. Leonard used to be very proud of being the
|
||||
# last entry, and he'll get positively pissed if he can't even
|
||||
# be second-to-last. (and this file really _is_ supposed to be
|
||||
# in alphabetic order)
|
||||
# Don't add your name here unless you really are last alphabetically.
|
||||
# (This file is supposed to be kept in alphabetical order by last name.)
|
||||
|
||||
@@ -16,7 +16,7 @@ details), and a compile option, "BOOTPARAM_SOFTLOCKUP_PANIC", are
|
||||
provided for this.
|
||||
|
||||
A 'hardlockup' is defined as a bug that causes the CPU to loop in
|
||||
kernel mode for more than 10 seconds (see "Implementation" below for
|
||||
kernel mode for several seconds (see "Implementation" below for
|
||||
details), without letting other interrupts have a chance to run.
|
||||
Similarly to the softlockup case, the current stack trace is displayed
|
||||
upon detection and the system will stay locked up unless the default
|
||||
@@ -30,39 +30,135 @@ timeout is set through the confusingly named "kernel.panic" sysctl),
|
||||
to cause the system to reboot automatically after a specified amount
|
||||
of time.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
A kernel knob is provided that allows administrators to configure
|
||||
this period. The "watchdog_thresh" parameter (default 10 seconds)
|
||||
controls the threshold. The right value for a particular environment
|
||||
is a trade-off between fast response to lockups and detection overhead.
|
||||
|
||||
Implementation
|
||||
==============
|
||||
|
||||
The soft and hard lockup detectors are built on top of the hrtimer and
|
||||
perf subsystems, respectively. A direct consequence of this is that,
|
||||
in principle, they should work in any architecture where these
|
||||
subsystems are present.
|
||||
The soft and hard lockup detectors are built around an hrtimer.
|
||||
In addition, the softlockup detector regularly schedules a job, and
|
||||
the hard lockup detector might use Perf/NMI events on architectures
|
||||
that support it.
|
||||
|
||||
A periodic hrtimer runs to generate interrupts and kick the watchdog
|
||||
job. An NMI perf event is generated every "watchdog_thresh"
|
||||
(compile-time initialized to 10 and configurable through sysctl of the
|
||||
same name) seconds to check for hardlockups. If any CPU in the system
|
||||
does not receive any hrtimer interrupt during that time the
|
||||
'hardlockup detector' (the handler for the NMI perf event) will
|
||||
generate a kernel warning or call panic, depending on the
|
||||
configuration.
|
||||
Frequency and Heartbeats
|
||||
------------------------
|
||||
|
||||
The watchdog job runs in a stop scheduling thread that updates a
|
||||
timestamp every time it is scheduled. If that timestamp is not updated
|
||||
for 2*watchdog_thresh seconds (the softlockup threshold) the
|
||||
The core of the detectors is an hrtimer. It serves multiple purposes:
|
||||
|
||||
- schedules watchdog job for the softlockup detector
|
||||
- bumps the interrupt counter for hardlockup detectors (heartbeat)
|
||||
- detects softlockups
|
||||
- detects hardlockups in Buddy mode
|
||||
|
||||
The period of this hrtimer is 2*watchdog_thresh/5, which is 4 seconds
|
||||
by default. The hrtimer has two or three chances to generate an interrupt
|
||||
(heartbeat) before the hardlockup detector kicks in.
|
||||
|
||||
Softlockup Detector
|
||||
-------------------
|
||||
|
||||
The watchdog job is scheduled by the hrtimer and runs in a stop scheduling
|
||||
thread. It updates a timestamp every time it is scheduled. If that timestamp
|
||||
is not updated for 2*watchdog_thresh seconds (the softlockup threshold) the
|
||||
'softlockup detector' (coded inside the hrtimer callback function)
|
||||
will dump useful debug information to the system log, after which it
|
||||
will call panic if it was instructed to do so or resume execution of
|
||||
other kernel code.
|
||||
|
||||
The period of the hrtimer is 2*watchdog_thresh/5, which means it has
|
||||
two or three chances to generate an interrupt before the hardlockup
|
||||
detector kicks in.
|
||||
Hardlockup Detector (NMI/Perf)
|
||||
------------------------------
|
||||
|
||||
As explained above, a kernel knob is provided that allows
|
||||
administrators to configure the period of the hrtimer and the perf
|
||||
event. The right value for a particular environment is a trade-off
|
||||
between fast response to lockups and detection overhead.
|
||||
On architectures that support NMI (Non-Maskable Interrupt) perf events,
|
||||
a periodic NMI is generated every "watchdog_thresh" seconds.
|
||||
|
||||
If any CPU in the system does not receive any hrtimer interrupt
|
||||
(heartbeat) during the "watchdog_thresh" window, the 'hardlockup
|
||||
detector' (the handler for the NMI perf event) will generate a kernel
|
||||
warning or call panic.
|
||||
|
||||
**Detection Overhead (NMI):**
|
||||
|
||||
The time to detect a lockup can vary depending on when the lockup
|
||||
occurs relative to the NMI check window. Examples below assume a watchdog_thresh of 10.
|
||||
|
||||
* **Best Case:** The lockup occurs just before the first heartbeat is
|
||||
due. The detector will notice the missing hrtimer interrupt almost
|
||||
immediately during the next check.
|
||||
|
||||
::
|
||||
|
||||
Time 100.0: cpu 1 heartbeat
|
||||
Time 100.1: hardlockup_check, cpu1 stores its state
|
||||
Time 103.9: Hard Lockup on cpu1
|
||||
Time 104.0: cpu 1 heartbeat never comes
|
||||
Time 110.1: hardlockup_check, cpu1 checks the state again, should be the same, declares lockup
|
||||
|
||||
Time to detection: ~6 seconds
|
||||
|
||||
* **Worst Case:** The lockup occurs shortly after a valid interrupt
|
||||
(heartbeat) which itself happened just after the NMI check. The next
|
||||
NMI check sees that the interrupt count has changed (due to that one
|
||||
heartbeat), assumes the CPU is healthy, and resets the baseline. The
|
||||
lockup is only detected at the subsequent check.
|
||||
|
||||
::
|
||||
|
||||
Time 100.0: hardlockup_check, cpu1 stores its state
|
||||
Time 100.1: cpu 1 heartbeat
|
||||
Time 100.2: Hard Lockup on cpu1
|
||||
Time 110.0: hardlockup_check, cpu1 stores its state (misses lockup as state changed)
|
||||
Time 120.0: hardlockup_check, cpu1 checks the state again, should be the same, declares lockup
|
||||
|
||||
Time to detection: ~20 seconds
|
||||
|
||||
Hardlockup Detector (Buddy)
|
||||
---------------------------
|
||||
|
||||
On architectures or configurations where NMI perf events are not
|
||||
available (or disabled), the kernel may use the "buddy" hardlockup
|
||||
detector. This mechanism requires SMP (Symmetric Multi-Processing).
|
||||
|
||||
In this mode, each CPU is assigned a "buddy" CPU to monitor. The
|
||||
monitoring CPU runs its own hrtimer (the same one used for softlockup
|
||||
detection) and checks if the buddy CPU's hrtimer interrupt count has
|
||||
increased.
|
||||
|
||||
To ensure timeliness and avoid false positives, the buddy system performs
|
||||
checks at every hrtimer interval (2*watchdog_thresh/5, which is 4 seconds
|
||||
by default). It uses a missed-interrupt threshold of 3. If the buddy's
|
||||
interrupt count has not changed for 3 consecutive checks, it is assumed
|
||||
that the buddy CPU is hardlocked (interrupts disabled). The monitoring
|
||||
CPU will then trigger the hardlockup response (warning or panic).
|
||||
|
||||
**Detection Overhead (Buddy):**
|
||||
|
||||
With a default check interval of 4 seconds (watchdog_thresh = 10):
|
||||
|
||||
* **Best case:** Lockup occurs just before a check.
|
||||
Detected in ~8s (0s till 1st check + 4s till 2nd + 4s till 3rd).
|
||||
* **Worst case:** Lockup occurs just after a check.
|
||||
Detected in ~12s (4s till 1st check + 4s till 2nd + 4s till 3rd).
|
||||
|
||||
**Limitations of the Buddy Detector:**
|
||||
|
||||
1. **All-CPU Lockup:** If all CPUs lock up simultaneously, the buddy
|
||||
detector cannot detect the condition because the monitoring CPUs
|
||||
are also frozen.
|
||||
2. **Stack Traces:** Unlike the NMI detector, the buddy detector
|
||||
cannot directly interrupt the locked CPU to grab a stack trace.
|
||||
It relies on architecture-specific mechanisms (like NMI backtrace
|
||||
support) to try and retrieve the status of the locked CPU. If
|
||||
such support is missing, the log may only show that a lockup
|
||||
occurred without providing the locked CPU's stack.
|
||||
|
||||
Watchdog Core Exclusion
|
||||
=======================
|
||||
|
||||
By default, the watchdog runs on all online cores. However, on a
|
||||
kernel configured with NO_HZ_FULL, by default the watchdog runs only
|
||||
|
||||
@@ -418,7 +418,8 @@ hung_task_detect_count
|
||||
======================
|
||||
|
||||
Indicates the total number of tasks that have been detected as hung since
|
||||
the system boot.
|
||||
the system boot or since the counter was reset. The counter is zeroed when
|
||||
a value of 0 is written.
|
||||
|
||||
This file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
title: Xilinx LogiCORE IP AXI Timer
|
||||
|
||||
maintainers:
|
||||
- Sean Anderson <sean.anderson@seco.com>
|
||||
- Sean Anderson <sean.anderson@linux.dev>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
|
||||
+3
-2
@@ -35,6 +35,7 @@ Descriptions of section entries and preferred order
|
||||
F: drivers/net/ all files in and below drivers/net
|
||||
F: drivers/net/* all files in drivers/net, but not below
|
||||
F: */net/* all files in "any top level directory"/net
|
||||
F: fs/**/*foo*.c all *foo*.c files in any subdirectory of fs
|
||||
One pattern per line. Multiple F: lines acceptable.
|
||||
X: *Excluded* files and directories that are NOT maintained, same
|
||||
rules as F:. Files exclusions are tested before file matches.
|
||||
@@ -10308,7 +10309,7 @@ F: drivers/net/ethernet/freescale/dpaa
|
||||
|
||||
FREESCALE QORIQ DPAA FMAN DRIVER
|
||||
M: Madalin Bucur <madalin.bucur@nxp.com>
|
||||
R: Sean Anderson <sean.anderson@seco.com>
|
||||
R: Sean Anderson <sean.anderson@linux.dev>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/net/fsl,fman*.yaml
|
||||
@@ -29109,7 +29110,7 @@ S: Orphan
|
||||
F: drivers/net/ethernet/xilinx/ll_temac*
|
||||
|
||||
XILINX PWM DRIVER
|
||||
M: Sean Anderson <sean.anderson@seco.com>
|
||||
M: Sean Anderson <sean.anderson@linux.dev>
|
||||
S: Maintained
|
||||
F: drivers/pwm/pwm-xilinx.c
|
||||
F: include/clocksource/timer-xilinx.h
|
||||
|
||||
@@ -39,9 +39,4 @@ endif
|
||||
$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
|
||||
$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
|
||||
|
||||
ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
|
||||
CFLAGS_xor-neon.o += $(CC_FLAGS_FPU)
|
||||
obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* arch/arm64/include/asm/xor.h
|
||||
*
|
||||
* Authors: Jackie Liu <liuyun01@kylinos.cn>
|
||||
* Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
|
||||
*/
|
||||
|
||||
#include <linux/hardirq.h>
|
||||
#include <asm-generic/xor.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
#ifdef CONFIG_KERNEL_MODE_NEON
|
||||
|
||||
extern struct xor_block_template const xor_block_inner_neon;
|
||||
|
||||
static void
|
||||
xor_neon_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2)
|
||||
{
|
||||
scoped_ksimd()
|
||||
xor_block_inner_neon.do_2(bytes, p1, p2);
|
||||
}
|
||||
|
||||
static void
|
||||
xor_neon_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3)
|
||||
{
|
||||
scoped_ksimd()
|
||||
xor_block_inner_neon.do_3(bytes, p1, p2, p3);
|
||||
}
|
||||
|
||||
static void
|
||||
xor_neon_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4)
|
||||
{
|
||||
scoped_ksimd()
|
||||
xor_block_inner_neon.do_4(bytes, p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
static void
|
||||
xor_neon_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4,
|
||||
const unsigned long * __restrict p5)
|
||||
{
|
||||
scoped_ksimd()
|
||||
xor_block_inner_neon.do_5(bytes, p1, p2, p3, p4, p5);
|
||||
}
|
||||
|
||||
static struct xor_block_template xor_block_arm64 = {
|
||||
.name = "arm64_neon",
|
||||
.do_2 = xor_neon_2,
|
||||
.do_3 = xor_neon_3,
|
||||
.do_4 = xor_neon_4,
|
||||
.do_5 = xor_neon_5
|
||||
};
|
||||
#undef XOR_TRY_TEMPLATES
|
||||
#define XOR_TRY_TEMPLATES \
|
||||
do { \
|
||||
xor_speed(&xor_block_8regs); \
|
||||
xor_speed(&xor_block_32regs); \
|
||||
if (cpu_has_neon()) { \
|
||||
xor_speed(&xor_block_arm64);\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* ! CONFIG_KERNEL_MODE_NEON */
|
||||
@@ -134,6 +134,10 @@ int load_other_segments(struct kimage *image,
|
||||
|
||||
kexec_dprintk("Loaded elf core header at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
|
||||
image->elf_load_addr, kbuf.bufsz, kbuf.memsz);
|
||||
|
||||
ret = crash_load_dm_crypt_keys(image);
|
||||
if (ret)
|
||||
goto out_err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,12 +5,6 @@ lib-y := clear_user.o delay.o copy_from_user.o \
|
||||
memset.o memcmp.o strcmp.o strncmp.o strlen.o \
|
||||
strnlen.o strchr.o strrchr.o tishift.o
|
||||
|
||||
ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
|
||||
obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o
|
||||
CFLAGS_xor-neon.o += $(CC_FLAGS_FPU)
|
||||
CFLAGS_REMOVE_xor-neon.o += $(CC_FLAGS_NO_FPU)
|
||||
endif
|
||||
|
||||
lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
|
||||
|
||||
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* Copyright (C) 2023 WANG Xuerui <git@xen0n.name>
|
||||
*/
|
||||
#ifndef _ASM_LOONGARCH_XOR_H
|
||||
#define _ASM_LOONGARCH_XOR_H
|
||||
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/xor_simd.h>
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LSX
|
||||
static struct xor_block_template xor_block_lsx = {
|
||||
.name = "lsx",
|
||||
.do_2 = xor_lsx_2,
|
||||
.do_3 = xor_lsx_3,
|
||||
.do_4 = xor_lsx_4,
|
||||
.do_5 = xor_lsx_5,
|
||||
};
|
||||
|
||||
#define XOR_SPEED_LSX() \
|
||||
do { \
|
||||
if (cpu_has_lsx) \
|
||||
xor_speed(&xor_block_lsx); \
|
||||
} while (0)
|
||||
#else /* CONFIG_CPU_HAS_LSX */
|
||||
#define XOR_SPEED_LSX()
|
||||
#endif /* CONFIG_CPU_HAS_LSX */
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LASX
|
||||
static struct xor_block_template xor_block_lasx = {
|
||||
.name = "lasx",
|
||||
.do_2 = xor_lasx_2,
|
||||
.do_3 = xor_lasx_3,
|
||||
.do_4 = xor_lasx_4,
|
||||
.do_5 = xor_lasx_5,
|
||||
};
|
||||
|
||||
#define XOR_SPEED_LASX() \
|
||||
do { \
|
||||
if (cpu_has_lasx) \
|
||||
xor_speed(&xor_block_lasx); \
|
||||
} while (0)
|
||||
#else /* CONFIG_CPU_HAS_LASX */
|
||||
#define XOR_SPEED_LASX()
|
||||
#endif /* CONFIG_CPU_HAS_LASX */
|
||||
|
||||
/*
|
||||
* For grins, also test the generic routines.
|
||||
*
|
||||
* More importantly: it cannot be ruled out at this point of time, that some
|
||||
* future (maybe reduced) models could run the vector algorithms slower than
|
||||
* the scalar ones, maybe for errata or micro-op reasons. It may be
|
||||
* appropriate to revisit this after one or two more uarch generations.
|
||||
*/
|
||||
#include <asm-generic/xor.h>
|
||||
|
||||
#undef XOR_TRY_TEMPLATES
|
||||
#define XOR_TRY_TEMPLATES \
|
||||
do { \
|
||||
xor_speed(&xor_block_8regs); \
|
||||
xor_speed(&xor_block_8regs_p); \
|
||||
xor_speed(&xor_block_32regs); \
|
||||
xor_speed(&xor_block_32regs_p); \
|
||||
XOR_SPEED_LSX(); \
|
||||
XOR_SPEED_LASX(); \
|
||||
} while (0)
|
||||
|
||||
#endif /* _ASM_LOONGARCH_XOR_H */
|
||||
@@ -1,34 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* Copyright (C) 2023 WANG Xuerui <git@xen0n.name>
|
||||
*/
|
||||
#ifndef _ASM_LOONGARCH_XOR_SIMD_H
|
||||
#define _ASM_LOONGARCH_XOR_SIMD_H
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LSX
|
||||
void xor_lsx_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2);
|
||||
void xor_lsx_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3);
|
||||
void xor_lsx_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4);
|
||||
void xor_lsx_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4, const unsigned long * __restrict p5);
|
||||
#endif /* CONFIG_CPU_HAS_LSX */
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LASX
|
||||
void xor_lasx_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2);
|
||||
void xor_lasx_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3);
|
||||
void xor_lasx_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4);
|
||||
void xor_lasx_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2, const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4, const unsigned long * __restrict p5);
|
||||
#endif /* CONFIG_CPU_HAS_LASX */
|
||||
|
||||
#endif /* _ASM_LOONGARCH_XOR_SIMD_H */
|
||||
@@ -8,6 +8,4 @@ lib-y += delay.o memset.o memcpy.o memmove.o \
|
||||
|
||||
obj-$(CONFIG_ARCH_SUPPORTS_INT128) += tishift.o
|
||||
|
||||
obj-$(CONFIG_CPU_HAS_LSX) += xor_simd.o xor_simd_glue.o
|
||||
|
||||
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* LoongArch SIMD XOR operations
|
||||
*
|
||||
* Copyright (C) 2023 WANG Xuerui <git@xen0n.name>
|
||||
*/
|
||||
|
||||
#include <linux/export.h>
|
||||
#include <linux/sched.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/xor_simd.h>
|
||||
#include "xor_simd.h"
|
||||
|
||||
#define MAKE_XOR_GLUE_2(flavor) \
|
||||
void xor_##flavor##_2(unsigned long bytes, unsigned long * __restrict p1, \
|
||||
const unsigned long * __restrict p2) \
|
||||
{ \
|
||||
kernel_fpu_begin(); \
|
||||
__xor_##flavor##_2(bytes, p1, p2); \
|
||||
kernel_fpu_end(); \
|
||||
} \
|
||||
EXPORT_SYMBOL_GPL(xor_##flavor##_2)
|
||||
|
||||
#define MAKE_XOR_GLUE_3(flavor) \
|
||||
void xor_##flavor##_3(unsigned long bytes, unsigned long * __restrict p1, \
|
||||
const unsigned long * __restrict p2, \
|
||||
const unsigned long * __restrict p3) \
|
||||
{ \
|
||||
kernel_fpu_begin(); \
|
||||
__xor_##flavor##_3(bytes, p1, p2, p3); \
|
||||
kernel_fpu_end(); \
|
||||
} \
|
||||
EXPORT_SYMBOL_GPL(xor_##flavor##_3)
|
||||
|
||||
#define MAKE_XOR_GLUE_4(flavor) \
|
||||
void xor_##flavor##_4(unsigned long bytes, unsigned long * __restrict p1, \
|
||||
const unsigned long * __restrict p2, \
|
||||
const unsigned long * __restrict p3, \
|
||||
const unsigned long * __restrict p4) \
|
||||
{ \
|
||||
kernel_fpu_begin(); \
|
||||
__xor_##flavor##_4(bytes, p1, p2, p3, p4); \
|
||||
kernel_fpu_end(); \
|
||||
} \
|
||||
EXPORT_SYMBOL_GPL(xor_##flavor##_4)
|
||||
|
||||
#define MAKE_XOR_GLUE_5(flavor) \
|
||||
void xor_##flavor##_5(unsigned long bytes, unsigned long * __restrict p1, \
|
||||
const unsigned long * __restrict p2, \
|
||||
const unsigned long * __restrict p3, \
|
||||
const unsigned long * __restrict p4, \
|
||||
const unsigned long * __restrict p5) \
|
||||
{ \
|
||||
kernel_fpu_begin(); \
|
||||
__xor_##flavor##_5(bytes, p1, p2, p3, p4, p5); \
|
||||
kernel_fpu_end(); \
|
||||
} \
|
||||
EXPORT_SYMBOL_GPL(xor_##flavor##_5)
|
||||
|
||||
#define MAKE_XOR_GLUES(flavor) \
|
||||
MAKE_XOR_GLUE_2(flavor); \
|
||||
MAKE_XOR_GLUE_3(flavor); \
|
||||
MAKE_XOR_GLUE_4(flavor); \
|
||||
MAKE_XOR_GLUE_5(flavor)
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LSX
|
||||
MAKE_XOR_GLUES(lsx);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_HAS_LASX
|
||||
MAKE_XOR_GLUES(lasx);
|
||||
#endif
|
||||
@@ -1,47 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
*
|
||||
* Copyright (C) IBM Corporation, 2012
|
||||
*
|
||||
* Author: Anton Blanchard <anton@au.ibm.com>
|
||||
*/
|
||||
#ifndef _ASM_POWERPC_XOR_H
|
||||
#define _ASM_POWERPC_XOR_H
|
||||
|
||||
#ifdef CONFIG_ALTIVEC
|
||||
|
||||
#include <asm/cputable.h>
|
||||
#include <asm/cpu_has_feature.h>
|
||||
#include <asm/xor_altivec.h>
|
||||
|
||||
static struct xor_block_template xor_block_altivec = {
|
||||
.name = "altivec",
|
||||
.do_2 = xor_altivec_2,
|
||||
.do_3 = xor_altivec_3,
|
||||
.do_4 = xor_altivec_4,
|
||||
.do_5 = xor_altivec_5,
|
||||
};
|
||||
|
||||
#define XOR_SPEED_ALTIVEC() \
|
||||
do { \
|
||||
if (cpu_has_feature(CPU_FTR_ALTIVEC)) \
|
||||
xor_speed(&xor_block_altivec); \
|
||||
} while (0)
|
||||
#else
|
||||
#define XOR_SPEED_ALTIVEC()
|
||||
#endif
|
||||
|
||||
/* Also try the generic routines. */
|
||||
#include <asm-generic/xor.h>
|
||||
|
||||
#undef XOR_TRY_TEMPLATES
|
||||
#define XOR_TRY_TEMPLATES \
|
||||
do { \
|
||||
xor_speed(&xor_block_8regs); \
|
||||
xor_speed(&xor_block_8regs_p); \
|
||||
xor_speed(&xor_block_32regs); \
|
||||
xor_speed(&xor_block_32regs_p); \
|
||||
XOR_SPEED_ALTIVEC(); \
|
||||
} while (0)
|
||||
|
||||
#endif /* _ASM_POWERPC_XOR_H */
|
||||
@@ -1,22 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _ASM_POWERPC_XOR_ALTIVEC_H
|
||||
#define _ASM_POWERPC_XOR_ALTIVEC_H
|
||||
|
||||
#ifdef CONFIG_ALTIVEC
|
||||
void xor_altivec_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2);
|
||||
void xor_altivec_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3);
|
||||
void xor_altivec_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4);
|
||||
void xor_altivec_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4,
|
||||
const unsigned long * __restrict p5);
|
||||
|
||||
#endif
|
||||
#endif /* _ASM_POWERPC_XOR_ALTIVEC_H */
|
||||
@@ -79,6 +79,10 @@ static void *elf64_load(struct kimage *image, char *kernel_buf,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = crash_load_dm_crypt_keys(image);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/* Setup cmdline for kdump kernel case */
|
||||
modified_cmdline = setup_kdump_cmdline(image, cmdline,
|
||||
cmdline_len);
|
||||
|
||||
@@ -72,9 +72,4 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
|
||||
|
||||
obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
|
||||
|
||||
obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o
|
||||
CFLAGS_xor_vmx.o += -mhard-float -maltivec $(call cc-option,-mabi=altivec)
|
||||
# Enable <altivec.h>
|
||||
CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include)
|
||||
|
||||
obj-$(CONFIG_PPC64) += $(obj64-y)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Simple interface to link xor_vmx.c and xor_vmx_glue.c
|
||||
*
|
||||
* Separating these file ensures that no altivec instructions are run
|
||||
* outside of the enable/disable altivec block.
|
||||
*/
|
||||
|
||||
void __xor_altivec_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2);
|
||||
void __xor_altivec_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3);
|
||||
void __xor_altivec_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4);
|
||||
void __xor_altivec_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4,
|
||||
const unsigned long * __restrict p5);
|
||||
@@ -1,63 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Altivec XOR operations
|
||||
*
|
||||
* Copyright 2017 IBM Corp.
|
||||
*/
|
||||
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/sched.h>
|
||||
#include <asm/switch_to.h>
|
||||
#include <asm/xor_altivec.h>
|
||||
#include "xor_vmx.h"
|
||||
|
||||
void xor_altivec_2(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2)
|
||||
{
|
||||
preempt_disable();
|
||||
enable_kernel_altivec();
|
||||
__xor_altivec_2(bytes, p1, p2);
|
||||
disable_kernel_altivec();
|
||||
preempt_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(xor_altivec_2);
|
||||
|
||||
void xor_altivec_3(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3)
|
||||
{
|
||||
preempt_disable();
|
||||
enable_kernel_altivec();
|
||||
__xor_altivec_3(bytes, p1, p2, p3);
|
||||
disable_kernel_altivec();
|
||||
preempt_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(xor_altivec_3);
|
||||
|
||||
void xor_altivec_4(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4)
|
||||
{
|
||||
preempt_disable();
|
||||
enable_kernel_altivec();
|
||||
__xor_altivec_4(bytes, p1, p2, p3, p4);
|
||||
disable_kernel_altivec();
|
||||
preempt_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(xor_altivec_4);
|
||||
|
||||
void xor_altivec_5(unsigned long bytes, unsigned long * __restrict p1,
|
||||
const unsigned long * __restrict p2,
|
||||
const unsigned long * __restrict p3,
|
||||
const unsigned long * __restrict p4,
|
||||
const unsigned long * __restrict p5)
|
||||
{
|
||||
preempt_disable();
|
||||
enable_kernel_altivec();
|
||||
__xor_altivec_5(bytes, p1, p2, p3, p4, p5);
|
||||
disable_kernel_altivec();
|
||||
preempt_enable();
|
||||
}
|
||||
EXPORT_SYMBOL(xor_altivec_5);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user