x86/fpu: fix compile error without kernel_fpu_disabled()
PATCH 1/1 x86/fpu: fix compile error without kernel_fpu_disabled()
From: Jamie Huang <[email protected]>
In v5.18-evl-rebase, function kernel_fpu_disabled() has been removed in
commit 59f5ede3bc0f("x86/fpu: Prevent FPU state corruption"), so we will
get compile error when CONFIG_DOVETAIL is enabled:arch/x86/kernel/fpu/core.c:931:6: error: implicit declaration of function ‘kernel_fpu_disabled’; did you mean ‘perf_pmu_disable’? [-Werror=implicit-function-declaration]
if (kernel_fpu_disabled()) {
^~~~~~~~~~~~~~~~~~~
perf_pmu_disablecc1: all warnings being treated as errors
So, fix it.
--- arch/x86/kernel/fpu/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/fpu/core.c +1 -1
@@ -928,7 +928,7 @@ void fpu__suspend_inband(void)* preemption of an inband kernel context currently using the * fpu by a thread which resumes on the oob stage. */ -if (kernel_fpu_disabled ()) { +if (this_cpu_read (in_kernel_fpu)) {save_fpregs_to_fpstate (kfpu);__cpu_invalidate_fpregs_state ();oob_fpu_set_preempt (&tsk->thread.fpu);
Signature · 1 line
2.17.1
Quoted 22 lines · [email protected] writes:
From: Jamie Huang <[email protected]>
In v5.18-evl-rebase, function
kernel_fpu_disabled()has been removed in
commit 59f5ede3bc0f("x86/fpu: Prevent FPU state corruption"), so we will
get compile error whenCONFIG_DOVETAILis enabled:arch/x86/kernel/fpu/core.c:931:6: error: implicit declaration of function ‘kernel_fpu_disabled’; did you mean ‘perf_pmu_disable’? [-Werror=implicit-function-declaration]if (kernel_fpu_disabled()) { ^~~~~~~~~~~~~~~~~~~ perf_pmu_disablecc1: all warnings being treated as errors
So, fix it.Signed-off-by Jamie Huang <[email protected]>--- arch/x86/kernel/fpu/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/fpu/core.c +0
-0
arch/x86/kernel/fpu/core.c void fpu__suspend_inband(void) · line 934
Quoted 8 lines
arch/x86/kernel/fpu/core.c +1
-1@@ -928,7 +928,7 @@ void fpu__suspend_inband(void)* preemption of an inband kernel context currently using the * fpu by a thread which resumes on the oob stage. */ -if (kernel_fpu_disabled ()) { +if (this_cpu_read (in_kernel_fpu)) {save_fpregs_to_fpstate (kfpu);__cpu_invalidate_fpregs_state ();oob_fpu_set_preempt (&tsk->thread.fpu);
Merged adding the same fixup to the comment nearby, thanks.
Signature · 1 line
Philippe.
Quoted 20 lines · Philippe Gerum
Quoted 17 lines · [email protected] writes:
From: Jamie Huang <[email protected]>
In v5.18-evl-rebase, function
kernel_fpu_disabled()has been removed in
commit 59f5ede3bc0f("x86/fpu: Prevent FPU state corruption"), so we will
get compile error whenCONFIG_DOVETAILis enabled:arch/x86/kernel/fpu/core.c:931:6: error: implicit declaration of function ‘kernel_fpu_disabled’; did you mean ‘perf_pmu_disable’? [-Werror=implicit-function-declaration]if (kernel_fpu_disabled()) { ^~~~~~~~~~~~~~~~~~~ perf_pmu_disablecc1: all warnings being treated as errors
So, fix it.Signed-off-by Jamie Huang <[email protected]>--- arch/x86/kernel/fpu/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
arch/x86/kernel/fpu/core.c void fpu__suspend_inband(void) · line 934
Quoted 13 lines
arch/x86/kernel/fpu/core.c +1
-1@@ -928,7 +928,7 @@ void fpu__suspend_inband(void)* preemption of an inband kernel context currently using the * fpu by a thread which resumes on the oob stage. */ -if (kernel_fpu_disabled ()) { +if (this_cpu_read (in_kernel_fpu)) {save_fpregs_to_fpstate (kfpu);__cpu_invalidate_fpregs_state ();oob_fpu_set_preempt (&tsk->thread.fpu);Merged adding the same fixup to the comment nearby, thanks.
Could you backport to 5.15 as well?
https://gitlab.com/Xenomai/xenomai-hacker-space/-/jobs/2563340960
Thanks,
Jan
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Quoted 38 lines · Jan Kiszka
Quoted 20 lines · Philippe Gerum
Quoted 17 lines · [email protected] writes:
From: Jamie Huang <[email protected]>
In v5.18-evl-rebase, function
kernel_fpu_disabled()has been removed in
commit 59f5ede3bc0f("x86/fpu: Prevent FPU state corruption"), so we will
get compile error whenCONFIG_DOVETAILis enabled:arch/x86/kernel/fpu/core.c:931:6: error: implicit declaration of function ‘kernel_fpu_disabled’; did you mean ‘perf_pmu_disable’? [-Werror=implicit-function-declaration]if (kernel_fpu_disabled()) { ^~~~~~~~~~~~~~~~~~~ perf_pmu_disablecc1: all warnings being treated as errors
So, fix it.Signed-off-by Jamie Huang <[email protected]>--- arch/x86/kernel/fpu/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
arch/x86/kernel/fpu/core.c void fpu__suspend_inband(void) · line 934
Quoted 13 lines
arch/x86/kernel/fpu/core.c +1
-1@@ -928,7 +928,7 @@ void fpu__suspend_inband(void)* preemption of an inband kernel context currently using the * fpu by a thread which resumes on the oob stage. */ -if (kernel_fpu_disabled ()) { +if (this_cpu_read (in_kernel_fpu)) {save_fpregs_to_fpstate (kfpu);__cpu_invalidate_fpregs_state ();oob_fpu_set_preempt (&tsk->thread.fpu);Merged adding the same fixup to the comment nearby, thanks.
Quoted 4 lines
Could you backport to 5.15 as well?
https://gitlab.com/Xenomai/xenomai-hacker-space/-/jobs/2563340960
Done, this should build now.
Signature · 1 line
Philippe.