Skip to content

Commit 88bf5a8

Browse files
sudeep-hollavireshk
authored andcommitted
dt-bindings: dvfs: Add support for generic performance domains
The CLKSCREW attack [0] exposed security vulnerabilities in energy management implementations where untrusted software had direct access to clock and voltage hardware controls. In this attack, the malicious software was able to place the platform into unsafe overclocked or undervolted configurations. Such configurations then enabled the injection of predictable faults to reveal secrets. Many Arm-based systems used to or still use voltage regulator and clock frameworks in the kernel. These frameworks allow callers to independently manipulate frequency and voltage settings. Such implementations can render systems susceptible to this form of attack. Attacks such as CLKSCREW are now being mitigated by not having direct and independent control of clock and voltage in the kernel and moving that control to a trusted entity, such as the SCP firmware or secure world firmware/software which are to perform sanity checking on the requested performance levels, thereby preventing any attempted malicious programming. With the advent of such an abstraction, there is a need to replace the generic clock and regulator bindings used by such devices with a generic performance domains bindings. [0] https://www.usenix.org/conference/usenixsecurity17/technical-sessions/presentation/tang Cc: Rob Herring <robh+dt@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 17a8b0b commit 88bf5a8

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

Documentation/devicetree/bindings/arm/cpus.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ properties:
257257

258258
where voltage is in V, frequency is in MHz.
259259

260+
performance-domains:
261+
maxItems: 1
262+
description:
263+
List of phandles and performance domain specifiers, as defined by
264+
bindings of the performance domain provider. See also
265+
dvfs/performance-domain.yaml.
266+
260267
power-domains:
261268
description:
262269
List of phandles and PM domain specifiers, as defined by bindings of the
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/dvfs/performance-domain.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Generic performance domains
8+
9+
maintainers:
10+
- Sudeep Holla <sudeep.holla@arm.com>
11+
12+
description: |+
13+
This binding is intended for performance management of groups of devices or
14+
CPUs that run in the same performance domain. Performance domains must not
15+
be confused with power domains. A performance domain is defined by a set
16+
of devices that always have to run at the same performance level. For a given
17+
performance domain, there is a single point of control that affects all the
18+
devices in the domain, making it impossible to set the performance level of
19+
an individual device in the domain independently from other devices in
20+
that domain. For example, a set of CPUs that share a voltage domain, and
21+
have a common frequency control, is said to be in the same performance
22+
domain.
23+
24+
This device tree binding can be used to bind performance domain consumer
25+
devices with their performance domains provided by performance domain
26+
providers. A performance domain provider can be represented by any node in
27+
the device tree and can provide one or more performance domains. A consumer
28+
node can refer to the provider by a phandle and a set of phandle arguments
29+
(so called performance domain specifiers) of length specified by the
30+
\#performance-domain-cells property in the performance domain provider node.
31+
32+
select: true
33+
34+
properties:
35+
"#performance-domain-cells":
36+
description:
37+
Number of cells in a performance domain specifier. Typically 0 for nodes
38+
representing a single performance domain and 1 for nodes providing
39+
multiple performance domains (e.g. performance controllers), but can be
40+
any value as specified by device tree binding documentation of particular
41+
provider.
42+
enum: [ 0, 1 ]
43+
44+
performance-domains:
45+
$ref: '/schemas/types.yaml#/definitions/phandle-array'
46+
maxItems: 1
47+
description:
48+
A phandle and performance domain specifier as defined by bindings of the
49+
performance controller/provider specified by phandle.
50+
51+
additionalProperties: true
52+
53+
examples:
54+
- |
55+
performance: performance-controller@12340000 {
56+
compatible = "qcom,cpufreq-hw";
57+
reg = <0x12340000 0x1000>;
58+
#performance-domain-cells = <1>;
59+
};
60+
61+
// The node above defines a performance controller that is a performance
62+
// domain provider and expects one cell as its phandle argument.
63+
64+
cpus {
65+
#address-cells = <2>;
66+
#size-cells = <0>;
67+
68+
cpu@0 {
69+
device_type = "cpu";
70+
compatible = "arm,cortex-a57";
71+
reg = <0x0 0x0>;
72+
performance-domains = <&performance 1>;
73+
};
74+
};

0 commit comments

Comments
 (0)