lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CADGqjFKS9ytGOdvrcr=JuggRFW_1bgLVn-EJTbjoa4wSwgNhHQ@mail.gmail.com>
Date:   Thu, 2 Nov 2023 17:54:37 +0800
From:   sean yang <seanyang230@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH v2] firmware: arm_scmi: Refrain set operations of perf

---------- Forwarded message ---------
发件人: xinglong.yang <seanyang230@...il.com>
Date: 2023年11月2日周四 15:59
Subject: [PATCH v2] firmware: arm_scmi: Refrain set operations of perf
To: <xinglong.yang@...tech.com>, <sudeep.holla@....com>,
<cristian.marussi@....com>
Cc: <linux-arm-kernel@...ts.infradead.org>


Refrain from trying to take the SET operation where the set_* operations
are not supported, because: (1.) avoid unneeded SCMI exchanges, (2.)
avoids to trust the FW reply blindly.

Signed-off-by: xinglong.yang <xinglong.yang@...tech.com>
---
 drivers/firmware/arm_scmi/perf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 431bda9165c3..3bcdef91ed5c 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -377,6 +377,9 @@ static int scmi_perf_limits_set(const struct
scmi_protocol_handle *ph,
        if (IS_ERR(dom))
                return PTR_ERR(dom);

+       if (!dom->set_limits)
+               return -EOPNOTSUPP;
+
        if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf)
                return -EINVAL;

@@ -473,6 +476,9 @@ static int scmi_perf_level_set(const struct
scmi_protocol_handle *ph,
        if (IS_ERR(dom))
                return PTR_ERR(dom);

+       if (!dom->set_perf)
+               return -EOPNOTSUPP;
+
        if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) {
                struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL];

--
2.42.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ