Commit 8d8026f3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa

Pull xtensa updates from Max Filippov:

 - clean up platform_* interface of the xtensa architecture

 - enable HAVE_ASM_MODVERSIONS

 - drop ARCH_WANT_FRAME_POINTERS

 - clean up unaligned access exception handler

 - provide handler for load/store exceptions

 - various small fixes and cleanups

* tag 'xtensa-20230627' of https://github.com/jcmvbkbc/linux-xtensa:
  xtensa: dump userspace code around the exception PC
  xtensa: rearrange show_stack output
  xtensa: add load/store exception handler
  xtensa: rearrange unaligned exception handler
  xtensa: always install slow handler for unaligned access exception
  xtensa: move early_trap_init from kasan_early_init to init_arch
  xtensa: drop ARCH_WANT_FRAME_POINTERS
  xtensa: report trax and perf counters in cpuinfo
  xtensa: add asm-prototypes.h
  xtensa: only build __strncpy_user with CONFIG_ARCH_HAS_STRNCPY_FROM_USER
  xtensa: drop bcopy implementation
  xtensa: drop EXPORT_SYMBOL for common_exception_return
  xtensa: boot-redboot: clean up Makefile
  xtensa: clean up default platform functions
  xtensa: drop platform_halt and platform_power_off
  xtensa: drop platform_restart
  xtensa: drop platform_heartbeat
  xtensa: xt2000: drop empty platform_init
parents 0ae61229 f7667ca1
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ config XTENSA
	select ARCH_USE_MEMTEST
	select ARCH_USE_QUEUED_RWLOCKS
	select ARCH_USE_QUEUED_SPINLOCKS
	select ARCH_WANT_FRAME_POINTERS
	select ARCH_WANT_IPC_PARSE_VERSION
	select BUILDTIME_TABLE_SORT
	select CLONE_BACKWARDS
@@ -35,6 +34,7 @@ config XTENSA
	select HAVE_ARCH_KCSAN
	select HAVE_ARCH_SECCOMP_FILTER
	select HAVE_ARCH_TRACEHOOK
	select HAVE_ASM_MODVERSIONS
	select HAVE_CONTEXT_TRACKING_USER
	select HAVE_DEBUG_KMEMLEAK
	select HAVE_DMA_CONTIGUOUS
@@ -203,6 +203,18 @@ config XTENSA_UNALIGNED_USER

	  Say Y here to enable unaligned memory access in user space.

config XTENSA_LOAD_STORE
	bool "Load/store exception handler for memory only readable with l32"
	help
	  The Xtensa architecture only allows reading memory attached to its
	  instruction bus with l32r and l32i instructions, all other
	  instructions raise an exception with the LoadStoreErrorCause code.
	  This makes it hard to use some configurations, e.g. store string
	  literals in FLASH memory attached to the instruction bus.

	  Say Y here to enable exception handler that allows transparent
	  byte and 2-byte access to memory attached to instruction bus.

config HAVE_SMP
	bool "System Supports SMP (MX)"
	depends on XTENSA_VARIANT_CUSTOM
+8 −0
Original line number Diff line number Diff line
@@ -38,3 +38,11 @@ config PRINT_STACK_DEPTH
	help
	  This option allows you to set the stack depth that the kernel
	  prints in stack traces.

config PRINT_USER_CODE_ON_UNHANDLED_EXCEPTION
	bool "Dump user code around unhandled exception address"
	help
	  Enable this option to display user code around PC of the unhandled
	  exception (starting at address aligned on 16 byte boundary).
	  This may simplify finding faulting code in the absence of other
	  debug facilities.
+4 −5
Original line number Diff line number Diff line
@@ -6,16 +6,12 @@

OBJCOPY_ARGS := -O $(if $(CONFIG_CPU_BIG_ENDIAN),elf32-xtensa-be,elf32-xtensa-le)

LD_ARGS	= -T $(srctree)/$(obj)/boot.ld

boot-y	:= bootstrap.o
targets	+= $(boot-y)

OBJS	:= $(addprefix $(obj)/,$(boot-y))
LIBS	:= arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a

LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)

$(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
	$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
		--add-section image=$< \
@@ -23,7 +19,10 @@ $(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
		$(OBJS) $@

$(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
	$(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
	$(Q)$(LD) $(KBUILD_LDFLAGS) \
		-T $(srctree)/$(obj)/boot.ld \
		--build-id=none \
		-o $@ $^

$(obj)/../zImage.redboot: $(obj)/zImage.elf
	$(Q)$(OBJCOPY) -S -O binary $< $@
+29 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_PROTOTYPES_H
#define __ASM_PROTOTYPES_H

#include <asm/cacheflush.h>
#include <asm/checksum.h>
#include <asm/ftrace.h>
#include <asm/page.h>
#include <asm/string.h>
#include <asm/uaccess.h>

#include <asm-generic/asm-prototypes.h>

/*
 * gcc internal math functions
 */
long long __ashrdi3(long long, int);
long long __ashldi3(long long, int);
long long __bswapdi2(long long);
int __bswapsi2(int);
long long __lshrdi3(long long, int);
int __divsi3(int, int);
int __modsi3(int, int);
int __mulsi3(int, int);
unsigned int __udivsi3(unsigned int, unsigned int);
unsigned int __umodsi3(unsigned int, unsigned int);
unsigned long long __umulsidi3(unsigned int, unsigned int);

#endif /* __ASM_PROTOTYPES_H */
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#ifndef _XTENSA_ASMMACRO_H
#define _XTENSA_ASMMACRO_H

#include <asm-generic/export.h>
#include <asm/core.h>

/*
Loading