From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752534AbdJDPQl (ORCPT ); Wed, 4 Oct 2017 11:16:41 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35325 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbdJDPQk (ORCPT ); Wed, 4 Oct 2017 11:16:40 -0400 X-Google-Smtp-Source: AOwi7QAvi/yssca2XMBjAhhzRnhIoZY0mD7Af6nnORrKdolMCVNQDd6C1FP/5Pe6E9NzQV13xcjEfw== Date: Wed, 4 Oct 2017 08:16:36 -0700 From: Guenter Roeck To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/kvm: Move kvm_fastop_exception to .fixup section Message-ID: <20171004151636.GA30935@roeck-us.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2017 at 09:43:06AM -0500, 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 > Signed-off-by: Josh Poimboeuf Thanks! Guenter > --- > 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) > -- > 2.13.6 >