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] [day] [month] [year] [list]
Message-ID: <162875243344.395.15450411113319650076.tip-bot2@tip-bot2>
Date:   Thu, 12 Aug 2021 07:13:53 -0000
From:   "irqchip-bot for James Morse" <tip-bot2@...utronix.de>
To:     linux-kernel@...r.kernel.org
Cc:     James Morse <james.morse@....com>,
        Valentin Schneider <valentin.schneider@....com>,
        Marc Zyngier <maz@...nel.org>, tglx@...utronix.de
Subject: [irqchip: irq/irqchip-next] irqchip/gic-v3: Add __gic_get_ppi_index()
 to find the PPI number from hwirq

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     bfa80ee9ce6e2f18da76459c3dd7b0ad57fb2c20
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/bfa80ee9ce6e2f18da76459c3dd7b0ad57fb2c20
Author:        James Morse <james.morse@....com>
AuthorDate:    Thu, 29 Jul 2021 17:27:47 
Committer:     Marc Zyngier <maz@...nel.org>
CommitterDate: Thu, 12 Aug 2021 08:11:03 +01:00

irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq

gic_get_ppi_index() is a useful concept for ppi partitions, as the GIC
has two PPI ranges but needs mapping to a single range when used as an
index in the gic_data.ppi_descs[] array.

Add a double-underscore version which takes just the intid. This will
be used in the partition domain select and translate helpers to enable
partition support for the EPPI range.

Signed-off-by: James Morse <james.morse@....com>
Reviewed-by: Valentin Schneider <valentin.schneider@....com>
Signed-off-by: Marc Zyngier <maz@...nel.org>
Link: https://lore.kernel.org/r/20210729172748.28841-2-james.morse@arm.com
---
 drivers/irqchip/irq-gic-v3.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index e0f4deb..b24f0a9 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -446,18 +446,23 @@ static void gic_irq_set_prio(struct irq_data *d, u8 prio)
 	writeb_relaxed(prio, base + offset + index);
 }
 
-static u32 gic_get_ppi_index(struct irq_data *d)
+static u32 __gic_get_ppi_index(irq_hw_number_t hwirq)
 {
-	switch (get_intid_range(d)) {
+	switch (__get_intid_range(hwirq)) {
 	case PPI_RANGE:
-		return d->hwirq - 16;
+		return hwirq - 16;
 	case EPPI_RANGE:
-		return d->hwirq - EPPI_BASE_INTID + 16;
+		return hwirq - EPPI_BASE_INTID + 16;
 	default:
 		unreachable();
 	}
 }
 
+static u32 gic_get_ppi_index(struct irq_data *d)
+{
+	return __gic_get_ppi_index(d->hwirq);
+}
+
 static int gic_irq_nmi_setup(struct irq_data *d)
 {
 	struct irq_desc *desc = irq_to_desc(d->irq);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ