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
| ||
|
Message-ID: <87sfi5u6wx.wl-maz@kernel.org> Date: Sat, 26 Nov 2022 14:28:14 +0000 From: Marc Zyngier <maz@...nel.org> To: Anup Patel <apatel@...tanamicro.com> Cc: Palmer Dabbelt <palmer@...belt.com>, Paul Walmsley <paul.walmsley@...ive.com>, Thomas Gleixner <tglx@...utronix.de>, Daniel Lezcano <daniel.lezcano@...aro.org>, Atish Patra <atishp@...shpatra.org>, Alistair Francis <Alistair.Francis@....com>, Anup Patel <anup@...infault.org>, linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v11 3/7] genirq: Add mechanism to multiplex a single HW IPI On Sat, 26 Nov 2022 13:31:46 +0000, Anup Patel <apatel@...tanamicro.com> wrote: > > On Sat, Nov 26, 2022 at 6:12 PM Marc Zyngier <maz@...nel.org> wrote: > > > > On Mon, 14 Nov 2022 09:39:00 +0000, > > Anup Patel <apatel@...tanamicro.com> wrote: > > > > > > +struct ipi_mux_control { > > > + void *data; > > > + unsigned int nr; > > > > Honestly, I think we can get rid of this. The number of IPIs Linux > > uses is pretty small, and assuming a huge value (like 32) would be > > enough. It would save looking up this value on each IPI handling. > > I had kept in-case some driver wanted to create fewer (< 32) > muxed IPIs. I'm fine with being able to specifying the max, but I'm not sure there is a need to keep track of it any further. Certainly, the overhead of loading this value on each IPI could be removed. On most architecture, for_each_set_bit() and co and better optimised with a fixed number of bits. > > > +static const struct irq_chip ipi_mux_chip = { > > > + .name = "IPI Mux", > > > + .irq_mask = ipi_mux_mask, > > > + .irq_unmask = ipi_mux_unmask, > > > + .ipi_send_mask = ipi_mux_send_mask, > > > +}; > > > > I really think this could either be supplied by the irqchip, or > > somehow patched to avoid the pointless imux->ops->ipi_mux_send > > indirection. Pointer chasing hurts. > > Once we remove ipi_mux_pre/post_handle() callbacks, the > "ops" will be pointless and we will be able to remove one level > of indirection here. > > We certainly need a mux irqchip to implement the > mask/unmask semantics for muxed IPIs. I'm not disputing that last point. > > > +/** > > > + * ipi_mux_create - Create virtual IPIs multiplexed on top of a single > > > + * parent IPI. > > > + * @parent_virq: virq of the parent per-CPU IRQ > > > + * @nr_ipi: number of virtual IPIs to create. This should > > > + * be <= BITS_PER_TYPE(int) > > > + * @ops: multiplexing operations for the parent IPI > > > + * @data: opaque data used by the multiplexing operations > > > > What is the use for data? If anything, that data should be passed via > > the mux interrupt. But the whole point of this is to make the mux > > invisible. So this whole 'data' business is a mystery to me. > > This is added only to pass back driver data in ipi_mux_send(). Again, what is the purpose of such data? If you need per-interrupt data, this should be provided by the requester of the interrupt. M. -- Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists