Commit c0cdc890 authored by Valentin Schneider's avatar Valentin Schneider Committed by Marc Zyngier

irqchip/gic-v3-its: Give the percpu rdist struct its own flags field

Later patches will require tracking some per-rdist status. Reuse the bytes
"lost" to padding within the __percpu rdist struct as a flags field, and
re-encode ->lpi_enabled within said flags.

No change in functionality intended.
Signed-off-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211027151506.2085066-2-valentin.schneider@arm.com
parent 0fcfb00b
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0) #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
#define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1) #define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
#define RD_LOCAL_LPI_ENABLED BIT(0)
static u32 lpi_id_bits; static u32 lpi_id_bits;
/* /*
...@@ -3044,7 +3046,7 @@ static void its_cpu_init_lpis(void) ...@@ -3044,7 +3046,7 @@ static void its_cpu_init_lpis(void)
phys_addr_t paddr; phys_addr_t paddr;
u64 val, tmp; u64 val, tmp;
if (gic_data_rdist()->lpi_enabled) if (gic_data_rdist()->flags & RD_LOCAL_LPI_ENABLED)
return; return;
val = readl_relaxed(rbase + GICR_CTLR); val = readl_relaxed(rbase + GICR_CTLR);
...@@ -3158,7 +3160,7 @@ static void its_cpu_init_lpis(void) ...@@ -3158,7 +3160,7 @@ static void its_cpu_init_lpis(void)
/* Make sure the GIC has seen the above */ /* Make sure the GIC has seen the above */
dsb(sy); dsb(sy);
out: out:
gic_data_rdist()->lpi_enabled = true; gic_data_rdist()->flags |= RD_LOCAL_LPI_ENABLED;
pr_info("GICv3: CPU%d: using %s LPI pending table @%pa\n", pr_info("GICv3: CPU%d: using %s LPI pending table @%pa\n",
smp_processor_id(), smp_processor_id(),
gic_data_rdist()->pend_page ? "allocated" : "reserved", gic_data_rdist()->pend_page ? "allocated" : "reserved",
...@@ -5138,7 +5140,7 @@ static int redist_disable_lpis(void) ...@@ -5138,7 +5140,7 @@ static int redist_disable_lpis(void)
* *
* If running with preallocated tables, there is nothing to do. * If running with preallocated tables, there is nothing to do.
*/ */
if (gic_data_rdist()->lpi_enabled || if ((gic_data_rdist()->flags & RD_LOCAL_LPI_ENABLED) ||
(gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED)) (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED))
return 0; return 0;
......
...@@ -615,7 +615,7 @@ struct rdists { ...@@ -615,7 +615,7 @@ struct rdists {
void __iomem *rd_base; void __iomem *rd_base;
struct page *pend_page; struct page *pend_page;
phys_addr_t phys_base; phys_addr_t phys_base;
bool lpi_enabled; u64 flags;
cpumask_t *vpe_table_mask; cpumask_t *vpe_table_mask;
void *vpe_l1_base; void *vpe_l1_base;
} __percpu *rdist; } __percpu *rdist;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment