Unverified Commit f5d87f40 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15279 [OLK-5.10]:update patches for sw64 architecture

Merge Pull Request from: @guzitao 
 
These patches generally cover the following tasks:

1.optimize kernel cores, remove unused codes, fix compile errors
2.fixes for perf, iommu, kvm, cpufreq, stack trace, ftrace, acpi, selftest, numa, kexec, bpf, kprobe
3.reorganize code structure
4.add C4 support
5.optimize pt_regs structure 
 
Link:https://gitee.com/openeuler/kernel/pulls/15279

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarLi Nan <linan122@huawei.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parents 2fb29dd6 b606868a
Loading
Loading
Loading
Loading

arch/sw_64/Kbuild

0 → 100644
+7 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-y			+= kernel/ mm/ platform/
obj-$(CONFIG_NET)	+= net/
obj-$(CONFIG_KVM)	+= kvm/
obj-$(CONFIG_MATHEMU)	+= math-emu/

obj-$(CONFIG_BUILTIN_DTB)	+= boot/dts/
+46 −78
Original line number Diff line number Diff line
@@ -105,9 +105,14 @@ config SW64
	select NO_BOOTMEM
	select OF_EARLY_FLATTREE if OF
	select OLD_SIGSUSPEND
	select PCI_MSI_ARCH_FALLBACKS
	select PCI_MSI_ARCH_FALLBACKS if PCI_MSI
	select PCI_SW64 if PCI
	select SET_FS
	select SPARSEMEM_EXTREME if SPARSEMEM
	select SW64_IRQ_CPU
	select SW64_IRQ_MSI if PCI_MSI
	select SW64_IRQ_MSI_VT if PCI_MSI
	select SW64_TIMER
	select SWIOTLB
	select THREAD_INFO_IN_TASK

@@ -128,13 +133,6 @@ config PGTABLE_LEVELS
config SYS_SUPPORTS_HUGETLBFS
	def_bool y

config RWSEM_GENERIC_SPINLOCK
	bool

config RWSEM_XCHGADD_ALGORITHM
	bool
	default y

config ARCH_ENABLE_MEMORY_HOTPLUG
	bool
	default y
@@ -187,6 +185,9 @@ config AUDIT_ARCH
config SYS_HAS_EARLY_PRINTK
	bool

config HAVE_CSRRW
	bool

menu "System setup"

menu "Machine Configuration"
@@ -197,63 +198,48 @@ choice
config SUBARCH_C3B
	bool "C3B"

config SUBARCH_C4
	bool "C4"
	select HAVE_CSRRW
	select GENERIC_SCHED_CLOCK
endchoice

choice
	prompt "Chipset Family"
	prompt "Uncore Configuration"

config SW64_CHIP3
	bool "Chip3"
config UNCORE_XUELANG
	bool "Uncore for C3B"
	depends on SUBARCH_C3B
endchoice

choice
	prompt "Runtime System"
	depends on SW64_CHIP3
	default SW64_ASIC

config SW64_FPGA
	bool "FPGA"
	help
	  Support for chip3 FPGA.

config SW64_SIM
	bool "Hardware Simulator"
	help
	  Support for chip3 hardware simulator.
	  Sunway cpu uncore for C3B

config SW64_ASIC
	bool "ASIC"
config UNCORE_JUNZHANG
	bool "Uncore for C4"
	depends on SUBARCH_C4
	help
	  Support for chip3 asic.

	  Sunway cpu uncore for C4
endchoice

config SW64_CHIP3_ASIC_DEBUG
	bool "Debug Support for Chip3 Asic"
	depends on SW64_ASIC
	help
	  Used for debug

config CPUFREQ_DEBUGFS
	bool "CPU Frequency debugfs interface for Chip3 Asic"
	depends on SW64_CHIP3 && DEBUG_FS
	help
	  Turns on the DebugFS interface for CPU Frequency.

	  If you don't know what to do here, say N.

choice
	prompt "Platform Type"

config PLATFORM_XUELANG
	bool "Xuelang"
	depends on SW64_CHIP3
	depends on UNCORE_XUELANG
	select SPARSE_IRQ
	select SYS_HAS_EARLY_PRINTK
	select SW64_INTC_V2
	select I2C_SUNWAY if I2C
	help
	  Sunway chip3 board chipset
	  Sunway board chipset for C3B

config PLATFORM_JUNZHANG
	bool "JunZhang"
	depends on UNCORE_JUNZHANG
	select SPARSE_IRQ
	select SYS_HAS_EARLY_PRINTK
	help
	  Sunway board chipset for C4

endchoice

@@ -264,10 +250,7 @@ config MIGHT_HAVE_PC_SERIO

endmenu

config LOCK_MEMB
	bool "Insert mem barrier before lock instruction"
	default y

menu "CPU Power Management"
source "drivers/cpufreq/Kconfig"

config SW64_CPUAUTOPLUG
@@ -277,6 +260,7 @@ config SW64_CPUAUTOPLUG
	help
	  Turns on the interface for SW64_CPU CPUAUTOPLUG.

endmenu
# clear all implied options (don't want default values for those):
# Most of these machines have ISA slots; not exactly sure which don't,
# and this doesn't activate hordes of code, so do it always.
@@ -361,13 +345,6 @@ config GENERIC_HWEIGHT
	bool
	default y

config LOCK_FIXUP
	bool "fix up the lock"
	depends on SW64
	help
	  Add an instruction("memb\n") to ensure the correctness of the lock.


config SMP
	bool "Symmetric multi-processing support"
	depends on SW64
@@ -402,11 +379,19 @@ config TRACE_IRQFLAGS_SUPPORT
config ARCH_SUPPORTS_UPROBES
	def_bool y

config SCHED_SMT
	bool "SMT scheduler support"
	depends on SMP && SUBARCH_C4
	help
	  Improves the CPU scheduler's decision making when dealing with
	  MultiThreading at a cost of slightly increased overhead in some
	  places. If unsure say N here.

config NR_CPUS
	int "Maximum number of CPUs (2-256)"
	range 2 256
	depends on SMP
	default "64" if SW64_CHIP3
	default "64" if UNCORE_XUELANG
	help
	  SW6 support can handle a maximum of 256 CPUs.

@@ -519,16 +504,16 @@ config USE_OF
	help
	  Include support for flattened device tree machine descriptions.

config SW64_BUILTIN_DTB
config BUILTIN_DTB
	bool "Embed DTB in kernel image"
	depends on OF
	default n
	help
	  Embeds a device tree binary in the kernel image.

config SW64_BUILTIN_DTB_NAME
config BUILTIN_DTB_NAME
	string "Built in DTB"
	depends on SW64_BUILTIN_DTB
	depends on BUILTIN_DTB
	help
	  Set the name of the DTB to embed, leave blank to pick one
	  automatically based on kernel configuration.
@@ -642,23 +627,6 @@ config ARCH_HIBERNATION_POSSIBLE
	depends on SW64
	def_bool y

config SW64_SUSPEND_DEEPSLEEP_NONBOOT_CORE
	depends on SUSPEND
	bool "SW64 non bootcore suspend into deep sleep mode"
	default n

config SW64_SUSPEND_DEEPSLEEP_BOOTCORE
	depends on SUSPEND
	bool "SW64 bootcore suspend into deep sleep mode"
	default n

config SW64_SUPPORT_S3_SLEEPING_STATE
	depends on SUSPEND
	bool "SW64 support S3 sleeping state"
	default n
	help
	  Only SW831 support S3 sleep option and needs SROM, HMCode and BIOS support.

source "drivers/cpuidle/Kconfig"

source "drivers/idle/Kconfig"
+7 −0
Original line number Diff line number Diff line
@@ -44,3 +44,10 @@ config SW64_RRK
	help
	  Duplicate kernel log to specific space.
	  Do not enable it in a production kernel.

config DEBUG_MATCH
	bool "instruction-flow and data-flow match debugfs interface"
	depends on DEBUG_FS
	default n
	help
	  Turns on the DebugFS interface for instruction-flow and data-flow match.
+6 −8
Original line number Diff line number Diff line
@@ -26,24 +26,22 @@ endif

CHECKFLAGS	+= -D__sw__
cflags-y	:= -pipe -ffixed-8 -mno-fp-regs #-msmall-data
ifeq ($(CONFIG_SUBARCH_C4),y)
	cflags-y += -fsw-rev
endif
cflags-y	+= $(call cc-option, -fno-jump-tables)

cflags-y				+= $(cpuflags-y)

KBUILD_CFLAGS += $(cflags-y)
KBUILD_DEFCONFIG = defconfig
KBUILD_DEFCONFIG = openeuler_defconfig

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

core-y				+= arch/sw_64/kernel/ arch/sw_64/mm/
core-y				+= arch/sw_64/platform/
core-y				+= arch/sw_64/chip/
core-$(CONFIG_MATHEMU)		+= arch/sw_64/math-emu/
core-y				+= arch/sw_64/
drivers-$(CONFIG_OPROFILE)	+= arch/sw_64/oprofile/
drivers-$(CONFIG_PCI)           += arch/sw_64/pci/
libs-y				+= arch/sw_64/lib/
core-$(CONFIG_KVM)		+= arch/sw_64/kvm/
core-$(CONFIG_SW64_BUILTIN_DTB)	+= arch/sw_64/boot/dts/
core-$(CONFIG_NET)		+= arch/sw_64/net/

# export what is needed by arch/sw_64/boot/Makefile
LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
+9 −3
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
# Built-in dtb

ifeq ($(CONFIG_PLATFORM_XUELANG),y)
builtindtb-y            := chip3
endif

ifeq ($(CONFIG_PLATFORM_JUNZHANG),y)
builtindtb-y            := empty
endif

ifeq ($(CONFIG_SW64_BUILTIN_DTB), y)
ifneq ($(CONFIG_SW64_BUILTIN_DTB_NAME),"")
        builtindtb-y    := $(patsubst "%",%,$(CONFIG_SW64_BUILTIN_DTB_NAME))
ifeq ($(CONFIG_BUILTIN_DTB), y)
ifneq ($(CONFIG_BUILTIN_DTB_NAME),"")
        builtindtb-y    := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME))
endif

obj-y   += $(builtindtb-y).dtb.o
Loading