public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Borislav Petkov <bp@alien8.de>
Cc: kernel test robot <lkp@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	 Josh Poimboeuf <jpoimboe@kernel.org>,
	oe-kbuild-all@lists.linux.dev,  linux-kernel@vger.kernel.org,
	x86@kernel.org
Subject: Re: [tip:x86/alternatives 14/14] arch/x86/kvm/kvm.o: warning: objtool: .altinstr_replacement+0xc5: call without frame pointer save/setup
Date: Fri, 14 Jun 2024 08:35:23 -0700	[thread overview]
Message-ID: <ZmxjOxhPy67QOh5Q@google.com> (raw)
In-Reply-To: <20240614152228.GAZmxgNPmozj7UzRdV@fat_crate.local>

On Fri, Jun 14, 2024, Borislav Petkov wrote:
> On Fri, Jun 14, 2024 at 04:15:14PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/alternatives
> > head:   f776e41fdcc4141876ef6f297318ab04c2382eb7
> > commit: f776e41fdcc4141876ef6f297318ab04c2382eb7 [14/14] x86/alternative: Replace the old macros
> > config: x86_64-buildonly-randconfig-r001-20211209 (https://download.01.org/0day-ci/archive/20240614/202406141648.jO9qNGLa-lkp@intel.com/config)
> > compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240614/202406141648.jO9qNGLa-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202406141648.jO9qNGLa-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > >> arch/x86/kvm/kvm.o: warning: objtool: .altinstr_replacement+0xc5: call without frame pointer save/setup
> 
> That thing comes from:
> 
> SYM_FUNC_START(vmx_do_interrupt_irqoff)
>         VMX_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1
> SYM_FUNC_END(vmx_do_interrupt_irqoff)
> 
> at the end of arch/x86/kvm/vmx/vmenter.S.
> 
> I know Sean had a patchset to cleanup that gunk. Sean?

That series was just for the actual VM-Enter/VM-Exit path.  vmx_do_interrupt_irqoff()
is unrelated, it's just another asm chunk of code that happnes to live in vmenter.S
(which is obviously is a bit of a misnomer these days).

> >From reading objtool docs, those functions (vmx_do_nmi_irqoff() too AFAICT)
> should have FRAME_BEGIN/FRAME_END  but if I do that, objtool bitches
> differently:

That function does create a stack frame, just without using FRAME_BEGIN/END so
it's not dependent on using frame pointers.  Ironically, the intent is to try and
placate objtool.

IIUC, this warning just stared showing up with the alternatives changes?  Does
CALL_NOSPEC generate different code now?

.macro VMX_DO_EVENT_IRQOFF call_insn call_target
	/*
	 * Unconditionally create a stack frame, getting the correct RSP on the
	 * stack (for x86-64) would take two instructions anyways, and RBP can
	 * be used to restore RSP to make objtool happy (see below).
	 */
	push %_ASM_BP
	mov %_ASM_SP, %_ASM_BP

#ifdef CONFIG_X86_64
	/*
	 * Align RSP to a 16-byte boundary (to emulate CPU behavior) before
	 * creating the synthetic interrupt stack frame for the IRQ/NMI.
	 */
	and  $-16, %rsp
	push $__KERNEL_DS
	push %rbp
#endif
	pushf
	push $__KERNEL_CS
	\call_insn \call_target

	/*
	 * "Restore" RSP from RBP, even though IRET has already unwound RSP to
	 * the correct value.  objtool doesn't know the callee will IRET and,
	 * without the explicit restore, thinks the stack is getting walloped.
	 * Using an unwind hint is problematic due to x86-64's dynamic alignment.
	 */
	mov %_ASM_BP, %_ASM_SP
	pop %_ASM_BP
	RET
.endm

> 
> arch/x86/kvm/kvm-intel.o: warning: objtool: vmx_do_interrupt_irqoff+0xc: undefined stack state
> 
> Suggestions?



  reply	other threads:[~2024-06-14 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  8:15 [tip:x86/alternatives 14/14] arch/x86/kvm/kvm.o: warning: objtool: .altinstr_replacement+0xc5: call without frame pointer save/setup kernel test robot
2024-06-14 15:22 ` Borislav Petkov
2024-06-14 15:35   ` Sean Christopherson [this message]
2024-06-14 15:58     ` Borislav Petkov
2024-06-15  8:09     ` Borislav Petkov
2024-06-17 14:39       ` Sean Christopherson
2024-06-18 10:42   ` Peter Zijlstra
2024-06-18 10:47     ` Peter Zijlstra
2024-06-18 20:05       ` [PATCH] x86/alternatives, kvm: Fix a couple of CALLs without a frame pointer Borislav Petkov
2024-06-18 23:19         ` Sean Christopherson
2024-06-18 14:24     ` [tip:x86/alternatives 14/14] arch/x86/kvm/kvm.o: warning: objtool: .altinstr_replacement+0xc5: call without frame pointer save/setup Sean Christopherson
2024-06-18 14:47       ` Peter Zijlstra

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=ZmxjOxhPy67QOh5Q@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --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