mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: x86@kernel.org, Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/kvm: Add stack frame dependency to fastop() inline asm
Date: Thu, 14 Apr 2016 15:00:33 -0500	[thread overview]
Message-ID: <20160414200033.xfj6at7lynyhmpnm@treble> (raw)
In-Reply-To: <2eeab7cf095b6188b4ebd0e09a4483ddcb01066b.1457549946.git.jpoimboe@redhat.com>

Hi Ingo,

Ping?

On Wed, Mar 09, 2016 at 12:59:50PM -0600, Josh Poimboeuf wrote:
> The kbuild test robot reported this objtool warning [1]:
> 
>   arch/x86/kvm/emulate.o: warning: objtool: fastop()+0x69: call without frame pointer save/setup
> 
> The issue seems to be caused by CONFIG_PROFILE_ALL_BRANCHES.  With that
> option, for some reason gcc decides not to create a stack frame in
> fastop() before doing the inline asm call, which can result in a bad
> stack trace.
> 
> Force a stack frame to be created if CONFIG_FRAME_POINTER is enabled by
> listing the stack pointer as an output operand for the inline asm
> statement.
> 
> This change has no effect for !CONFIG_PROFILE_ALL_BRANCHES.
> 
> [1] https://lists.01.org/pipermail/kbuild-all/2016-March/018249.html
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  arch/x86/kvm/emulate.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 0f62943..a2f24af 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -5110,13 +5110,17 @@ static void fetch_possible_mmx_operand(struct x86_emulate_ctxt *ctxt,
>  
>  static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
>  {
> +	register void *__sp asm(_ASM_SP);
>  	ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF;
> +
>  	if (!(ctxt->d & ByteOp))
>  		fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE;
> +
>  	asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n"
>  	    : "+a"(ctxt->dst.val), "+d"(ctxt->src.val), [flags]"+D"(flags),
> -	      [fastop]"+S"(fop)
> +	      [fastop]"+S"(fop), "+r"(__sp)
>  	    : "c"(ctxt->src2.val));
> +
>  	ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);
>  	if (!fop) /* exception is returned in fop variable */
>  		return emulate_de(ctxt);
> -- 
> 2.4.3
> 

-- 
Josh

  reply	other threads:[~2016-04-14 20:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 18:59 Josh Poimboeuf
2016-04-14 20:00 ` Josh Poimboeuf [this message]
2016-04-15  9:40   ` Ingo Molnar
2016-04-25 16:11     ` Josh Poimboeuf
2016-05-09 16:58       ` Paolo Bonzini

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=20160414200033.xfj6at7lynyhmpnm@treble \
    --to=jpoimboe@redhat.com \
    --cc=gleb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --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®