mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 's390-7.2-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Alexander Gordeev: - Use CIO device online variable instead of the internal FSM state to determine device availability during purge operations - Remove extra check of task_stack_page() because try_get_task_stack() already takes care of that when reading /proc/<pid>/wchan - Allow user-space to use the new SCLP action qualifier 4 for to provide NVMe SMART log data to the platform. - Send AP CHANGE uevents on successful bind and successful association to notify user-space about SE operations on AP queue devices - Add an s390dbf kernel parameter to configure debug log levels and area sizes during early boot - On arm64 the empty zero page is going to be mapped read-only. Do the same for s390 with an explicit set_memory_ro() call - Improve s390-specific bcr_serialize() and cpu_relax() implementations - Remove all unused variables to avoid allmodconfig W=1 build fails with latest clang-23 - Cleanup default Kconfig values for s390 selftests - Add a s390-tod trace clock to allow comparing trace timestamps between different systems or virtual machines on s390 - Remove the s390 implementation of strlcat() in favor of the generic variant - Make consistent the calling order between page_table_check_pte_clear() and secure page conversion across all code paths - Rearrange some fields within AP and zcrypt structs to reduce memory consumption and unused holes - Shorten GR_NUM and VX_NUM macros and move them to a separate header - Replace __get_free_page() with kmalloc() in few sources - Introduce an infrastructure for more efficient this_cpu operations. Eliminate conditional branches when PREEMPT_NONE is removed - Enable Rust support - Use z10 as minimum architecture level, similar to the boot code, to enforce a defined architecture level set - Improve and convert various mem*() helper functions to C. For that add .noinstr.text section to avoid orphaned warnings from the linker - Fix the function pointer type in __ret_from_fork() to correct the indirect call to match kernel thread return type of int - Revert support for DCACHE_WORD_ACCESS to avoid an endless exception loop on read from donated Ultravisor pages at unaligned addresses * tag 's390-7.2-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/s390/linux: (52 commits) s390: Revert support for DCACHE_WORD_ACCESS s390/process: Fix kernel thread function pointer type s390/tishift: Convert __ashlti3(), __ashrti3(), __lshrti3() to C s390/memmove: Optimize backward copy case s390/string: Convert memset(16|32|64)() to C s390/string: Convert memcpy() to C s390/string: Convert memset() to C s390/string: Convert memmove() to C s390/string: Add -ffreestanding compile option to string.o s390: Add .noinstr.text to boot and purgatory linker scripts s390/purgatory: Enforce z10 minimum architecture level s390: Enable Rust support s390/cmpxchg: Fix KASAN stack-out-of-bounds in atomic helpers rust: helpers: Add memchr wrapper for string operations rust/bindgen_parameters: Mark s390 types as opaque to prevent repr conflicts s390/jump_label: Implement ARCH_STATIC_BRANCH_JUMP_ASM and ARCH_STATIC_BRANCH_ASM macros s390/bug: Provide ARCH_WARN_ASM for Rust WARN/BUG support s390/ap: Fix locking issue in SE bind and associate sysfs functions s390/percpu: Provide arch_this_cpu_write() implementation s390/percpu: Provide arch_this_cpu_read() implementation ...
This commit is contained in:
@@ -106,6 +106,36 @@ the ``debug_stoppable`` sysctl. If you set ``debug_stoppable`` to 0 the debug
|
||||
feature cannot be stopped. If the debug feature is already stopped, it
|
||||
will stay deactivated.
|
||||
|
||||
Kernel parameters
|
||||
-----------------
|
||||
The size and log levels of debug logs can be configured early during boot using
|
||||
the ``s390dbf`` kernel parameter. The parameter accepts a debug log name, a log
|
||||
level, and a log size, separated by colon characters (``:``). To configure only
|
||||
a single attribute, either the log level or the log size may be omitted.
|
||||
|
||||
To configure multiple debug logs, the parameter may be specified multiple times,
|
||||
or multiple parameter sets may be provided in a single instance, separated by
|
||||
commas.
|
||||
|
||||
Parameter format::
|
||||
|
||||
s390dbf=<name|pattern>:[<level>|-]:[<pages>][,...]
|
||||
|
||||
where:
|
||||
|
||||
- ``name`` specifies either an exact debug log name or a shell-style wildcard
|
||||
pattern
|
||||
- ``level`` specifies the log level, or ``-`` to completely deactivate the log
|
||||
- ``pages`` specifies the debug area size in pages
|
||||
|
||||
Example::
|
||||
|
||||
s390dbf=cio*:6:128,sclp_err::2
|
||||
|
||||
This example sets the log level to 6 and the log size to 128 pages for all debug
|
||||
logs whose names start with ``cio``. It also sets the log level of the
|
||||
``sclp_err`` debug log to 2.
|
||||
|
||||
Kernel Interfaces:
|
||||
------------------
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ Architecture Level of support Constraints
|
||||
``arm64`` Maintained Little Endian only.
|
||||
``loongarch`` Maintained \-
|
||||
``riscv`` Maintained ``riscv64`` and LLVM/Clang only.
|
||||
``s390`` Maintained ``CONFIG_EXPOLINE`` must be disabled.
|
||||
``um`` Maintained \-
|
||||
``x86`` Maintained ``x86_64`` only.
|
||||
============= ================ ==============================================
|
||||
|
||||
@@ -570,6 +570,10 @@ of ftrace. Here is a list of some of the key files:
|
||||
to correlate events across hypervisor/guest if
|
||||
tb_offset is known.
|
||||
|
||||
s390-tod:
|
||||
This uses the s390 TOD clock value. This clock is usually in
|
||||
sync across virtual machines and STP-enabled machines.
|
||||
|
||||
mono:
|
||||
This uses the fast monotonic clock (CLOCK_MONOTONIC)
|
||||
which is monotonic and is subject to NTP rate adjustments.
|
||||
|
||||
+5
-6
@@ -163,7 +163,6 @@ config S390
|
||||
select ARCH_WANTS_THP_SWAP
|
||||
select BUILDTIME_TABLE_SORT
|
||||
select CLONE_BACKWARDS2
|
||||
select DCACHE_WORD_ACCESS if !KMSAN
|
||||
select DYNAMIC_FTRACE if FUNCTION_TRACER
|
||||
select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
|
||||
select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
|
||||
@@ -175,6 +174,7 @@ config S390
|
||||
select GENERIC_GETTIMEOFDAY
|
||||
select GENERIC_SMP_IDLE_THREAD
|
||||
select GENERIC_IOREMAP if PCI
|
||||
select GLOB
|
||||
select HAVE_ALIGNED_STRUCT_PAGE
|
||||
select HAVE_ARCH_AUDITSYSCALL
|
||||
select HAVE_ARCH_GET_SECUREBOOT
|
||||
@@ -244,6 +244,7 @@ config S390
|
||||
select HAVE_RELIABLE_STACKTRACE
|
||||
select HAVE_RETHOOK
|
||||
select HAVE_RSEQ
|
||||
select HAVE_RUST if !EXPOLINE
|
||||
select HAVE_SAMPLE_FTRACE_DIRECT
|
||||
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
|
||||
select HAVE_SETUP_PER_CPU_AREA
|
||||
@@ -995,9 +996,8 @@ config S390_MODULES_SANITY_TEST_HELPERS
|
||||
menu "Selftests"
|
||||
|
||||
config S390_UNWIND_SELFTEST
|
||||
def_tristate n
|
||||
def_tristate KUNIT_ALL_TESTS
|
||||
depends on KUNIT
|
||||
default KUNIT_ALL_TESTS
|
||||
prompt "Test unwind functions"
|
||||
help
|
||||
This option enables s390 specific stack unwinder testing kernel
|
||||
@@ -1007,7 +1007,7 @@ config S390_UNWIND_SELFTEST
|
||||
Say N if you are unsure.
|
||||
|
||||
config S390_KPROBES_SANITY_TEST
|
||||
def_tristate n
|
||||
def_tristate KUNIT_ALL_TESTS
|
||||
prompt "Enable s390 specific kprobes tests"
|
||||
depends on KPROBES
|
||||
depends on KUNIT
|
||||
@@ -1019,9 +1019,8 @@ config S390_KPROBES_SANITY_TEST
|
||||
Say N if you are unsure.
|
||||
|
||||
config S390_MODULES_SANITY_TEST
|
||||
def_tristate n
|
||||
def_tristate KUNIT_ALL_TESTS
|
||||
depends on KUNIT && m
|
||||
default KUNIT_ALL_TESTS
|
||||
prompt "Enable s390 specific modules tests"
|
||||
select S390_MODULES_SANITY_TEST_HELPERS
|
||||
help
|
||||
|
||||
+17
-11
@@ -35,25 +35,31 @@ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)
|
||||
|
||||
KBUILD_RUSTFLAGS += --target=s390x-unknown-none-softfloat -Zpacked-stack -Ctarget-feature=+backchain
|
||||
|
||||
UTS_MACHINE := s390x
|
||||
STACK_SIZE := $(if $(CONFIG_KASAN),65536,$(if $(CONFIG_KMSAN),65536,16384))
|
||||
CHECKFLAGS += -D__s390__ -D__s390x__
|
||||
|
||||
export LD_BFD
|
||||
|
||||
mflags-$(CONFIG_MARCH_Z10) := -march=z10
|
||||
mflags-$(CONFIG_MARCH_Z196) := -march=z196
|
||||
mflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12
|
||||
mflags-$(CONFIG_MARCH_Z13) := -march=z13
|
||||
mflags-$(CONFIG_MARCH_Z14) := -march=z14
|
||||
mflags-$(CONFIG_MARCH_Z15) := -march=z15
|
||||
mflags-$(CONFIG_MARCH_Z16) := -march=z16
|
||||
mflags-$(CONFIG_MARCH_Z17) := -march=z17
|
||||
march-name-$(CONFIG_MARCH_Z10) := z10
|
||||
march-name-$(CONFIG_MARCH_Z196) := z196
|
||||
march-name-$(CONFIG_MARCH_ZEC12) := zEC12
|
||||
march-name-$(CONFIG_MARCH_Z13) := z13
|
||||
march-name-$(CONFIG_MARCH_Z14) := z14
|
||||
march-name-$(CONFIG_MARCH_Z15) := z15
|
||||
march-name-$(CONFIG_MARCH_Z16) := z16
|
||||
march-name-$(CONFIG_MARCH_Z17) := z17
|
||||
|
||||
export CC_FLAGS_MARCH := $(mflags-y)
|
||||
mflags := -march=$(march-name-y)
|
||||
|
||||
aflags-y += $(mflags-y)
|
||||
cflags-y += $(mflags-y)
|
||||
export CC_FLAGS_MARCH := $(mflags)
|
||||
|
||||
aflags-y += $(mflags)
|
||||
cflags-y += $(mflags)
|
||||
|
||||
KBUILD_RUSTFLAGS += -Ctarget-cpu=$(march-name-y)
|
||||
|
||||
cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10
|
||||
cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196
|
||||
|
||||
@@ -51,7 +51,6 @@ static int appldata_timer_handler(const struct ctl_table *ctl, int write,
|
||||
static int appldata_interval_handler(const struct ctl_table *ctl, int write,
|
||||
void *buffer, size_t *lenp, loff_t *ppos);
|
||||
|
||||
static struct ctl_table_header *appldata_sysctl_header;
|
||||
static const struct ctl_table appldata_table[] = {
|
||||
{
|
||||
.procname = "timer",
|
||||
@@ -406,7 +405,7 @@ static int __init appldata_init(void)
|
||||
appldata_wq = alloc_ordered_workqueue("appldata", 0);
|
||||
if (!appldata_wq)
|
||||
return -ENOMEM;
|
||||
appldata_sysctl_header = register_sysctl(appldata_proc_name, appldata_table);
|
||||
register_sysctl(appldata_proc_name, appldata_table);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,13 @@ KBUILD_CFLAGS += $(call cc-option, -Wno-default-const-init-unsafe)
|
||||
|
||||
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
|
||||
|
||||
# string.o implements standard library functions like memset/memcpy etc.
|
||||
# Use -ffreestanding to ensure that the compiler does not try to "optimize"
|
||||
# them into calls to themselves.
|
||||
CFLAGS_string.o = -ffreestanding
|
||||
|
||||
obj-y := head.o als.o startup.o physmem_info.o ipl_parm.o ipl_report.o vmem.o
|
||||
obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
|
||||
obj-y += string.o ebcdic.o sclp_early_core.o ipl_vmparm.o cmdline.o
|
||||
obj-y += version.o pgm_check.o ctype.o ipl_data.o relocs.o alternative.o
|
||||
obj-y += uv.o printk.o trampoline.o
|
||||
obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#include "../lib/mem.S"
|
||||
@@ -43,11 +43,7 @@ ssize_t sized_strscpy(char *dst, const char *src, size_t count)
|
||||
|
||||
void *memset64(uint64_t *s, uint64_t v, size_t count)
|
||||
{
|
||||
uint64_t *xs = s;
|
||||
|
||||
while (count--)
|
||||
*xs++ = v;
|
||||
return s;
|
||||
return __memset64(s, v, count * sizeof(v));
|
||||
}
|
||||
|
||||
char *skip_spaces(const char *str)
|
||||
|
||||
@@ -31,6 +31,7 @@ SECTIONS
|
||||
_text = .; /* Text */
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.noinstr.text)
|
||||
INIT_TEXT
|
||||
_etext = . ;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define EX_TYPE_UA_FAULT 3
|
||||
#define EX_TYPE_UA_LOAD_REG 5
|
||||
#define EX_TYPE_UA_LOAD_REGPAIR 6
|
||||
#define EX_TYPE_ZEROPAD 7
|
||||
#define EX_TYPE_FPC 8
|
||||
#define EX_TYPE_UA_MVCOS_TO 9
|
||||
#define EX_TYPE_UA_MVCOS_FROM 10
|
||||
@@ -80,9 +79,6 @@
|
||||
#define EX_TABLE_UA_LOAD_REGPAIR(_fault, _target, _regerr, _regzero) \
|
||||
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REGPAIR, _regerr, _regzero, 0)
|
||||
|
||||
#define EX_TABLE_ZEROPAD(_fault, _target, _regdata, _regaddr) \
|
||||
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_ZEROPAD, _regdata, _regaddr, 0)
|
||||
|
||||
#define EX_TABLE_FPC(_fault, _target) \
|
||||
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FPC, __stringify(%%r0), __stringify(%%r0), 0)
|
||||
|
||||
|
||||
@@ -8,8 +8,4 @@
|
||||
#include <asm/nospec-branch.h>
|
||||
#include <asm-generic/asm-prototypes.h>
|
||||
|
||||
__int128_t __ashlti3(__int128_t a, int b);
|
||||
__int128_t __ashrti3(__int128_t a, int b);
|
||||
__int128_t __lshrti3(__int128_t a, int b);
|
||||
|
||||
#endif /* _ASM_S390_PROTOTYPES_H */
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef __ASM_BARRIER_H
|
||||
#define __ASM_BARRIER_H
|
||||
|
||||
#include <asm/alternative.h>
|
||||
#include <asm/march.h>
|
||||
|
||||
/*
|
||||
@@ -16,16 +17,11 @@
|
||||
* to devices.
|
||||
*/
|
||||
|
||||
#ifdef MARCH_HAS_Z196_FEATURES
|
||||
/* Fast-BCR without checkpoint synchronization */
|
||||
#define __ASM_BCR_SERIALIZE "bcr 14,0"
|
||||
#else
|
||||
#define __ASM_BCR_SERIALIZE "bcr 15,0"
|
||||
#endif
|
||||
|
||||
static __always_inline void bcr_serialize(void)
|
||||
{
|
||||
asm volatile(__ASM_BCR_SERIALIZE : : : "memory");
|
||||
asm_inline volatile(
|
||||
ALTERNATIVE("bcr 15,0", "bcr 14,0", ALT_FACILITY(45))
|
||||
: : : "memory");
|
||||
}
|
||||
|
||||
#define __mb() bcr_serialize()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/const.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
#define MONCODE_BUG _AC(0, U)
|
||||
#define MONCODE_BUG_ARG _AC(1, U)
|
||||
@@ -121,6 +122,17 @@ do { \
|
||||
#define HAVE_ARCH_BUG_FORMAT
|
||||
#define HAVE_ARCH_BUG_FORMAT_ARGS
|
||||
|
||||
#define ARCH_WARN_ASM(file, line, flags, size) \
|
||||
".section .rodata.str,\"aMS\",@progbits,1\n" \
|
||||
"9:\n" \
|
||||
".asciz \"\"\n" /* Empty string for compatibility */ \
|
||||
".previous\n" \
|
||||
"0:\n" \
|
||||
__stringify(mc 0(%r0),0) "\n" \
|
||||
__BUG_ENTRY("9b", file, line, flags, size)
|
||||
|
||||
#define ARCH_WARN_REACHABLE
|
||||
|
||||
#endif /* CONFIG_BUG && CONFIG_CC_HAS_ASM_IMMEDIATE_STRINGS */
|
||||
#endif /* __ASSEMBLER__ */
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ static __always_inline u64 __csg_asm(u64 ptr, u64 old, u64 new)
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline u8 __arch_cmpxchg1(u64 ptr, u8 old, u8 new)
|
||||
static __no_sanitize_or_inline u8 __arch_cmpxchg1(u64 ptr, u8 old, u8 new)
|
||||
{
|
||||
union {
|
||||
u8 b[4];
|
||||
@@ -58,7 +58,7 @@ static inline u8 __arch_cmpxchg1(u64 ptr, u8 old, u8 new)
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline u16 __arch_cmpxchg2(u64 ptr, u16 old, u16 new)
|
||||
static __no_sanitize_or_inline u16 __arch_cmpxchg2(u64 ptr, u16 old, u16 new)
|
||||
{
|
||||
union {
|
||||
u16 b[2];
|
||||
@@ -173,7 +173,7 @@ static __always_inline u64 __arch_cmpxchg(u64 ptr, u64 old, u64 new, int size)
|
||||
|
||||
void __xchg_called_with_bad_pointer(void);
|
||||
|
||||
static inline u8 __arch_xchg1(u64 ptr, u8 x)
|
||||
static __no_sanitize_or_inline u8 __arch_xchg1(u64 ptr, u8 x)
|
||||
{
|
||||
int shift = (3 ^ (ptr & 3)) << 3;
|
||||
u32 mask, old, new;
|
||||
@@ -188,7 +188,7 @@ static inline u8 __arch_xchg1(u64 ptr, u8 x)
|
||||
return old >> shift;
|
||||
}
|
||||
|
||||
static inline u16 __arch_xchg2(u64 ptr, u16 x)
|
||||
static __no_sanitize_or_inline u16 __arch_xchg2(u64 ptr, u16 x)
|
||||
{
|
||||
int shift = (2 ^ (ptr & 2)) << 3;
|
||||
u32 mask, old, new;
|
||||
|
||||
@@ -490,6 +490,7 @@ arch_initcall(VNAME(var, reg))
|
||||
__DEFINE_STATIC_AREA(var); \
|
||||
static debug_info_t __refdata var = \
|
||||
__DEBUG_INFO_INIT(var, (name), (buf_size)); \
|
||||
static debug_info_t __used __section(".s390dbf_info") *VNAME(var, info) = &var; \
|
||||
__REGISTER_STATIC_DEBUG_INFO(var, name, pages, nr_areas, view)
|
||||
|
||||
void debug_register_static(debug_info_t *id, int pages_per_area, int nr_areas);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef ARCH_S390_ENTRY_PERCPU_H
|
||||
#define ARCH_S390_ENTRY_PERCPU_H
|
||||
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <asm/lowcore.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
static __always_inline void percpu_entry(struct pt_regs *regs)
|
||||
{
|
||||
struct lowcore *lc = get_lowcore();
|
||||
|
||||
if (user_mode(regs))
|
||||
return;
|
||||
regs->cpu = lc->cpu_nr;
|
||||
regs->percpu_register = lc->percpu_register;
|
||||
lc->percpu_register = 0;
|
||||
}
|
||||
|
||||
static __always_inline bool percpu_code_check(struct pt_regs *regs)
|
||||
{
|
||||
unsigned int insn, disp;
|
||||
struct kprobe *p;
|
||||
|
||||
if (likely(user_mode(regs) || !regs->percpu_register))
|
||||
return false;
|
||||
/*
|
||||
* Within a percpu code section - check if the percpu base register
|
||||
* needs to be updated. This is the case if the PSW does not point to
|
||||
* the ADD instruction within the section.
|
||||
* - AG %rx,percpu_offset_in_lowcore(%r0,%r0)
|
||||
* which adds the percpu offset to the percpu base register.
|
||||
*/
|
||||
lockdep_assert_preemption_disabled();
|
||||
again:
|
||||
insn = READ_ONCE(*(u16 *)psw_bits(regs->psw).ia);
|
||||
if (unlikely(insn == BREAKPOINT_INSTRUCTION)) {
|
||||
p = get_kprobe((void *)psw_bits(regs->psw).ia);
|
||||
/*
|
||||
* If the kprobe is concurrently removed on a different CPU
|
||||
* it might not be found anymore. However text must have
|
||||
* been restored - try again.
|
||||
*/
|
||||
if (!p)
|
||||
goto again;
|
||||
insn = p->opcode;
|
||||
}
|
||||
if ((insn & 0xff0f) != 0xe300)
|
||||
return true;
|
||||
disp = offsetof(struct lowcore, percpu_offset);
|
||||
if (machine_has_relocated_lowcore())
|
||||
disp += LOWCORE_ALT_ADDRESS;
|
||||
insn = (disp & 0xff000) >> 4 | (disp & 0x00fff) << 16 | 0x8;
|
||||
if (*(u32 *)(psw_bits(regs->psw).ia + 2) != insn)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static __always_inline void percpu_exit(struct pt_regs *regs, bool needs_fixup)
|
||||
{
|
||||
struct lowcore *lc = get_lowcore();
|
||||
unsigned char reg;
|
||||
|
||||
if (user_mode(regs))
|
||||
return;
|
||||
reg = regs->percpu_register;
|
||||
lc->percpu_register = reg;
|
||||
if (likely(!needs_fixup))
|
||||
return;
|
||||
/* Check if process has been migrated to a different CPU. */
|
||||
if (regs->cpu == lc->cpu_nr)
|
||||
return;
|
||||
/* Fixup percpu base register */
|
||||
regs->gprs[reg] -= __per_cpu_offset[regs->cpu];
|
||||
regs->gprs[reg] += lc->percpu_offset;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -16,182 +16,10 @@
|
||||
#error only <asm/fpu-insn.h> can be included directly
|
||||
#endif
|
||||
|
||||
#include <asm/insn-common-asm.h>
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
|
||||
/* Macros to generate vector instruction byte code */
|
||||
|
||||
/* GR_NUM - Retrieve general-purpose register number
|
||||
*
|
||||
* @opd: Operand to store register number
|
||||
* @r64: String designation register in the format "%rN"
|
||||
*/
|
||||
.macro GR_NUM opd gr
|
||||
\opd = 255
|
||||
.ifc \gr,%r0
|
||||
\opd = 0
|
||||
.endif
|
||||
.ifc \gr,%r1
|
||||
\opd = 1
|
||||
.endif
|
||||
.ifc \gr,%r2
|
||||
\opd = 2
|
||||
.endif
|
||||
.ifc \gr,%r3
|
||||
\opd = 3
|
||||
.endif
|
||||
.ifc \gr,%r4
|
||||
\opd = 4
|
||||
.endif
|
||||
.ifc \gr,%r5
|
||||
\opd = 5
|
||||
.endif
|
||||
.ifc \gr,%r6
|
||||
\opd = 6
|
||||
.endif
|
||||
.ifc \gr,%r7
|
||||
\opd = 7
|
||||
.endif
|
||||
.ifc \gr,%r8
|
||||
\opd = 8
|
||||
.endif
|
||||
.ifc \gr,%r9
|
||||
\opd = 9
|
||||
.endif
|
||||
.ifc \gr,%r10
|
||||
\opd = 10
|
||||
.endif
|
||||
.ifc \gr,%r11
|
||||
\opd = 11
|
||||
.endif
|
||||
.ifc \gr,%r12
|
||||
\opd = 12
|
||||
.endif
|
||||
.ifc \gr,%r13
|
||||
\opd = 13
|
||||
.endif
|
||||
.ifc \gr,%r14
|
||||
\opd = 14
|
||||
.endif
|
||||
.ifc \gr,%r15
|
||||
\opd = 15
|
||||
.endif
|
||||
.if \opd == 255
|
||||
\opd = \gr
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* VX_NUM - Retrieve vector register number
|
||||
*
|
||||
* @opd: Operand to store register number
|
||||
* @vxr: String designation register in the format "%vN"
|
||||
*
|
||||
* The vector register number is used for as input number to the
|
||||
* instruction and, as well as, to compute the RXB field of the
|
||||
* instruction.
|
||||
*/
|
||||
.macro VX_NUM opd vxr
|
||||
\opd = 255
|
||||
.ifc \vxr,%v0
|
||||
\opd = 0
|
||||
.endif
|
||||
.ifc \vxr,%v1
|
||||
\opd = 1
|
||||
.endif
|
||||
.ifc \vxr,%v2
|
||||
\opd = 2
|
||||
.endif
|
||||
.ifc \vxr,%v3
|
||||
\opd = 3
|
||||
.endif
|
||||
.ifc \vxr,%v4
|
||||
\opd = 4
|
||||
.endif
|
||||
.ifc \vxr,%v5
|
||||
\opd = 5
|
||||
.endif
|
||||
.ifc \vxr,%v6
|
||||
\opd = 6
|
||||
.endif
|
||||
.ifc \vxr,%v7
|
||||
\opd = 7
|
||||
.endif
|
||||
.ifc \vxr,%v8
|
||||
\opd = 8
|
||||
.endif
|
||||
.ifc \vxr,%v9
|
||||
\opd = 9
|
||||
.endif
|
||||
.ifc \vxr,%v10
|
||||
\opd = 10
|
||||
.endif
|
||||
.ifc \vxr,%v11
|
||||
\opd = 11
|
||||
.endif
|
||||
.ifc \vxr,%v12
|
||||
\opd = 12
|
||||
.endif
|
||||
.ifc \vxr,%v13
|
||||
\opd = 13
|
||||
.endif
|
||||
.ifc \vxr,%v14
|
||||
\opd = 14
|
||||
.endif
|
||||
.ifc \vxr,%v15
|
||||
\opd = 15
|
||||
.endif
|
||||
.ifc \vxr,%v16
|
||||
\opd = 16
|
||||
.endif
|
||||
.ifc \vxr,%v17
|
||||
\opd = 17
|
||||
.endif
|
||||
.ifc \vxr,%v18
|
||||
\opd = 18
|
||||
.endif
|
||||
.ifc \vxr,%v19
|
||||
\opd = 19
|
||||
.endif
|
||||
.ifc \vxr,%v20
|
||||
\opd = 20
|
||||
.endif
|
||||
.ifc \vxr,%v21
|
||||
\opd = 21
|
||||
.endif
|
||||
.ifc \vxr,%v22
|
||||
\opd = 22
|
||||
.endif
|
||||
.ifc \vxr,%v23
|
||||
\opd = 23
|
||||
.endif
|
||||
.ifc \vxr,%v24
|
||||
\opd = 24
|
||||
.endif
|
||||
.ifc \vxr,%v25
|
||||
\opd = 25
|
||||
.endif
|
||||
.ifc \vxr,%v26
|
||||
\opd = 26
|
||||
.endif
|
||||
.ifc \vxr,%v27
|
||||
\opd = 27
|
||||
.endif
|
||||
.ifc \vxr,%v28
|
||||
\opd = 28
|
||||
.endif
|
||||
.ifc \vxr,%v29
|
||||
\opd = 29
|
||||
.endif
|
||||
.ifc \vxr,%v30
|
||||
\opd = 30
|
||||
.endif
|
||||
.ifc \vxr,%v31
|
||||
\opd = 31
|
||||
.endif
|
||||
.if \opd == 255
|
||||
\opd = \vxr
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/* RXB - Compute most significant bit used vector registers
|
||||
*
|
||||
* @rxb: Operand to store computed RXB value
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <linux/kmsan.h>
|
||||
#include <asm/asm-extable.h>
|
||||
|
||||
asm(".include \"asm/insn-common-asm.h\"\n");
|
||||
asm(".include \"asm/fpu-insn-asm.h\"\n");
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Assembler helper macros to generate .byte/.word code for instructions
|
||||
* that are unknown to older binutils versions.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_S390_INSN_COMMON_ASM_H
|
||||
#define __ASM_S390_INSN_COMMON_ASM_H
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
|
||||
/*
|
||||
* GR_NUM - Retrieve general-purpose register number
|
||||
*
|
||||
* @opd: Operand to store register number
|
||||
* @gr: String designation register in the format "%rN"
|
||||
*/
|
||||
.macro GR_NUM opd gr
|
||||
\opd = 255
|
||||
.irp rs,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
|
||||
.ifc \gr,%r\rs
|
||||
\opd = \rs
|
||||
.endif
|
||||
.endr
|
||||
.if \opd == 255
|
||||
\opd = \gr
|
||||
.endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* VX_NUM - Retrieve vector register number
|
||||
*
|
||||
* @opd: Operand to store register number
|
||||
* @vxr: String designation register in the format "%vN"
|
||||
*
|
||||
* The vector register number is used for as input number to the
|
||||
* instruction and, as well as, to compute the RXB field of the
|
||||
* instruction.
|
||||
*/
|
||||
.macro VX_NUM opd vxr
|
||||
\opd = 255
|
||||
.irp vs,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
|
||||
.ifc \vxr,%v\vs
|
||||
\opd = \vs
|
||||
.endif
|
||||
.endr
|
||||
.if \opd == 255
|
||||
\opd = \vxr
|
||||
.endif
|
||||
.endm
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
||||
#endif /* __ASM_S390_INSN_COMMON_ASM_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user