Re: vmlinux.o: warning: objtool: kvm_spurious_fault()+0x22: call to ftrace_likely_update() leaves .noinstr.text section

From: Peter Zijlstra
Date: Sat Nov 13 2021 - 02:31:55 EST


On Sat, Nov 13, 2021 at 10:48:52AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
> commit: 63b3f96e1a989846a5a521d4fbef4bc86406929d kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT
> date: 6 months ago
> config: x86_64-buildonly-randconfig-r002-20211009 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=63b3f96e1a989846a5a521d4fbef4bc86406929d
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 63b3f96e1a989846a5a521d4fbef4bc86406929d
> # save the attached .config to linux build tree
> mkdir build_dir
> make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All warnings (new ones prefixed by >>):
>
> >> vmlinux.o: warning: objtool: kvm_spurious_fault()+0x22: call to ftrace_likely_update() leaves .noinstr.text section
> >> vmlinux.o: warning: objtool: vmx_update_host_rsp()+0x34: call to ftrace_likely_update() leaves .noinstr.text section

Yeah, that's CONFIG_TRACE_BRANCH_PROFILING and it is broken. It will
eventually explode once we push the PTI CR3 switcheroo into C due to
trying to access kernel data before kernel address space is mapped.