Commit 744465da authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull Xtensa updates from Max Filippov:

 - remove dependency on the compiler's libgcc

 - allow selection of internal kernel ABI via Kconfig

 - enable compiler plugins support for gcc-12 or newer

 - various minor cleanups and fixes

* tag 'xtensa-20220325' of https://github.com/jcmvbkbc/linux-xtensa:
  xtensa: define update_mmu_tlb function
  xtensa: fix xtensa_wsr always writing 0
  xtensa: enable plugin support
  xtensa: clean up kernel exit assembly code
  xtensa: rearrange NMI exit path
  xtensa: merge stack alignment definitions
  xtensa: fix DTC warning unit_address_format
  xtensa: fix stop_machine_cpuslocked call in patch_text
  xtensa: make secondary reset vector support conditional
  xtensa: add kernel ABI selection to Kconfig
  xtensa: don't link with libgcc
  xtensa: add helpers for division, remainder and shifts
  xtensa: add missing XCHAL_HAVE_WINDOWED check
  xtensa: use XCHAL_NUM_AREGS as pt_regs::areg size
  xtensa: rename PT_SIZE to PT_KERNEL_SIZE
  xtensa: Remove unused early_read_config_byte() et al declarations
  xtensa: use strscpy to copy strings
  net: xtensa: use strscpy to copy strings
parents 1f1c153e 1c4664fa
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ config XTENSA
	select DMA_REMAP if MMU
	select GENERIC_ATOMIC64
	select GENERIC_IRQ_SHOW
	select GENERIC_LIB_CMPDI2
	select GENERIC_LIB_MULDI3
	select GENERIC_LIB_UCMPDI2
	select GENERIC_PCI_IOMAP
	select GENERIC_SCHED_CLOCK
	select HAVE_ARCH_AUDITSYSCALL
@@ -32,6 +35,7 @@ config XTENSA
	select HAVE_DMA_CONTIGUOUS
	select HAVE_EXIT_THREAD
	select HAVE_FUNCTION_TRACER
	select HAVE_GCC_PLUGINS if GCC_VERSION >= 120000
	select HAVE_HW_BREAKPOINT if PERF_EVENTS
	select HAVE_IRQ_TIME_ACCOUNTING
	select HAVE_PCI
@@ -89,6 +93,9 @@ config CPU_BIG_ENDIAN
config CPU_LITTLE_ENDIAN
	def_bool !CPU_BIG_ENDIAN

config CC_HAVE_CALL0_ABI
	def_bool $(success,test "$(shell,echo __XTENSA_CALL0_ABI__ | $(CC) -mabi=call0 -E -P - 2>/dev/null)" = 1)

menu "Processor type and features"

choice
@@ -221,6 +228,15 @@ config HOTPLUG_CPU

	  Say N if you want to disable CPU hotplug.

config SECONDARY_RESET_VECTOR
	bool "Secondary cores use alternative reset vector"
	default y
	depends on HAVE_SMP
	help
	  Secondary cores may be configured to use alternative reset vector,
	  or all cores may use primary reset vector.
	  Say Y here to supply handler for the alternative reset location.

config FAST_SYSCALL_XTENSA
	bool "Enable fast atomic syscalls"
	default n
@@ -247,6 +263,38 @@ config FAST_SYSCALL_SPILL_REGISTERS

	  If unsure, say N.

choice
	prompt "Kernel ABI"
	default KERNEL_ABI_DEFAULT
	help
	  Select ABI for the kernel code. This ABI is independent of the
	  supported userspace ABI and any combination of the
	  kernel/userspace ABI is possible and should work.

	  In case both kernel and userspace support only call0 ABI
	  all register windows support code will be omitted from the
	  build.

	  If unsure, choose the default ABI.

config KERNEL_ABI_DEFAULT
	bool "Default ABI"
	help
	  Select this option to compile kernel code with the default ABI
	  selected for the toolchain.
	  Normally cores with windowed registers option use windowed ABI and
	  cores without it use call0 ABI.

config KERNEL_ABI_CALL0
	bool "Call0 ABI" if CC_HAVE_CALL0_ABI
	help
	  Select this option to compile kernel code with call0 ABI even with
	  toolchain that defaults to windowed ABI.
	  When this option is not selected the default toolchain ABI will
	  be used for the kernel code.

endchoice

config USER_ABI_CALL0
	bool

+5 −5
Original line number Diff line number Diff line
@@ -35,6 +35,10 @@ KBUILD_CFLAGS += -ffreestanding -D__linux__
KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
ifneq ($(CONFIG_KERNEL_ABI_CALL0),)
KBUILD_CFLAGS += -mabi=call0
KBUILD_AFLAGS += -mabi=call0
endif

KBUILD_AFLAGS += -mlongcalls -mtext-section-literals

@@ -51,13 +55,9 @@ KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))

KBUILD_DEFCONFIG := iss_defconfig

# Find libgcc.a

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

head-y		:= arch/xtensa/kernel/head.o

libs-y		+= arch/xtensa/lib/ $(LIBGCC)
libs-y		+= arch/xtensa/lib/

boot		:= arch/xtensa/boot

+4 −4
Original line number Diff line number Diff line
@@ -8,19 +8,19 @@
			reg = <0x00000000 0x08000000>;
			bank-width = <2>;
			device-width = <2>;
			partition@0x0 {
			partition@0 {
				label = "data";
				reg = <0x00000000 0x06000000>;
			};
			partition@0x6000000 {
			partition@6000000 {
				label = "boot loader area";
				reg = <0x06000000 0x00800000>;
			};
			partition@0x6800000 {
			partition@6800000 {
				label = "kernel image";
				reg = <0x06800000 0x017e0000>;
			};
			partition@0x7fe0000 {
			partition@7fe0000 {
				label = "boot environment";
				reg = <0x07fe0000 0x00020000>;
			};
+4 −4
Original line number Diff line number Diff line
@@ -8,19 +8,19 @@
			reg = <0x08000000 0x01000000>;
			bank-width = <2>;
			device-width = <2>;
			partition@0x0 {
			partition@0 {
				label = "boot loader area";
				reg = <0x00000000 0x00400000>;
			};
			partition@0x400000 {
			partition@400000 {
				label = "kernel image";
				reg = <0x00400000 0x00600000>;
			};
			partition@0xa00000 {
			partition@a00000 {
				label = "data";
				reg = <0x00a00000 0x005e0000>;
			};
			partition@0xfe0000 {
			partition@fe0000 {
				label = "boot environment";
				reg = <0x00fe0000 0x00020000>;
			};
+2 −2
Original line number Diff line number Diff line
@@ -8,11 +8,11 @@
			reg = <0x08000000 0x00400000>;
			bank-width = <2>;
			device-width = <2>;
			partition@0x0 {
			partition@0 {
				label = "boot loader area";
				reg = <0x00000000 0x003f0000>;
			};
			partition@0x3f0000 {
			partition@3f0000 {
				label = "boot environment";
				reg = <0x003f0000 0x00010000>;
			};
Loading