public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Bandan Das <bsd@redhat.com>, Nadav Amit <nadav.amit@gmail.com>
Subject: Re: [PATCH v2 4/4] KVM: x86: emulate FXSAVE and FXRSTOR
Date: Thu, 3 Nov 2016 14:58:50 +0100	[thread overview]
Message-ID: <20161103135850.GD7771@potion> (raw)
In-Reply-To: <201611030741.7Je7TG1V%fengguang.wu@intel.com>

2016-11-03 07:58+0800, kbuild test robot:
> Hi Radim,
> 
> [auto build test ERROR on kvm/linux-next]
> [also build test ERROR on v4.9-rc3 next-20161028]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
> 
> url:    https://github.com/0day-ci/linux/commits/Radim-Kr-m/KVM-x86-emulate-FXSAVE-and-FXRSTOR/20161103-025333
> base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
> config: x86_64-randconfig-s2-11030650 (attached as .config)
> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7

Oh well ...
I dug out a RHEL6.9 machine with "gcc (GCC) 4.4.7 20120313 (Red Hat
4.4.7-18)" and it doesn't compile either, but for a different reason:

> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 

    CC [M]  arch/x86/kvm/emulate.o
  arch/x86/kvm/emulate.c: Assembler messages:
  arch/x86/kvm/emulate.c:3931: Error: no such instruction: `fxsave64 -544(%rbp)'
  arch/x86/kvm/emulate.c:3990: Error: no such instruction: `fxrstor64 -528(%rbp)'
  make[1]: *** [arch/x86/kvm/emulate.o] Error 1
  make: *** [_module_arch/x86/kvm] Error 2

so I wrote the REX.W manually, ".byte 48; fxsave %[fx]", and then the
compilation succeeded:

    CC [M]  arch/x86/kvm/emulate.o
  arch/x86/kvm/emulate.o: warning: objtool: read_sse_reg()+0xb6: function has unreachable instruction

(The output was riddled with warnings about unreachable instructions.)

> All errors (new ones prefixed by >>):
> 
>    arch/x86/kvm/emulate.c: In function 'em_fxsave':
> >> arch/x86/kvm/emulate.c:3931: error: expected string literal before ')' token
>    arch/x86/kvm/emulate.c:3934: error: expected string literal before ')' token
>    arch/x86/kvm/emulate.c: In function 'fx_load_64bit_xmm':
>    arch/x86/kvm/emulate.c:3953: error: expected string literal before ')' token
>    arch/x86/kvm/emulate.c: In function 'em_fxrstor':
>    arch/x86/kvm/emulate.c:3990: error: expected string literal before ')' token
>    arch/x86/kvm/emulate.c:3994: error: expected string literal before ')' token
> 
> vim +3931 arch/x86/kvm/emulate.c
> > 3931			rc = asm_safe("fxsave64 %[fx]", , [fx] "+m"(fx_state) ::);

Seems like it expects something in the clobber list ... maybe it would
work with

  rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));

I'll install old Debian and send a fix for both issues.
The fix will drop emulation of protected modes, so we won't need the
fxsave64 instruction.

      reply	other threads:[~2016-11-03 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 18:45 [PATCH v2 0/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-02 18:45 ` [PATCH v2 1/4] KVM: x86: add Align16 instruction flag Radim Krčmář
2016-11-02 18:45 ` [PATCH v2 2/4] KVM: x86: save one bit in ctxt->d Radim Krčmář
2016-11-02 18:45 ` [PATCH v2 3/4] KVM: x86: add asm_safe wrapper Radim Krčmář
2016-11-02 18:45 ` [PATCH v2 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-02 23:58   ` kbuild test robot
2016-11-03 13:58     ` Radim Krčmář [this message]

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=20161103135850.GD7771@potion \
    --to=rkrcmar@redhat.com \
    --cc=bsd@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nadav.amit@gmail.com \
    --cc=pbonzini@redhat.com \
    /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