mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
LoongArch changes for v6.15
1, Add jump table support for objtool; 2, Always select HAVE_VIRT_CPU_ACCOUNTING_GEN; 3, Enable UBSAN (Undefined Behavior Sanitizer); 4, Increase MAX_IO_PICS up to 8; 5, Increase ARCH_DMA_MINALIGN up to 16; 6, Fix and improve BPF JIT; 7, Fix and improve vDSO implementation; 8, Update the default config file; 9, Some bug fixes and other small changes. -----BEGIN PGP SIGNATURE----- iQJKBAABCAA0FiEEzOlt8mkP+tbeiYy5AoYrw/LiJnoFAmfpIOoWHGNoZW5odWFj YWlAa2VybmVsLm9yZwAKCRAChivD8uImehgBD/4zyWfVImn3H+2JFavzROyIdi/e Bx5PNePi+u2sIqDMc15URvxgfi7fUrRPgYYYuk2+lqLITAvdhq4FZdxhUIaWX+Tv Fn+MLck/AcXNn5jaQ8VZ7BC9xD6JG59+zcCKAHD9xiM5fmFD+rCj9PBMtYsVq/K9 EifMfudfUGLodZno2uY75Ee61ZwLDpLEJbIzrY+IPzE9KFWTsehAvZlLGZ8/y+CD CsYUxQpFjoi5Ge1O/iFyvM2lPI8YukhJjC25nR+14ClS2WrbKIDo3Nn/+Ey8+W92 z1k/8ftc57L+lMtLE0G/3vC++qw+U22RLT+w6CGA7BJpDZodfRE/1FADTEdW3xsE G0L2TjHNWnYradiK4M1kGd2tbQZz/Qyv6nPyUbqRw7Ok+axvCgxk3zNWdmiKK8Ld kG6nQUUV5hHd+zhpEQ4zD/U6ULM6Rl3UNNppld6ouN3oJLAwrVDL3mFwVq7zagRZ lvoFA1V9zJcrnfThRPIwmh25LkmEcrf5Y5SOggVeKK4GF3tB1sge8gV99UG8+om+ zVSeI65VytPafTfdqJlna1yt0ql/hvxgXWDcgmN2mIUZpbcBdJllLqF+ANbedCgs KRIGt7NuWCfAxDXavG5ShE6W0GqBwsBSapqcNu+KQK9nBK7cF28C0tkWJubTcrA3 SNqhZKdnalwQVdEnYA== =9xTj -----END PGP SIGNATURE----- Merge tag 'loongarch-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch updates from Huacai Chen: - Always select HAVE_VIRT_CPU_ACCOUNTING_GEN - Enable UBSAN (Undefined Behavior Sanitizer) - Increase MAX_IO_PICS up to 8 - Increase ARCH_DMA_MINALIGN up to 16 - Fix and improve BPF JIT - Fix and improve vDSO implementation - Update the default config file - Some bug fixes and other small changes * tag 'loongarch-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Update Loongson-3 default config file LoongArch: vDSO: Make use of the t8 register for vgetrandom-chacha LoongArch: vDSO: Remove --hash-style=sysv LoongArch: BPF: Don't override subprog's return value LoongArch: BPF: Use move_addr() for BPF_PSEUDO_FUNC LoongArch: BPF: Fix off-by-one error in build_prologue() LoongArch: Rework the arch_kgdb_breakpoint() implementation LoongArch: Fix device node refcount leak in fdt_cpu_clk_init() LoongArch: Increase ARCH_DMA_MINALIGN up to 16 LoongArch: Increase MAX_IO_PICS up to 8 LoongArch: Fix help text of CMDLINE_EXTEND in Kconfig LoongArch: Enable UBSAN (Undefined Behavior Sanitizer) LoongArch: Always select HAVE_VIRT_CPU_ACCOUNTING_GEN rust: Fix enabling Rust and building with GCC for LoongArch
This commit is contained in:
commit
1c241cba19
11 changed files with 44 additions and 22 deletions
|
@ -30,6 +30,7 @@ config LOONGARCH
|
|||
select ARCH_HAS_SET_MEMORY
|
||||
select ARCH_HAS_SET_DIRECT_MAP
|
||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select ARCH_HAS_UBSAN
|
||||
select ARCH_HAS_VDSO_ARCH_DATA
|
||||
select ARCH_INLINE_READ_LOCK if !PREEMPTION
|
||||
select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
|
||||
|
@ -177,7 +178,7 @@ config LOONGARCH
|
|||
select HAVE_STACKPROTECTOR
|
||||
select HAVE_SYSCALL_TRACEPOINTS
|
||||
select HAVE_TIF_NOHZ
|
||||
select HAVE_VIRT_CPU_ACCOUNTING_GEN if !SMP
|
||||
select HAVE_VIRT_CPU_ACCOUNTING_GEN
|
||||
select IRQ_FORCED_THREADING
|
||||
select IRQ_LOONGARCH_CPU
|
||||
select LOCK_MM_AND_FIND_VMA
|
||||
|
@ -387,8 +388,8 @@ config CMDLINE_BOOTLOADER
|
|||
config CMDLINE_EXTEND
|
||||
bool "Use built-in to extend bootloader kernel arguments"
|
||||
help
|
||||
The command-line arguments provided during boot will be
|
||||
appended to the built-in command line. This is useful in
|
||||
The built-in command line will be appended to the command-
|
||||
line arguments provided during boot. This is useful in
|
||||
cases where the provided arguments are insufficient and
|
||||
you don't want to or cannot modify them.
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ CONFIG_NUMA_BALANCING=y
|
|||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CFS_BANDWIDTH=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
CONFIG_CGROUP_RDMA=y
|
||||
CONFIG_CGROUP_DMEM=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_HUGETLB=y
|
||||
CONFIG_CPUSETS=y
|
||||
|
@ -665,6 +665,10 @@ CONFIG_RTW88_8723DE=m
|
|||
CONFIG_RTW88_8723DU=m
|
||||
CONFIG_RTW88_8821CE=m
|
||||
CONFIG_RTW88_8821CU=m
|
||||
CONFIG_RTW88_8821AU=m
|
||||
CONFIG_RTW88_8812AU=m
|
||||
CONFIG_RTW88_8814AE=m
|
||||
CONFIG_RTW88_8814AU=m
|
||||
CONFIG_RTW89=m
|
||||
CONFIG_RTW89_8851BE=m
|
||||
CONFIG_RTW89_8852AE=m
|
||||
|
@ -748,6 +752,7 @@ CONFIG_MEDIA_PCI_SUPPORT=y
|
|||
CONFIG_VIDEO_BT848=m
|
||||
CONFIG_DVB_BT8XX=m
|
||||
CONFIG_DRM=y
|
||||
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
|
||||
CONFIG_DRM_RADEON=m
|
||||
CONFIG_DRM_RADEON_USERPTR=y
|
||||
CONFIG_DRM_AMDGPU=m
|
||||
|
@ -761,6 +766,7 @@ CONFIG_DRM_LOONGSON=y
|
|||
CONFIG_FB=y
|
||||
CONFIG_FB_EFI=y
|
||||
CONFIG_FB_RADEON=y
|
||||
CONFIG_FIRMWARE_EDID=y
|
||||
CONFIG_LCD_CLASS_DEVICE=y
|
||||
CONFIG_LCD_PLATFORM=m
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
|
@ -843,6 +849,9 @@ CONFIG_TYPEC_TCPCI=m
|
|||
CONFIG_TYPEC_UCSI=m
|
||||
CONFIG_UCSI_ACPI=m
|
||||
CONFIG_INFINIBAND=m
|
||||
CONFIG_EDAC=y
|
||||
# CONFIG_EDAC_LEGACY_SYSFS is not set
|
||||
CONFIG_EDAC_LOONGSON=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_EFI=y
|
||||
CONFIG_RTC_DRV_LOONGSON=y
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#define L1_CACHE_SHIFT CONFIG_L1_CACHE_SHIFT
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#define ARCH_DMA_MINALIGN (16)
|
||||
|
||||
#define __read_mostly __section(".data..read_mostly")
|
||||
|
||||
#endif /* _ASM_CACHE_H */
|
||||
|
|
|
@ -53,7 +53,7 @@ void spurious_interrupt(void);
|
|||
#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
|
||||
void arch_trigger_cpumask_backtrace(const struct cpumask *mask, int exclude_cpu);
|
||||
|
||||
#define MAX_IO_PICS 2
|
||||
#define MAX_IO_PICS 8
|
||||
#define NR_IRQS (64 + NR_VECTORS * (NR_CPUS + MAX_IO_PICS))
|
||||
|
||||
struct acpi_vector_group {
|
||||
|
|
|
@ -68,6 +68,8 @@ static int __init fdt_cpu_clk_init(void)
|
|||
return -ENODEV;
|
||||
|
||||
clk = of_clk_get(np, 0);
|
||||
of_node_put(np);
|
||||
|
||||
if (IS_ERR(clk))
|
||||
return -ENODEV;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/hw_breakpoint.h>
|
||||
#include <linux/kdebug.h>
|
||||
#include <linux/kgdb.h>
|
||||
#include <linux/objtool.h>
|
||||
#include <linux/processor.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/sched.h>
|
||||
|
@ -224,13 +225,13 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc)
|
|||
regs->csr_era = pc;
|
||||
}
|
||||
|
||||
void arch_kgdb_breakpoint(void)
|
||||
noinline void arch_kgdb_breakpoint(void)
|
||||
{
|
||||
__asm__ __volatile__ ( \
|
||||
".globl kgdb_breakinst\n\t" \
|
||||
"nop\n" \
|
||||
"kgdb_breakinst:\tbreak 2\n\t"); /* BRK_KDB = 2 */
|
||||
}
|
||||
STACK_FRAME_NON_STANDARD(arch_kgdb_breakpoint);
|
||||
|
||||
/*
|
||||
* Calls linux_debug_hook before the kernel dies. If KGDB is enabled,
|
||||
|
|
|
@ -142,6 +142,8 @@ static void build_prologue(struct jit_ctx *ctx)
|
|||
*/
|
||||
if (seen_tail_call(ctx) && seen_call(ctx))
|
||||
move_reg(ctx, TCC_SAVED, REG_TCC);
|
||||
else
|
||||
emit_insn(ctx, nop);
|
||||
|
||||
ctx->stack_size = stack_adjust;
|
||||
}
|
||||
|
@ -905,7 +907,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
|
||||
move_addr(ctx, t1, func_addr);
|
||||
emit_insn(ctx, jirl, LOONGARCH_GPR_RA, t1, 0);
|
||||
move_reg(ctx, regmap[BPF_REG_0], LOONGARCH_GPR_A0);
|
||||
|
||||
if (insn->src_reg != BPF_PSEUDO_CALL)
|
||||
move_reg(ctx, regmap[BPF_REG_0], LOONGARCH_GPR_A0);
|
||||
|
||||
break;
|
||||
|
||||
/* tail call */
|
||||
|
@ -930,7 +935,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
|
|||
{
|
||||
const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;
|
||||
|
||||
move_imm(ctx, dst, imm64, is32);
|
||||
if (bpf_pseudo_func(insn))
|
||||
move_addr(ctx, dst, imm64);
|
||||
else
|
||||
move_imm(ctx, dst, imm64, is32);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,11 @@ struct jit_data {
|
|||
struct jit_ctx ctx;
|
||||
};
|
||||
|
||||
static inline void emit_nop(union loongarch_instruction *insn)
|
||||
{
|
||||
insn->word = INSN_NOP;
|
||||
}
|
||||
|
||||
#define emit_insn(ctx, func, ...) \
|
||||
do { \
|
||||
if (ctx->image != NULL) { \
|
||||
|
|
|
@ -36,8 +36,7 @@ endif
|
|||
|
||||
# VDSO linker flags.
|
||||
ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
|
||||
$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
|
||||
--hash-style=sysv --build-id -T
|
||||
$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared --build-id -T
|
||||
|
||||
#
|
||||
# Shared build commands.
|
||||
|
|
|
@ -58,9 +58,7 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
|
|||
#define copy0 t5
|
||||
#define copy1 t6
|
||||
#define copy2 t7
|
||||
|
||||
/* Reuse i as copy3 */
|
||||
#define copy3 i
|
||||
#define copy3 t8
|
||||
|
||||
/* Packs to be used with OP_4REG */
|
||||
#define line0 state0, state1, state2, state3
|
||||
|
@ -99,6 +97,7 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
|
|||
li.w copy0, 0x61707865
|
||||
li.w copy1, 0x3320646e
|
||||
li.w copy2, 0x79622d32
|
||||
li.w copy3, 0x6b206574
|
||||
|
||||
ld.w cnt_lo, counter, 0
|
||||
ld.w cnt_hi, counter, 4
|
||||
|
@ -108,7 +107,7 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
|
|||
move state0, copy0
|
||||
move state1, copy1
|
||||
move state2, copy2
|
||||
li.w state3, 0x6b206574
|
||||
move state3, copy3
|
||||
|
||||
/* state[4,5,..,11] = key */
|
||||
ld.w state4, key, 0
|
||||
|
@ -167,12 +166,6 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack)
|
|||
addi.w i, i, -1
|
||||
bnez i, .Lpermute
|
||||
|
||||
/*
|
||||
* copy[3] = "expa", materialize it here because copy[3] shares the
|
||||
* same register with i which just became dead.
|
||||
*/
|
||||
li.w copy3, 0x6b206574
|
||||
|
||||
/* output[0,1,2,3] = copy[0,1,2,3] + state[0,1,2,3] */
|
||||
OP_4REG add.w line0, copy
|
||||
st.w state0, output, 0
|
||||
|
|
|
@ -260,7 +260,8 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
|
|||
-mfunction-return=thunk-extern -mrecord-mcount -mabi=lp64 \
|
||||
-mindirect-branch-cs-prefix -mstack-protector-guard% -mtraceback=no \
|
||||
-mno-pointers-to-nested-functions -mno-string \
|
||||
-mno-strict-align -mstrict-align \
|
||||
-mno-strict-align -mstrict-align -mdirect-extern-access \
|
||||
-mexplicit-relocs -mno-check-zero-division \
|
||||
-fconserve-stack -falign-jumps=% -falign-loops=% \
|
||||
-femit-struct-debug-baseonly -fno-ipa-cp-clone -fno-ipa-sra \
|
||||
-fno-partial-inlining -fplugin-arg-arm_ssp_per_task_plugin-% \
|
||||
|
@ -274,6 +275,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
|
|||
# Derived from `scripts/Makefile.clang`.
|
||||
BINDGEN_TARGET_x86 := x86_64-linux-gnu
|
||||
BINDGEN_TARGET_arm64 := aarch64-linux-gnu
|
||||
BINDGEN_TARGET_loongarch := loongarch64-linux-gnusf
|
||||
BINDGEN_TARGET_um := $(BINDGEN_TARGET_$(SUBARCH))
|
||||
BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue