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: <alpine.DEB.2.21.1811231834450.1684@nanos.tec.linutronix.de>
Date:   Fri, 23 Nov 2018 19:28:46 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Dou Liyang <douliyangs@...il.com>
cc:     linux-kernel@...r.kernel.org, kashyap.desai@...adcom.com,
        shivasharan.srikanteshwara@...adcom.com, sumit.saxena@...adcom.com,
        ming.lei@...hat.com, hch@....de, bhelgaas@...gle.com
Subject: Re: [RFC PATCH v2] gen/irq: Change the way to differentiate between
 managed and unmanaged interrupts by bitmap

Dou,

On Sat, 10 Nov 2018, Dou Liyang wrote:

sorry for late reply. Travel, conferences ....

> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -673,14 +674,17 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
>  			      const struct irq_affinity *affd)
>  {
>  	struct cpumask *curmsk, *masks = NULL;
> +	DECLARE_BITMAP(managed, nvec);

This is not working as it creates a variable length array (VLA). We just
got rid of all VLAs in the kernel and the compiler will catch this and
complain.

>  	struct msi_desc *entry;
>  	int ret, i;
>  
> +	memset(managed, 0, sizeof(managed));
>  	if (affd)
> -		masks = irq_create_affinity_masks(nvec, affd);
> +		masks = irq_create_affinity_masks(nvec, affd, managed);

So rather than changing the world and everything by adding new arguments,
what about the following:

-struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd);
+struct irq_affinity_desc * irq_create_affinity_masks(int nvec, struct irq_affinity *affd);

struct irq_affinity_desc {
	struct cpumask	mask;
	unsigned long	flags;
};

or something like that. Let irq_create_affinity_masks() allocate an array
of those and store the information in the flags field. In the allocation
functions just replace the cpumask pointer with a irq_affinity_desc pointer
and hand that through to the irqdesc core, where you can evaluate the
flags. Way less things to modify and the data structure allows to expand
this in the future without touching all the functions ever again.

Can you please work against the tip irq/core branch as that has already
other changes in the affinity spreading code queued?

Thanks,

	tglx


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ