Commit 4ad0a4c2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc updates from Michael Ellerman:

 - Add HOTPLUG_SMT support (/sys/devices/system/cpu/smt) and honour the
   configured SMT state when hotplugging CPUs into the system

 - Combine final TLB flush and lazy TLB mm shootdown IPIs when using the
   Radix MMU to avoid a broadcast TLBIE flush on exit

 - Drop the exclusion between ptrace/perf watchpoints, and drop the now
   unused associated arch hooks

 - Add support for the "nohlt" command line option to disable CPU idle

 - Add support for -fpatchable-function-entry for ftrace, with GCC >=
   13.1

 - Rework memory block size determination, and support 256MB size on
   systems with GPUs that have hotpluggable memory

 - Various other small features and fixes

Thanks to Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Athira
Rajeev, Benjamin Gray, Christophe Leroy, Frederic Barrat, Gautam
Menghani, Geoff Levand, Hari Bathini, Immad Mir, Jialin Zhang, Joel
Stanley, Jordan Niethe, Justin Stitt, Kajol Jain, Kees Cook, Krzysztof
Kozlowski, Laurent Dufour, Liang He, Linus Walleij, Mahesh Salgaonkar,
Masahiro Yamada, Michal Suchanek, Nageswara R Sastry, Nathan Chancellor,
Nathan Lynch, Naveen N Rao, Nicholas Piggin, Nick Desaulniers, Omar
Sandoval, Randy Dunlap, Reza Arbab, Rob Herring, Russell Currey, Sourabh
Jain, Thomas Gleixner, Trevor Woerner, Uwe Kleine-König, Vaibhav Jain,
Xiongfeng Wang, Yuan Tan, Zhang Rui, and Zheng Zengkai.

* tag 'powerpc-6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (135 commits)
  macintosh/ams: linux/platform_device.h is needed
  powerpc/xmon: Reapply "Relax frame size for clang"
  powerpc/mm/book3s64: Use 256M as the upper limit with coherent device memory attached
  powerpc/mm/book3s64: Fix build error with SPARSEMEM disabled
  powerpc/iommu: Fix notifiers being shared by PCI and VIO buses
  powerpc/mpc5xxx: Add missing fwnode_handle_put()
  powerpc/config: Disable SLAB_DEBUG_ON in skiroot
  powerpc/pseries: Remove unused hcall tracing instruction
  powerpc/pseries: Fix hcall tracepoints with JUMP_LABEL=n
  powerpc: dts: add missing space before {
  powerpc/eeh: Use pci_dev_id() to simplify the code
  powerpc/64s: Move CPU -mtune options into Kconfig
  powerpc/powermac: Fix unused function warning
  powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT
  powerpc: Don't include lppaca.h in paca.h
  powerpc/pseries: Move hcall_vphn() prototype into vphn.h
  powerpc/pseries: Move VPHN constants into vphn.h
  cxl: Drop unused detach_spa()
  powerpc: Drop zalloc_maybe_bootmem()
  powerpc/powernv: Use struct opal_prd_msg in more places
  ...
parents df57721f 85a61641
Loading
Loading
Loading
Loading
+160 −0
Original line number Diff line number Diff line
@@ -80,3 +80,163 @@ Contact: Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	read only
		This sysfs file exposes the cpumask which is designated to make
		HCALLs to retrieve hv-gpci pmu event counter data.

What:		/sys/devices/hv_gpci/interface/processor_bus_topology
Date:		July 2023
Contact:	Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	admin read only
		This sysfs file exposes the system topology information by making HCALL
		H_GET_PERF_COUNTER_INFO. The HCALL is made with counter request value
		PROCESSOR_BUS_TOPOLOGY(0xD0).

		* This sysfs file will be created only for power10 and above platforms.

		* User needs root privileges to read data from this sysfs file.

		* This sysfs file will be created, only when the HCALL returns "H_SUCCESS",
		  "H_AUTHORITY" or "H_PARAMETER" as the return type.

		  HCALL with return error type "H_AUTHORITY" can be resolved during
		  runtime by setting "Enable Performance Information Collection" option.

		* The end user reading this sysfs file must decode the content as per
		  underlying platform/firmware.

		Possible error codes while reading this sysfs file:

		* "-EPERM" : Partition is not permitted to retrieve performance information,
			    required to set "Enable Performance Information Collection" option.

		* "-EIO" : Can't retrieve system information because of invalid buffer length/invalid address
			   or because of some hardware error. Refer to getPerfCountInfo documentation for
			   more information.

		* "-EFBIG" : System information exceeds PAGE_SIZE.

What:		/sys/devices/hv_gpci/interface/processor_config
Date:		July 2023
Contact:	Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	admin read only
		This sysfs file exposes the system topology information by making HCALL
		H_GET_PERF_COUNTER_INFO. The HCALL is made with counter request value
		PROCESSOR_CONFIG(0x90).

		* This sysfs file will be created only for power10 and above platforms.

		* User needs root privileges to read data from this sysfs file.

		* This sysfs file will be created, only when the HCALL returns "H_SUCCESS",
		  "H_AUTHORITY" or "H_PARAMETER" as the return type.

		  HCALL with return error type "H_AUTHORITY" can be resolved during
		  runtime by setting "Enable Performance Information Collection" option.

		* The end user reading this sysfs file must decode the content as per
		  underlying platform/firmware.

		Possible error codes while reading this sysfs file:

		* "-EPERM" : Partition is not permitted to retrieve performance information,
			    required to set "Enable Performance Information Collection" option.

		* "-EIO" : Can't retrieve system information because of invalid buffer length/invalid address
			   or because of some hardware error. Refer to getPerfCountInfo documentation for
			   more information.

		* "-EFBIG" : System information exceeds PAGE_SIZE.

What:		/sys/devices/hv_gpci/interface/affinity_domain_via_virtual_processor
Date:		July 2023
Contact:	Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	admin read only
		This sysfs file exposes the system topology information by making HCALL
		H_GET_PERF_COUNTER_INFO. The HCALL is made with counter request value
		AFFINITY_DOMAIN_INFORMATION_BY_VIRTUAL_PROCESSOR(0xA0).

		* This sysfs file will be created only for power10 and above platforms.

		* User needs root privileges to read data from this sysfs file.

		* This sysfs file will be created, only when the HCALL returns "H_SUCCESS",
		  "H_AUTHORITY" or "H_PARAMETER" as the return type.

		  HCALL with return error type "H_AUTHORITY" can be resolved during
		  runtime by setting "Enable Performance Information Collection" option.

		* The end user reading this sysfs file must decode the content as per
		  underlying platform/firmware.

		Possible error codes while reading this sysfs file:

		* "-EPERM" : Partition is not permitted to retrieve performance information,
			    required to set "Enable Performance Information Collection" option.

		* "-EIO" : Can't retrieve system information because of invalid buffer length/invalid address
			   or because of some hardware error. Refer to getPerfCountInfo documentation for
			   more information.

		* "-EFBIG" : System information exceeds PAGE_SIZE.

What:		/sys/devices/hv_gpci/interface/affinity_domain_via_domain
Date:		July 2023
Contact:	Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	admin read only
		This sysfs file exposes the system topology information by making HCALL
		H_GET_PERF_COUNTER_INFO. The HCALL is made with counter request value
		AFFINITY_DOMAIN_INFORMATION_BY_DOMAIN(0xB0).

		* This sysfs file will be created only for power10 and above platforms.

		* User needs root privileges to read data from this sysfs file.

		* This sysfs file will be created, only when the HCALL returns "H_SUCCESS",
		  "H_AUTHORITY" or "H_PARAMETER" as the return type.

		  HCALL with return error type "H_AUTHORITY" can be resolved during
		  runtime by setting "Enable Performance Information Collection" option.

		* The end user reading this sysfs file must decode the content as per
		  underlying platform/firmware.

		Possible error codes while reading this sysfs file:

		* "-EPERM" : Partition is not permitted to retrieve performance information,
			    required to set "Enable Performance Information Collection" option.

		* "-EIO" : Can't retrieve system information because of invalid buffer length/invalid address
			   or because of some hardware error. Refer to getPerfCountInfo documentation for
			   more information.

		* "-EFBIG" : System information exceeds PAGE_SIZE.

What:		/sys/devices/hv_gpci/interface/affinity_domain_via_partition
Date:		July 2023
Contact:	Linux on PowerPC Developer List <linuxppc-dev@lists.ozlabs.org>
Description:	admin read only
		This sysfs file exposes the system topology information by making HCALL
		H_GET_PERF_COUNTER_INFO. The HCALL is made with counter request value
		AFFINITY_DOMAIN_INFORMATION_BY_PARTITION(0xB1).

		* This sysfs file will be created only for power10 and above platforms.

		* User needs root privileges to read data from this sysfs file.

		* This sysfs file will be created, only when the HCALL returns "H_SUCCESS",
		  "H_AUTHORITY" or "H_PARAMETER" as the return type.

		  HCALL with return error type "H_AUTHORITY" can be resolved during
		  runtime by setting "Enable Performance Information Collection" option.

		* The end user reading this sysfs file must decode the content as per
		  underlying platform/firmware.

		Possible error codes while reading this sysfs file:

		* "-EPERM" : Partition is not permitted to retrieve performance information,
			    required to set "Enable Performance Information Collection" option.

		* "-EIO" : Can't retrieve system information because of invalid buffer length/invalid address
			   or because of some hardware error. Refer to getPerfCountInfo documentation for
			   more information.

		* "-EFBIG" : System information exceeds PAGE_SIZE.
+3 −3
Original line number Diff line number Diff line
@@ -3753,7 +3753,7 @@

	nohibernate	[HIBERNATION] Disable hibernation and resume.

	nohlt		[ARM,ARM64,MICROBLAZE,MIPS,SH] Forces the kernel to
	nohlt		[ARM,ARM64,MICROBLAZE,MIPS,PPC,SH] Forces the kernel to
			busy wait in do_idle() and not use the arch_cpu_idle()
			implementation; requires CONFIG_GENERIC_IDLE_POLL_SETUP
			to be effective. This is useful on platforms where the
@@ -3889,10 +3889,10 @@
	nosmp		[SMP] Tells an SMP kernel to act as a UP kernel,
			and disable the IO APIC.  legacy for "maxcpus=0".

	nosmt		[KNL,MIPS,S390] Disable symmetric multithreading (SMT).
	nosmt		[KNL,MIPS,PPC,S390] Disable symmetric multithreading (SMT).
			Equivalent to smt=1.

			[KNL,X86] Disable symmetric multithreading (SMT).
			[KNL,X86,PPC] Disable symmetric multithreading (SMT).
			nosmt=force: Force disable SMT, cannot be undone
				     via the sysfs control file.

+4 −4
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ that's extendable and that covers both BookE and server processors, so
that GDB doesn't need to special-case each of them. We added the
following 3 new ptrace requests.

1. PTRACE_PPC_GETHWDEBUGINFO
1. PPC_PTRACE_GETHWDBGINFO
============================

Query for GDB to discover the hardware debug features. The main info to
@@ -48,7 +48,7 @@ features will have bits indicating whether there is support for::
  #define PPC_DEBUG_FEATURE_DATA_BP_DAWR		0x10
  #define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31		0x20

2. PTRACE_SETHWDEBUG
2. PPC_PTRACE_SETHWDEBUG

Sets a hardware breakpoint or watchpoint, according to the provided structure::

@@ -88,7 +88,7 @@ that the BookE supports. COMEFROM breakpoints available in server processors
are not contemplated, but that is out of the scope of this work.

ptrace will return an integer (handle) uniquely identifying the breakpoint or
watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG
watchpoint just created. This integer will be used in the PPC_PTRACE_DELHWDEBUG
request to ask for its removal. Return -ENOSPC if the requested breakpoint
can't be allocated on the registers.

@@ -150,7 +150,7 @@ Some examples of using the structure to:
    p.addr2           = (uint64_t) end_range;
    p.condition_value = 0;

3. PTRACE_DELHWDEBUG
3. PPC_PTRACE_DELHWDEBUG

Takes an integer which identifies an existing breakpoint or watchpoint
(i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the
+14 −9
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ config PPC
	select DYNAMIC_FTRACE			if FUNCTION_TRACER
	select EDAC_ATOMIC_SCRUB
	select EDAC_SUPPORT
	select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if ARCH_USING_PATCHABLE_FUNCTION_ENTRY
	select GENERIC_ATOMIC64			if PPC32
	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP
	select GENERIC_CMOS_UPDATE
@@ -195,6 +196,7 @@ config PPC
	select GENERIC_CPU_VULNERABILITIES	if PPC_BARRIER_NOSPEC
	select GENERIC_EARLY_IOREMAP
	select GENERIC_GETTIMEOFDAY
	select GENERIC_IDLE_POLL_SETUP
	select GENERIC_IOREMAP
	select GENERIC_IRQ_SHOW
	select GENERIC_IRQ_SHOW_LEVEL
@@ -229,8 +231,8 @@ config PPC
	select HAVE_DEBUG_KMEMLEAK
	select HAVE_DEBUG_STACKOVERFLOW
	select HAVE_DYNAMIC_FTRACE
	select HAVE_DYNAMIC_FTRACE_WITH_ARGS	if MPROFILE_KERNEL || PPC32
	select HAVE_DYNAMIC_FTRACE_WITH_REGS	if MPROFILE_KERNEL || PPC32
	select HAVE_DYNAMIC_FTRACE_WITH_ARGS	if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
	select HAVE_DYNAMIC_FTRACE_WITH_REGS	if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
	select HAVE_EBPF_JIT
	select HAVE_EFFICIENT_UNALIGNED_ACCESS
	select HAVE_FAST_GUP
@@ -258,7 +260,7 @@ config PPC
	select HAVE_MOD_ARCH_SPECIFIC
	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
	select HAVE_OPTPROBES
	select HAVE_OBJTOOL			if PPC32 || MPROFILE_KERNEL
	select HAVE_OBJTOOL			if ARCH_USING_PATCHABLE_FUNCTION_ENTRY || MPROFILE_KERNEL || PPC32
	select HAVE_OBJTOOL_MCOUNT		if HAVE_OBJTOOL
	select HAVE_PERF_EVENTS
	select HAVE_PERF_EVENTS_NMI		if PPC64
@@ -275,6 +277,8 @@ config PPC
	select HAVE_SYSCALL_TRACEPOINTS
	select HAVE_VIRT_CPU_ACCOUNTING
	select HAVE_VIRT_CPU_ACCOUNTING_GEN
	select HOTPLUG_SMT			if HOTPLUG_CPU
	select SMT_NUM_THREADS_DYNAMIC
	select HUGETLB_PAGE_SIZE_VARIABLE	if PPC_BOOK3S_64 && HUGETLB_PAGE
	select IOMMU_HELPER			if PPC64
	select IRQ_DOMAIN
@@ -554,6 +558,13 @@ config MPROFILE_KERNEL
	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mlittle-endian) if CPU_LITTLE_ENDIAN
	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -mbig-endian) if CPU_BIG_ENDIAN

config ARCH_USING_PATCHABLE_FUNCTION_ENTRY
	depends on FUNCTION_TRACER && (PPC32 || PPC64_ELF_ABI_V2)
	depends on $(cc-option,-fpatchable-function-entry=2)
	def_bool y if PPC32
	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mlittle-endian) if PPC64 && CPU_LITTLE_ENDIAN
	def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh $(CC) -mbig-endian) if PPC64 && CPU_BIG_ENDIAN

config HOTPLUG_CPU
	bool "Support for enabling/disabling CPUs"
	depends on SMP && (PPC_PSERIES || \
@@ -1126,12 +1137,6 @@ config FSL_GTM
	help
	  Freescale General-purpose Timers support

config PCI_8260
	bool
	depends on PCI && 8260
	select PPC_INDIRECT_PCI
	default y

config FSL_RIO
	bool "Freescale Embedded SRIO Controller support"
	depends on RAPIDIO = y && HAVE_RAPIDIO
+6 −3
Original line number Diff line number Diff line
@@ -143,18 +143,21 @@ CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD))
CFLAGS-$(CONFIG_PPC32)	+= $(call cc-option,-mno-readonly-in-sdata)

ifdef CONFIG_FUNCTION_TRACER
ifdef CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY
KBUILD_CPPFLAGS	+= -DCC_USING_PATCHABLE_FUNCTION_ENTRY
CC_FLAGS_FTRACE := -fpatchable-function-entry=2
else
CC_FLAGS_FTRACE := -pg
ifdef CONFIG_MPROFILE_KERNEL
CC_FLAGS_FTRACE += -mprofile-kernel
endif
endif
endif

CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)
AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)

CFLAGS-$(CONFIG_POWERPC64_CPU) += $(call cc-option,-mtune=power10,	\
				  $(call cc-option,-mtune=power9,	\
				  $(call cc-option,-mtune=power8)))
CFLAGS-y += $(CONFIG_TUNE_CPU)

asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)

Loading