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] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bjrhqcn8.ffs@tglx>
Date: Sun, 25 May 2025 11:10:19 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Markus Stockhausen <markus.stockhausen@....de>,
 tsbogend@...ha.franken.de, linux-mips@...r.kernel.org,
 linux-kernel@...r.kernel.org, s.gottschall@...wrt.com
Cc: Markus Stockhausen <markus.stockhausen@....de>
Subject: Re: [PATCH] irqchip/mips-gic: allow forced affinity for current cpu
 during hotplug

On Fri, May 23 2025 at 11:15, Markus Stockhausen wrote:
> +
> +	if ((cpu >= NR_CPUS) && !force)
> +		/* In normal mode allow only online CPUs. */
>  		return -EINVAL;
>  
> +	if (cpu >= NR_CPUS) {
> +		/* In force mode allow current not yet online CPU for hotplug handlers. */
> +		cpu = cpumask_first(cpumask);
> +		if (cpu != get_cpu())
> +			return -EINVAL;
> +	}

This logic really makes my brain hurt. Why not doing the obvious:

	if (cpu >= NR_CPUS) {
        	/* Sensible comment */	
        	if (!force)
                	return -EINVAL;
                ...
        }

Hmm?

Thanks

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ