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:
 <MAUPR01MB1107213FB5E04569DC6010DE5FE32A@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM>
Date: Thu, 21 Aug 2025 14:37:25 +0800
From: Chen Wang <unicorn_wang@...look.com>
To: Inochi Amaoto <inochiama@...il.com>, Thomas Gleixner
 <tglx@...utronix.de>, Paul Walmsley <paul.walmsley@...ive.com>,
 Samuel Holland <samuel.holland@...ive.com>
Cc: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
 Yixun Lan <dlan@...too.org>, Longbin Li <looong.bin@...il.com>,
 Nam Cao <namcao@...utronix.de>
Subject: Re: [PATCH v2] irqchip/sifive-plic: Respect mask state when setting
 affinity


On 8/11/2025 8:26 AM, Inochi Amaoto wrote:
> The plic_set_affinity always call plic_irq_enable(), which clears up
> the priority setting even the irq is only masked. This make the irq
> unmasked unexpectly.
>
> Replace the plic_irq_enable/disable() with plic_irq_toggle() to
> avoid changing priority setting.
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Inochi Amaoto <inochiama@...il.com>
> Reviewed-by: Nam Cao <namcao@...utronix.de>
> Tested-by: Nam Cao <namcao@...utronix.de> # VisionFive 2

Reviewed-by: Chen Wang <unicorn_wang@...look.com>

It is recommended to add the following email link about the relevant 
discussion in the commit message for quich reference when there is a 
revision or merge:

https://lore.kernel.org/lkml/20250722224513.22125-1-inochiama@gmail.com/

Tested-by: Chen Wang <unicorn_wang@...look.com> # Pioneerbox

> ---
> Change from v1:
> 1. apply Nam's tag
> 2. remove unnecessary off-topic change in plic_irq_disable()
> ---
>   drivers/irqchip/irq-sifive-plic.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index bf69a4802b71..866e38612b94 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -179,12 +179,14 @@ static int plic_set_affinity(struct irq_data *d,
>   	if (cpu >= nr_cpu_ids)
>   		return -EINVAL;
>
> -	plic_irq_disable(d);
> +	/* Invalidate the original routing entry */
> +	plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
>
>   	irq_data_update_effective_affinity(d, cpumask_of(cpu));
>
> +	/* Setting the new routing entry if irq is enabled */
>   	if (!irqd_irq_disabled(d))
> -		plic_irq_enable(d);
> +		plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
>
>   	return IRQ_SET_MASK_OK_DONE;
>   }
> --
> 2.50.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ