From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbdJEGyy (ORCPT ); Thu, 5 Oct 2017 02:54:54 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34410 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751266AbdJEGyw (ORCPT ); Thu, 5 Oct 2017 02:54:52 -0400 X-Google-Smtp-Source: AOwi7QByFrQuASLpA0CtWeosnDYTEcIBZD6i8gj1niNVhLsXOkhj62C566vLV+0W6kMT9pPuuv+REQ== Subject: Re: [PATCH] x86/kvm: Move kvm_fastop_exception to .fixup section To: Josh Poimboeuf , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Guenter Roeck References: From: Paolo Bonzini Message-ID: Date: Thu, 5 Oct 2017 08:54:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Josh Poimboeuf > --- > 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