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

 - Support for configuring secure boot with user-defined keys on PowerVM
   LPARs

 - Simplify the replay of soft-masked IRQs by making it non-recursive

 - Add support for KCSAN on 64-bit Book3S

 - Improvements to the API & code which interacts with RTAS (pseries
   firmware)

 - Change 32-bit powermac to assign PCI bus numbers per domain by
   default

 - Some improvements to the 32-bit BPF JIT

 - Various other small features and fixes

Thanks to Anders Roxell, Andrew Donnellan, Andrew Jeffery, Benjamin
Gray, Christophe Leroy, Frederic Barrat, Ganesh Goudar, Geoff Levand,
Greg Kroah-Hartman, Jan-Benedict Glaw, Josh Poimboeuf, Kajol Jain,
Laurent Dufour, Mahesh Salgaonkar, Mathieu Desnoyers, Mimi Zohar, Murphy
Zhou, Nathan Chancellor, Nathan Lynch, Nayna Jain, Nicholas Piggin, Pali
Rohár, Petr Mladek, Rohan McLure, Russell Currey, Sachin Sant, Sathvika
Vasireddy, Sourabh Jain, Stefan Berger, Stephen Rothwell, and Sudhakar
Kuppusamy.

* tag 'powerpc-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (114 commits)
  powerpc/pseries: Avoid hcall in plpks_is_available() on non-pseries
  powerpc: dts: turris1x.dts: Set lower priority for CPLD syscon-reboot
  powerpc/e500: Add missing prototype for 'relocate_init'
  powerpc/64: Fix unannotated intra-function call warning
  powerpc/epapr: Don't use wrteei on non booke
  powerpc: Pass correct CPU reference to assembler
  powerpc/mm: Rearrange if-else block to avoid clang warning
  powerpc/nohash: Fix build with llvm-as
  powerpc/nohash: Fix build error with binutils >= 2.38
  powerpc/pseries: Fix endianness issue when parsing PLPKS secvar flags
  macintosh: windfarm: Use unsigned type for 1-bit bitfields
  powerpc/kexec_file: print error string on usable memory property update failure
  powerpc/machdep: warn when machine_is() used too early
  powerpc/64: Replace -mcpu=e500mc64 by -mcpu=e5500
  powerpc/eeh: Set channel state after notifying the drivers
  selftests/powerpc: Fix incorrect kernel headers search path
  powerpc/rtas: arch-wide function token lookup conversions
  powerpc/rtas: introduce rtas_function_token() API
  powerpc/pseries/lpar: convert to papr_sysparm API
  powerpc/pseries/hv-24x7: convert to papr_sysparm API
  ...
parents 5596c6ad f82cdc37
Loading
Loading
Loading
Loading
+74 −1
Original line number Diff line number Diff line
@@ -18,6 +18,14 @@ Description: A string indicating which backend is in use by the firmware.
		This determines the format of the variable and the accepted
		format of variable updates.

		On powernv/OPAL, this value is provided by the OPAL firmware
		and is expected to be "ibm,edk2-compat-v1".

		On pseries/PLPKS, this is generated by the kernel based on the
		version number in the SB_VERSION variable in the keystore, and
		has the form "ibm,plpks-sb-v<version>", or
		"ibm,plpks-sb-unknown" if there is no SB_VERSION variable.

What:		/sys/firmware/secvar/vars/<variable name>
Date:		August 2019
Contact:	Nayna Jain <nayna@linux.ibm.com>
@@ -34,7 +42,7 @@ Description: An integer representation of the size of the content of the

What:		/sys/firmware/secvar/vars/<variable_name>/data
Date:		August 2019
Contact:	Nayna Jain h<nayna@linux.ibm.com>
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	A read-only file containing the value of the variable. The size
		of the file represents the maximum size of the variable data.

@@ -44,3 +52,68 @@ Contact: Nayna Jain <nayna@linux.ibm.com>
Description:	A write-only file that is used to submit the new value for the
		variable. The size of the file represents the maximum size of
		the variable data that can be written.

What:		/sys/firmware/secvar/config
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	This optional directory contains read-only config attributes as
		defined by the secure variable implementation.  All data is in
		ASCII format. The directory is only created if the backing
		implementation provides variables to populate it, which at
		present is only PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/version
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Config version as reported by the hypervisor in ASCII decimal
		format.

		Currently only provided by PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/max_object_size
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Maximum allowed size of	objects in the keystore in bytes,
		represented in ASCII decimal format.

		This is not necessarily the same as the max size that can be
		written to an update file as writes can contain more than
		object data, you should use the size of the update file for
		that purpose.

		Currently only provided by PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/total_size
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Total size of the PLPKS in bytes, represented in ASCII decimal
		format.

		Currently only provided by PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/used_space
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Current space consumed by the key store, in bytes, represented
		in ASCII decimal format.

		Currently only provided by PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/supported_policies
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Bitmask of supported policy flags by the hypervisor,
		represented as an 8 byte hexadecimal ASCII string. Consult the
		hypervisor documentation for what these flags are.

		Currently only provided by PLPKS on the pseries platform.

What:		/sys/firmware/secvar/config/signed_update_algorithms
Date:		February 2023
Contact:	Nayna Jain <nayna@linux.ibm.com>
Description:	Bitmask of flags indicating which algorithms the hypervisor
		supports for signed update of objects, represented as a 16 byte
		hexadecimal ASCII string. Consult the hypervisor documentation
		for what these flags mean.

		Currently only provided by PLPKS on the pseries platform.
+17 −2
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ config PPC
	select HAVE_ARCH_KASAN			if PPC_RADIX_MMU
	select HAVE_ARCH_KASAN			if PPC_BOOK3E_64
	select HAVE_ARCH_KASAN_VMALLOC		if HAVE_ARCH_KASAN
	select HAVE_ARCH_KCSAN            	if PPC_BOOK3S_64
	select HAVE_ARCH_KFENCE			if ARCH_SUPPORTS_DEBUG_PAGEALLOC
	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
	select HAVE_ARCH_KGDB
@@ -206,7 +207,7 @@ config PPC
	select HAVE_ARCH_SECCOMP_FILTER
	select HAVE_ARCH_TRACEHOOK
	select HAVE_ASM_MODVERSIONS
	select HAVE_CONTEXT_TRACKING_USER		if PPC64
	select HAVE_CONTEXT_TRACKING_USER
	select HAVE_C_RECORDMCOUNT
	select HAVE_DEBUG_KMEMLEAK
	select HAVE_DEBUG_STACKOVERFLOW
@@ -256,6 +257,7 @@ config PPC
	select HAVE_STATIC_CALL			if PPC32
	select HAVE_SYSCALL_TRACEPOINTS
	select HAVE_VIRT_CPU_ACCOUNTING
	select HAVE_VIRT_CPU_ACCOUNTING_GEN
	select HUGETLB_PAGE_SIZE_VARIABLE	if PPC_BOOK3S_64 && HUGETLB_PAGE
	select IOMMU_HELPER			if PPC64
	select IRQ_DOMAIN
@@ -387,10 +389,22 @@ config PPC_DCR
	depends on PPC_DCR_NATIVE || PPC_DCR_MMIO
	default y

config PPC_PCI_OF_BUS_MAP
	bool "Use pci_to_OF_bus_map (deprecated)"
	depends on PPC32
	depends on PPC_PMAC || PPC_CHRP
	help
	  This option uses pci_to_OF_bus_map to map OF nodes to PCI devices, which
	  restricts the system to only having 256 PCI buses. On CHRP it also causes
	  the "pci-OF-bus-map" property to be created in the device tree.

	  If unsure, say "N".

config PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT
	depends on PPC32
	depends on !PPC_PMAC && !PPC_CHRP
	depends on !PPC_PCI_OF_BUS_MAP
	bool "Assign PCI bus numbers from zero individually for each PCI domain"
	default y
	help
	  By default on PPC32 were PCI bus numbers unique across all PCI domains.
	  So system could have only 256 PCI buses independently of available
@@ -1028,6 +1042,7 @@ config PPC_SECURE_BOOT
	depends on PPC_POWERNV || PPC_PSERIES
	depends on IMA_ARCH_POLICY
	imply IMA_SECURE_AND_OR_TRUSTED_BOOT
	select PSERIES_PLPKS if PPC_PSERIES
	help
	  Systems with firmware secure boot enabled need to define security
	  policies to extend secure boot to the OS. This config allows a user
+5 −21
Original line number Diff line number Diff line
@@ -146,19 +146,6 @@ CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD))

CFLAGS-$(CONFIG_PPC32)	+= $(call cc-option,-mno-readonly-in-sdata)

ifdef CONFIG_PPC_BOOK3S_64
ifdef CONFIG_CPU_LITTLE_ENDIAN
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8
else
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4
endif
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power10,	\
				  $(call cc-option,-mtune=power9,	\
				  $(call cc-option,-mtune=power8)))
else ifdef CONFIG_PPC_BOOK3E_64
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
endif

ifdef CONFIG_FUNCTION_TRACER
CC_FLAGS_FTRACE := -pg
ifdef CONFIG_MPROFILE_KERNEL
@@ -166,11 +153,12 @@ CC_FLAGS_FTRACE += -mprofile-kernel
endif
endif

CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)
AFLAGS-$(CONFIG_TARGET_CPU_BOOL) += -mcpu=$(CONFIG_TARGET_CPU)

CFLAGS-$(CONFIG_E5500_CPU) += $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64)
CFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU))
CFLAGS-$(CONFIG_POWERPC64_CPU) += $(call cc-option,-mtune=power10,	\
				  $(call cc-option,-mtune=power9,	\
				  $(call cc-option,-mtune=power8)))

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

@@ -213,10 +201,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# often slow when they are implemented at all
KBUILD_CFLAGS		+= $(call cc-option,-mno-string)

cpu-as-$(CONFIG_40x)		+= -Wa,-m405
cpu-as-$(CONFIG_44x)		+= -Wa,-m440
cpu-as-$(CONFIG_ALTIVEC)	+= $(call as-option,-Wa$(comma)-maltivec)
cpu-as-$(CONFIG_PPC_E500)		+= -Wa,-me500

# When using '-many -mpower4' gas will first try and find a matching power4
# mnemonic and failing that it will allow any valid mnemonic that GAS knows
@@ -224,7 +209,6 @@ cpu-as-$(CONFIG_PPC_E500) += -Wa,-me500
# LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675
# but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway...
cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= $(call as-option,-Wa$(comma)-mpower4) $(call as-option,-Wa$(comma)-many)
cpu-as-$(CONFIG_PPC_E500MC)	+= $(call as-option,-Wa$(comma)-me500mc)

KBUILD_AFLAGS += $(cpu-as-y)
KBUILD_CFLAGS += $(cpu-as-y)
+10 −4
Original line number Diff line number Diff line
@@ -39,13 +39,19 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
		 $(LINUXINCLUDE)

ifdef CONFIG_PPC64_BOOT_WRAPPER
ifdef CONFIG_CPU_LITTLE_ENDIAN
BOOTCFLAGS	+= -m64 -mcpu=powerpc64le
BOOTCFLAGS	+= -m64
else
BOOTCFLAGS	+= -m64 -mcpu=powerpc64
BOOTCFLAGS	+= -m32
endif

ifdef CONFIG_TARGET_CPU_BOOL
BOOTCFLAGS	+= -mcpu=$(CONFIG_TARGET_CPU)
else ifdef CONFIG_PPC64_BOOT_WRAPPER
ifdef CONFIG_CPU_LITTLE_ENDIAN
BOOTCFLAGS	+= -mcpu=powerpc64le
else
BOOTCFLAGS	+= -m32 -mcpu=powerpc
BOOTCFLAGS	+= -mcpu=powerpc64
endif
endif

BOOTCFLAGS	+= -isystem $(shell $(BOOTCC) -print-file-name=include)
+23 −0
Original line number Diff line number Diff line
@@ -367,11 +367,34 @@
			};

			reboot@d {
				/*
				 * CPLD firmware which manages system reset and
				 * watchdog registers has bugs. It does not
				 * autoclear system reset register after change
				 * and watchdog ignores reset line on immediate
				 * succeeding reset cycle triggered by watchdog.
				 * These bugs have to be workarounded in U-Boot
				 * bootloader. So use system reset via syscon as
				 * a last resort because older U-Boot versions
				 * do not have workaround for watchdog.
				 *
				 * Reset method via rstcr's global-utilities
				 * (the preferred one) has priority level 128,
				 * watchdog has priority level 0 and default
				 * syscon-reboot priority level is 192.
				 *
				 * So define syscon-reboot with custom priority
				 * level 64 (between rstcr and watchdog) because
				 * rstcr should stay as default preferred reset
				 * method and reset via watchdog is more broken
				 * than system reset via syscon.
				 */
				compatible = "syscon-reboot";
				reg = <0x0d 0x01>;
				offset = <0x0d>;
				mask = <0x01>;
				value = <0x01>;
				priority = <64>;
			};

			led-controller@13 {
Loading