[PATCH] irqchip: gic-v3: Collection table support muti pages

wangwudi posted 1 patch 2 years, 8 months ago
drivers/irqchip/irq-gic-v3-its.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] irqchip: gic-v3: Collection table support muti pages
Posted by wangwudi 2 years, 8 months ago
Only one page is allocated to the collection table.
Recalculate the page number of collection table based on the number of
CPUs.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: wangwudi <wangwudi@hisilicon.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 0ec2b1e1df75..dfdeba86b9aa 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2626,6 +2626,10 @@ static int its_alloc_tables(struct its_node *its)
 			indirect = its_parse_indirect_baser(its, baser, &order,
 							    ITS_MAX_VPEID_BITS);
 			break;
+		case GITS_BASER_TYPE_COLLECTION:
+			indirect = its_parse_indirect_baser(its, baser, &order,
+								order_base_2(num_possible_cpus()));
+			break;
 		}
 
 		err = its_setup_baser(its, baser, cache, shr, order, indirect);
-- 
2.7.4
Re: [PATCH] irqchip: gic-v3: Collection table support muti pages
Posted by Marc Zyngier 2 years, 8 months ago
On Mon, 15 May 2023 13:10:04 +0100,
wangwudi <wangwudi@hisilicon.com> wrote:
> 
> Only one page is allocated to the collection table.
> Recalculate the page number of collection table based on the number of
> CPUs.

Please document *why* we should even consider this. Do you know of any
existing implementation that is so large (or need so much memory for
its collection) that it would result in overflowing the collection
table?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.