Skip to contentSkip to conversation

arm64: fpsimd: dovetail: drop redundant hard irqs disabling

PATCH In review Jan Kiszka 3 participants 8 messages Sep 18, 2025 – Oct 27, 2025 arm64

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 arm64: fpsimd: dovetail: drop redundant hard irqs disabling

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 27 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0
author
#2 lore raw
Quoted 28 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 19 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -2
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
Quoted 8 lines
Quoted 8 lines
arch/arm64/kernel/fpsimd.c +0 -2
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
author
#3 lore raw
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 22 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
arch/arm64/kernel/fpsimd.c +0 -0
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

...and v6.12.y, of course.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
#4 lore raw
In reply to Jan Kiszka
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 22 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
arch/arm64/kernel/fpsimd.c +0 -0
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

Which tree is this? If you mean v6.17-rebase, this patch is redundant.

void fpsimd_save_and_flush_cpu_state(void)

{
	unsigned long flags;

	if (!system_supports_fpsimd())
		return;
	WARN_ON(preemptible());
	flags = hard_local_irq_save();
	fpsimd_save_user_state();
	fpsimd_flush_cpu_state();
	hard_local_irq_restore(flags);
}
Signature · 1 line
Philippe.
#5 lore raw
Quoted 47 lines · Philippe Gerum
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 22 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
arch/arm64/kernel/fpsimd.c +0 -0
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

Which tree is this? If you mean v6.17-rebase, this patch is redundant.

void fpsimd_save_and_flush_cpu_state(void)

Quoted 11 lines
{
	unsigned long flags;

	if (!system_supports_fpsimd())
		return;
	WARN_ON(preemptible());
	flags = hard_local_irq_save();
	fpsimd_save_user_state();
	fpsimd_flush_cpu_state();
	hard_local_irq_restore(flags);
}

Oh dear, I read it backwards, this is definitely not redundant then. However, which tree are you applying this to? 6.17.y does not exist ATM here.

Signature · 1 line
Philippe.
#6 lore raw
Quoted 61 lines · Philippe Gerum
Quoted 47 lines · Philippe Gerum
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 22 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
arch/arm64/kernel/fpsimd.c +0 -0
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

Which tree is this? If you mean v6.17-rebase, this patch is redundant.

void fpsimd_save_and_flush_cpu_state(void)

Quoted 11 lines
{
	unsigned long flags;

	if (!system_supports_fpsimd())
		return;
	WARN_ON(preemptible());
	flags = hard_local_irq_save();
	fpsimd_save_user_state();
	fpsimd_flush_cpu_state();
	hard_local_irq_restore(flags);
}
Quoted 3 lines

Oh dear, I read it backwards, this is definitely not redundant then. However, which tree are you applying this to? 6.17.y does not exist ATM here.

Meanwhile, I picked this patch which fell through the cracks for 6.1.y-cip-rebase, 6.12.y-rebase and v6.17-rebase, both for dovetail and evl trees, thanks.

Signature · 1 line
Philippe.
author
#7 lore raw
In reply to Philippe Gerum
Quoted 61 lines · Philippe Gerum
Quoted 47 lines · Philippe Gerum
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Florian Bezdeka
Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

fpsimd_save_and_flush_cpu_state() itself does take care of this.

Quoted 22 lines

---

Changes for 6.1 will look different.

 arch/arm64/kernel/fpsimd.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/fpsimd.c +0 -4
index 1f5fcac32b2d2..21f8785948ca3 100644
@@ -2110,13 +2110,9 @@ void __efi_fpsimd_end(void)
 static int fpsimd_cpu_pm_notifier(struct notifier_block *self,
 				  unsigned long cmd, void *v)
 {
-	unsigned long flags;
-
 	switch (cmd) {
 	case CPU_PM_ENTER:
-		flags = hard_cond_local_irq_save();
 		fpsimd_save_and_flush_cpu_state();
-		hard_cond_local_irq_restore(flags);
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
arch/arm64/kernel/fpsimd.c +0 -0
 		break;
 	case CPU_PM_EXIT:
 		break;
Signature · 1 line
2.51.0

Philippe, this cleanup is still pending, applying as-is to v6.17.y-dovetail-rebase now.

Which tree is this? If you mean v6.17-rebase, this patch is redundant.

void fpsimd_save_and_flush_cpu_state(void)

Quoted 11 lines
{
	unsigned long flags;

	if (!system_supports_fpsimd())
		return;
	WARN_ON(preemptible());
	flags = hard_local_irq_save();
	fpsimd_save_user_state();
	fpsimd_flush_cpu_state();
	hard_local_irq_restore(flags);
}
Quoted 3 lines

Oh dear, I read it backwards, this is definitely not redundant then. However, which tree are you applying this to? 6.17.y does not exist ATM here.

I was rebasing it on top of v6.17-dovetail-rebase (no .y, sorry).

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center