Skip to content

Commit

Permalink
Automatic merge of 'next' into merge (2024-05-08 22:44)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed May 8, 2024
2 parents ec2d9f1 + 98ec6d3 commit 128a9d4
Show file tree
Hide file tree
Showing 113 changed files with 1,376 additions and 333 deletions.
14 changes: 7 additions & 7 deletions Documentation/ABI/testing/sysfs-devices-system-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ What: /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats
/sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/occ_reset
Date: March 2016
Contact: Linux kernel mailing list <[email protected]>
Linux for PowerPC mailing list <[email protected]>
Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: POWERNV CPUFreq driver's frequency throttle stats directory and
attributes

Expand Down Expand Up @@ -473,7 +473,7 @@ What: /sys/devices/system/cpu/cpufreq/policyX/throttle_stats
/sys/devices/system/cpu/cpufreq/policyX/throttle_stats/occ_reset
Date: March 2016
Contact: Linux kernel mailing list <[email protected]>
Linux for PowerPC mailing list <[email protected]>
Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: POWERNV CPUFreq driver's frequency throttle stats directory and
attributes

Expand Down Expand Up @@ -608,7 +608,7 @@ Description: Umwait control
What: /sys/devices/system/cpu/svm
Date: August 2019
Contact: Linux kernel mailing list <[email protected]>
Linux for PowerPC mailing list <[email protected]>
Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Secure Virtual Machine

If 1, it means the system is using the Protected Execution
Expand All @@ -617,7 +617,7 @@ Description: Secure Virtual Machine

What: /sys/devices/system/cpu/cpuX/purr
Date: Apr 2005
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: PURR ticks for this CPU since the system boot.

The Processor Utilization Resources Register (PURR) is
Expand All @@ -628,7 +628,7 @@ Description: PURR ticks for this CPU since the system boot.

What: /sys/devices/system/cpu/cpuX/spurr
Date: Dec 2006
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: SPURR ticks for this CPU since the system boot.

The Scaled Processor Utilization Resources Register
Expand All @@ -640,15 +640,15 @@ Description: SPURR ticks for this CPU since the system boot.

What: /sys/devices/system/cpu/cpuX/idle_purr
Date: Apr 2020
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: PURR ticks for cpuX when it was idle.

This sysfs interface exposes the number of PURR ticks
for cpuX when it was idle.

What: /sys/devices/system/cpu/cpuX/idle_spurr
Date: Apr 2020
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: SPURR ticks for cpuX when it was idle.

This sysfs interface exposes the number of SPURR ticks
Expand Down
4 changes: 2 additions & 2 deletions Documentation/ABI/testing/sysfs-firmware-opal-powercap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
What: /sys/firmware/opal/powercap
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Powercap directory for Powernv (P8, P9) servers

Each folder in this directory contains a
Expand All @@ -11,7 +11,7 @@ What: /sys/firmware/opal/powercap/system-powercap
/sys/firmware/opal/powercap/system-powercap/powercap-max
/sys/firmware/opal/powercap/system-powercap/powercap-current
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: System powercap directory and attributes applicable for
Powernv (P8, P9) servers

Expand Down
4 changes: 2 additions & 2 deletions Documentation/ABI/testing/sysfs-firmware-opal-psr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
What: /sys/firmware/opal/psr
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Power-Shift-Ratio directory for Powernv P9 servers

Power-Shift-Ratio allows to provide hints the firmware
Expand All @@ -10,7 +10,7 @@ Description: Power-Shift-Ratio directory for Powernv P9 servers

What: /sys/firmware/opal/psr/cpu_to_gpu_X
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: PSR sysfs attributes for Powernv P9 servers

Power-Shift-Ratio between CPU and GPU for a given chip
Expand Down
4 changes: 2 additions & 2 deletions Documentation/ABI/testing/sysfs-firmware-opal-sensor-groups
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
What: /sys/firmware/opal/sensor_groups
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Sensor groups directory for POWER9 powernv servers

Each folder in this directory contains a sensor group
Expand All @@ -11,7 +11,7 @@ Description: Sensor groups directory for POWER9 powernv servers

What: /sys/firmware/opal/sensor_groups/<sensor_group_name>/clear
Date: August 2017
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Sysfs file to clear the min-max of all the sensors
belonging to the group.

Expand Down
10 changes: 5 additions & 5 deletions Documentation/ABI/testing/sysfs-firmware-papr-energy-scale-info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
What: /sys/firmware/papr/energy_scale_info
Date: February 2022
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Directory hosting a set of platform attributes like
energy/frequency on Linux running as a PAPR guest.

Expand All @@ -10,20 +10,20 @@ Description: Directory hosting a set of platform attributes like

What: /sys/firmware/papr/energy_scale_info/<id>
Date: February 2022
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Energy, frequency attributes directory for POWERVM servers

What: /sys/firmware/papr/energy_scale_info/<id>/desc
Date: February 2022
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: String description of the energy attribute of <id>

What: /sys/firmware/papr/energy_scale_info/<id>/value
Date: February 2022
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: Numeric value of the energy attribute of <id>

What: /sys/firmware/papr/energy_scale_info/<id>/value_desc
Date: February 2022
Contact: Linux for PowerPC mailing list <[email protected]>
Contact: Linux for PowerPC mailing list <linuxppc-dev@lists.ozlabs.org>
Description: String value of the energy attribute of <id>
141 changes: 139 additions & 2 deletions Documentation/arch/powerpc/dexcr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,145 @@ state for a process.
Configuration
=============

The DEXCR is currently unconfigurable. All threads are run with the
NPHIE aspect enabled.
prctl
-----

A process can control its own userspace DEXCR value using the
``PR_PPC_GET_DEXCR`` and ``PR_PPC_SET_DEXCR`` pair of
:manpage:`prctl(2)` commands. These calls have the form::

prctl(PR_PPC_GET_DEXCR, unsigned long which, 0, 0, 0);
prctl(PR_PPC_SET_DEXCR, unsigned long which, unsigned long ctrl, 0, 0);

The possible 'which' and 'ctrl' values are as follows. Note there is no relation
between the 'which' value and the DEXCR aspect's index.

.. flat-table::
:header-rows: 1
:widths: 2 7 1

* - ``prctl()`` which
- Aspect name
- Aspect index

* - ``PR_PPC_DEXCR_SBHE``
- Speculative Branch Hint Enable (SBHE)
- 0

* - ``PR_PPC_DEXCR_IBRTPD``
- Indirect Branch Recurrent Target Prediction Disable (IBRTPD)
- 3

* - ``PR_PPC_DEXCR_SRAPD``
- Subroutine Return Address Prediction Disable (SRAPD)
- 4

* - ``PR_PPC_DEXCR_NPHIE``
- Non-Privileged Hash Instruction Enable (NPHIE)
- 5

.. flat-table::
:header-rows: 1
:widths: 2 8

* - ``prctl()`` ctrl
- Meaning

* - ``PR_PPC_DEXCR_CTRL_EDITABLE``
- This aspect can be configured with PR_PPC_SET_DEXCR (get only)

* - ``PR_PPC_DEXCR_CTRL_SET``
- This aspect is set / set this aspect

* - ``PR_PPC_DEXCR_CTRL_CLEAR``
- This aspect is clear / clear this aspect

* - ``PR_PPC_DEXCR_CTRL_SET_ONEXEC``
- This aspect will be set after exec / set this aspect after exec

* - ``PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC``
- This aspect will be clear after exec / clear this aspect after exec

Note that

* which is a plain value, not a bitmask. Aspects must be worked with individually.

* ctrl is a bitmask. ``PR_PPC_GET_DEXCR`` returns both the current and onexec
configuration. For example, ``PR_PPC_GET_DEXCR`` may return
``PR_PPC_DEXCR_CTRL_EDITABLE | PR_PPC_DEXCR_CTRL_SET |
PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC``. This would indicate the aspect is currently
set, it will be cleared when you run exec, and you can change this with the
``PR_PPC_SET_DEXCR`` prctl.

* The set/clear terminology refers to setting/clearing the bit in the DEXCR.
For example::

prctl(PR_PPC_SET_DEXCR, PR_PPC_DEXCR_IBRTPD, PR_PPC_DEXCR_CTRL_SET, 0, 0);

will set the IBRTPD aspect bit in the DEXCR, causing indirect branch prediction
to be disabled.

* The status returned by ``PR_PPC_GET_DEXCR`` represents what value the process
would like applied. It does not include any alternative overrides, such as if
the hypervisor is enforcing the aspect be set. To see the true DEXCR state
software should read the appropriate SPRs directly.

* The aspect state when starting a process is copied from the parent's state on
:manpage:`fork(2)`. The state is reset to a fixed value on
:manpage:`execve(2)`. The PR_PPC_SET_DEXCR prctl() can control both of these
values.

* The ``*_ONEXEC`` controls do not change the current process's DEXCR.

Use ``PR_PPC_SET_DEXCR`` with one of ``PR_PPC_DEXCR_CTRL_SET`` or
``PR_PPC_DEXCR_CTRL_CLEAR`` to edit a given aspect.

Common error codes for both getting and setting the DEXCR are as follows:

.. flat-table::
:header-rows: 1
:widths: 2 8

* - Error
- Meaning

* - ``EINVAL``
- The DEXCR is not supported by the kernel.

* - ``ENODEV``
- The aspect is not recognised by the kernel or not supported by the
hardware.

``PR_PPC_SET_DEXCR`` may also report the following error codes:

.. flat-table::
:header-rows: 1
:widths: 2 8

* - Error
- Meaning

* - ``EINVAL``
- The ctrl value contains unrecognised flags.

* - ``EINVAL``
- The ctrl value contains mutually conflicting flags (e.g.,
``PR_PPC_DEXCR_CTRL_SET | PR_PPC_DEXCR_CTRL_CLEAR``)

* - ``EPERM``
- This aspect cannot be modified with prctl() (check for the
PR_PPC_DEXCR_CTRL_EDITABLE flag with PR_PPC_GET_DEXCR).

* - ``EPERM``
- The process does not have sufficient privilege to perform the operation.
For example, clearing NPHIE on exec is a privileged operation (a process
can still clear its own NPHIE aspect without privileges).

This interface allows a process to control its own DEXCR aspects, and also set
the initial DEXCR value for any children in its process tree (up to the next
child to use an ``*_ONEXEC`` control). This allows fine-grained control over the
default value of the DEXCR, for example allowing containers to run with different
default values.


coredump and ptrace
Expand Down
6 changes: 1 addition & 5 deletions arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)

ifdef CONFIG_PPC64
ifndef CONFIG_PPC_KERNEL_PCREL
ifeq ($(call cc-option-yn,-mcmodel=medium),y)
# -mcmodel=medium breaks modules because it uses 32bit offsets from
# the TOC pointer to create pointers where possible. Pointers into the
# percpu data area are created by this method.
Expand All @@ -124,9 +123,6 @@ ifeq ($(call cc-option-yn,-mcmodel=medium),y)
# kernel percpu data space (starting with 0xc...). We need a full
# 64bit relocation for this to work, hence -mcmodel=large.
KBUILD_CFLAGS_MODULE += -mcmodel=large
else
export NO_MINIMAL_TOC := -mno-minimal-toc
endif
endif
endif

Expand All @@ -139,7 +135,7 @@ CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc)
endif
endif
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
CFLAGS-$(CONFIG_PPC64) += -mcmodel=medium
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mlong-double-128)

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ DTC_FLAGS ?= -p 1024
# these files into the build dir, fix up any includes and ensure that dependent
# files are copied in the right order.

# these need to be seperate variables because they are copied out of different
# directories in the kernel tree. Sure you COULd merge them, but it's a
# these need to be separate variables because they are copied out of different
# directories in the kernel tree. Sure you COULD merge them, but it's a
# cure-is-worse-than-disease situation.
zlib-decomp-$(CONFIG_KERNEL_GZIP) := decompress_inflate.c
zlib-$(CONFIG_KERNEL_GZIP) := inffast.c inflate.c inftrees.c
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void print_err(char *s)
* @input_size: length of the input buffer
* @outbuf: output buffer
* @output_size: length of the output buffer
* @skip number of output bytes to ignore
* @_skip: number of output bytes to ignore
*
* This function takes compressed data from inbuf, decompresses and write it to
* outbuf. Once output_size bytes are written to the output buffer, or the
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/acadia.dts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
reg = <0xef602800 0x60>;
interrupt-parent = <&UIC0>;
interrupts = <0x4 0x4>;
/* This thing is a bit weird. It has it's own UIC
/* This thing is a bit weird. It has its own UIC
* that it uses to generate snapshot triggers. We
* don't really support this device yet, and it needs
* work to figure this out.
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/fsl/b4si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
&ifc {
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,ifc", "simple-bus";
compatible = "fsl,ifc";
interrupts = <25 2 0 0>;
};

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/fsl/bsc9131rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
device_type = "memory";
};

board_ifc: ifc: ifc@ff71e000 {
board_ifc: ifc: memory-controller@ff71e000 {
/* NAND Flash on board */
ranges = <0x0 0x0 0x0 0xff800000 0x00004000>;
reg = <0x0 0xff71e000 0x0 0x2000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
&ifc {
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,ifc", "simple-bus";
compatible = "fsl,ifc";
interrupts = <16 2 0 0 20 2 0 0>;
};

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/fsl/bsc9132qds.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
device_type = "memory";
};

ifc: ifc@ff71e000 {
ifc: memory-controller@ff71e000 {
/* NOR, NAND Flash on board */
ranges = <0x0 0x0 0x0 0x88000000 0x08000000
0x1 0x0 0x0 0xff800000 0x00010000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
&ifc {
#address-cells = <2>;
#size-cells = <1>;
compatible = "fsl,ifc", "simple-bus";
compatible = "fsl,ifc";
/* FIXME: Test whether interrupts are split */
interrupts = <16 2 0 0 20 2 0 0>;
};
Expand Down
Loading

0 comments on commit 128a9d4

Please sign in to comment.