mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "x86@kernel.org" <x86@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, <hpa@zytor.com>
Subject: Re: [BUG Report] undefined reference to `convert_to_fxsr'
Date: Tue, 3 Jan 2023 11:05:01 +0800	[thread overview]
Message-ID: <64fe1be4-954f-fe6f-44f0-59b572548663@huawei.com> (raw)
In-Reply-To: <Y67IlthBqaX69RwN@zn.tnic>

On 2022/12/30 19:16, Borislav Petkov wrote:
> On Fri, Dec 30, 2022 at 09:49:50AM +0800, Miaohe Lin wrote:
>> Many thanks for doing this. :) But it seems it's not the matter of gcc
>> version. Somewhat confused...
> 
> Put your .config somewhere outside your git repo, clean all build
> artifacts and reset it properly by doing:
> 
> git reset --hard
> git clean -dqfx
> 
> and then copy back the .config and see if you can still repro.
> 

Yes, it still reproduces in my working server. It might be the problem of gcc version.
Does the below origin analysis looks sane to you?

"""
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.
"""

Below is the reproduce log:

linux-rtfsc:/home/linmiaohe/linux # git reset --hard
HEAD is now at 69b41ac87e4a Merge tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
linux-rtfsc:/home/linmiaohe/linux # git clean -dqfx
linux-rtfsc:/home/linmiaohe/linux # cp ../virt/hmm_config .config
linux-rtfsc:/home/linmiaohe/linux # make menuconfig -j384
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/menu.o
  LEX     scripts/kconfig/lexer.lex.c
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/mconf
.config:5767:warning: symbol value 'm' invalid for VFIO_VIRQFD


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

linux-rtfsc:/home/linmiaohe/linux # make -j384
...
  DESCEND objtool
  CALL    scripts/checksyscalls.sh
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  LD      .tmp_vmlinux.kallsyms1
ld: arch/x86/kernel/fpu/signal.o: in function `__fpu_restore_sig':
/home/linmiaohe/linux/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....
linux-rtfsc:/home/linmiaohe/linux #

Many thanks for your time. :)

Thanks,
Miaohe Lin

  reply	other threads:[~2023-01-03  3:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 12:31 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64fe1be4-954f-fe6f-44f0-59b572548663@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®