All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG Report] undefined reference to `convert_to_fxsr'
@ 2022-12-28 12:31 Miaohe Lin
  2022-12-28 12:39 ` Borislav Petkov
  0 siblings, 1 reply; 16+ messages in thread
From: Miaohe Lin @ 2022-12-28 12:31 UTC (permalink / raw)
  To: x86, linux-kernel; +Cc: tglx, mingo, bp, Dave Hansen, hpa

Hi all:

When I compile the mainline kernel v6.2-rc1, the below link error occurs:

ld: arch/x86/kernel/fpu/signal.o: in function `__fpu_restore_sig':
/home/linmiaohe/linux-next/arch/x86/kernel/fpu/signal.c:421: undefined reference to `convert_to_fxsr'
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1252: vmlinux] Error 2
make: *** Waiting for unfinished jobs....

I think it's because convert_to_fxsr() is only defined when CONFIG_X86_32 or CONFIG_IA32_EMULATION is enabled. But it can be
call from __fpu_restore_sig() via below path:

bool fpu__restore_sig(void __user *buf, int ia32_frame):

        if (!IS_ENABLED(CONFIG_X86_64) && !cpu_feature_enabled(X86_FEATURE_FPU)) {
                success = !fpregs_soft_set(current, NULL, 0,
                                           sizeof(struct user_i387_ia32_struct),
                                           NULL, buf);
        } else {
                success = __fpu_restore_sig(buf, buf_fx, ia32_fxstate); /* Will call convert_to_fxsr() later. */
        }

__fpu_restore_sig() will call convert_to_fxsr() even if neither CONFIG_X86_32 nor CONFIG_IA32_EMULATION is enabled. So the link error occurs.
But I'm not really sure how to fix it. Any reply or fix is appreciated.

Thanks,
Miaohe Lin

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-01-10  1:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 12:31 [BUG Report] undefined reference to `convert_to_fxsr' Miaohe Lin
2022-12-28 12:39 ` Borislav Petkov
2022-12-29  1:50   ` Miaohe Lin
2022-12-29 15:17     ` Borislav Petkov
2022-12-30  1:49       ` Miaohe Lin
2022-12-30 11:16         ` Borislav Petkov
2023-01-03  3:05           ` Miaohe Lin
2023-01-05 23:14             ` Borislav Petkov
2023-01-07  2:10               ` Miaohe Lin
2023-01-07 11:07                 ` Borislav Petkov
2023-01-09  1:48                   ` Miaohe Lin
2023-01-09 11:49                     ` Borislav Petkov
2023-01-09 12:32                       ` Miaohe Lin
2023-01-09 17:09                         ` Nathan Chancellor
2023-01-10  1:13                           ` Miaohe Lin
2022-12-30 12:20         ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.