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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175094718429.406.16067714715595873535.tip-bot2@tip-bot2>
Date: Thu, 26 Jun 2025 14:13:04 -0000
From: "tip-bot2 for Vladimir Kondratiev" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>,
 Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: irq/drivers] irqchip/aslint-sswi: Resolve hart index

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     128ab2cfd0205fe395196a9f3221bcddd6adf54e
Gitweb:        https://git.kernel.org/tip/128ab2cfd0205fe395196a9f3221bcddd6adf54e
Author:        Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>
AuthorDate:    Thu, 12 Jun 2025 17:39:09 +03:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 26 Jun 2025 16:06:40 +02:00

irqchip/aslint-sswi: Resolve hart index

Resolve hart index according to assignment in the "riscv,hart-indexes"
property as defined in the specification [1]

Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/all/20250612143911.3224046-6-vladimir.kondratiev@mobileye.com
Link: https://github.com/riscvarchive/riscv-aclint [1]

---
 drivers/irqchip/irq-aclint-sswi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
index 9d8b19b..93e28e9 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -71,6 +71,7 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
 	for (u32 i = 0; i < contexts; i++) {
 		struct of_phandle_args parent;
 		unsigned long hartid;
+		u32 hart_index;
 		int rc, cpu;
 
 		rc = of_irq_parse_one(to_of_node(fwnode), i, &parent);
@@ -86,6 +87,11 @@ static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iom
 
 		cpu = riscv_hartid_to_cpuid(hartid);
 
+		rc = riscv_get_hart_index(fwnode, i, &hart_index);
+		if (rc) {
+			pr_warn("%pfwP: hart index [%d] not found\n", fwnode, i);
+			return -EINVAL;
+		}
 		per_cpu(sswi_cpu_regs, cpu) = reg + hart_index * 4;
 	}
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ