mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Josh Poimboeuf" <jpoimboe@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] x86/kvm: Move kvm_fastop_exception to .fixup section
Date: Thu, 5 Oct 2017 08:54:40 +0200	[thread overview]
Message-ID: <af42f6b9-7253-3937-7f00-483da992f9cd@redhat.com> (raw)
In-Reply-To: <e974660207b99b822309c09365bf953080131791.1507131424.git.jpoimboe@redhat.com>

On 04/10/2017 17:39, Josh Poimboeuf wrote:
> When compiling the kernel with the '-frecord-gcc-switches' flag, objtool
> complains:
> 
>   arch/x86/kvm/emulate.o: warning: objtool: .GCC.command.line+0x0: special: can't find new instruction
> 
> And also the kernel fails to link.
> 
> The problem is that the 'kvm_fastop_exception' code gets placed into the
> throwaway '.GCC.command.line' section instead of '.text'.
> 
> Exception fixup code is conventionally placed in the '.fixup' section,
> so put it there where it belongs.
> 
> Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  arch/x86/kvm/emulate.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index a36254cbf776..d90cdc77e077 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -425,8 +425,10 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *));
>  	#op " %al \n\t" \
>  	FOP_RET
>  
> -asm(".global kvm_fastop_exception \n"
> -    "kvm_fastop_exception: xor %esi, %esi; ret");
> +asm(".pushsection .fixup, \"ax\"\n"
> +    ".global kvm_fastop_exception \n"
> +    "kvm_fastop_exception: xor %esi, %esi; ret\n"
> +    ".popsection");
>  
>  FOP_START(setcc)
>  FOP_SETCC(seto)
> 


Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2017-10-05  6:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 15:39 Josh Poimboeuf
2017-10-05  6:54 ` Paolo Bonzini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-10-04 14:43 Josh Poimboeuf
2017-10-04 15:16 ` Guenter Roeck
2017-10-04 15:36   ` Josh Poimboeuf

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=af42f6b9-7253-3937-7f00-483da992f9cd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rkrcmar@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®