kvm.vger.kernel.org archive mirror
 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 v4] KVM: x86: emulate FXSAVE and FXRSTOR
Date: Wed, 9 Nov 2016 19:46:28 +0100	[thread overview]
Message-ID: <20161109184628.GB8015@potion> (raw)
In-Reply-To: <201611100214.Cw6eiUij%fengguang.wu@intel.com>

2016-11-10 02:42+0800, kbuild test robot:
> Hi Radim,

And I even replied to the series, so this would happen ...
Btw. would the tool recognize it if the header was [PATCH v4 4/4]?

> [auto build test ERROR on kvm/linux-next]
> [also build test ERROR on v4.9-rc4 next-20161109]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Radim-Kr-m/KVM-x86-emulate-FXSAVE-and-FXRSTOR/20161110-021048
> base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
> config: x86_64-randconfig-x018-201645 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>    arch/x86/kvm/emulate.c: In function 'em_fxsave':
> >> arch/x86/kvm/emulate.c:3910:7: error: implicit declaration of function 'asm_safe' [-Werror=implicit-function-declaration]
>      rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
>           ^~~~~~~~
> >> arch/x86/kvm/emulate.c:3910:32: error: expected expression before ',' token
>      rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
>                                    ^
> >> arch/x86/kvm/emulate.c:3910:35: error: 'fx' undeclared (first use in this function)
>      rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
>                                       ^~
>    arch/x86/kvm/emulate.c:3910:35: note: each undeclared identifier is reported only once for each function it appears in
>    arch/x86/kvm/emulate.c: In function 'fxrstor_fixup':
>    arch/x86/kvm/emulate.c:3931:32: error: expected expression before ',' token
>      rc = asm_safe("fxsave %[fx]", , [fx] "+m"(old));
>                                    ^
>    arch/x86/kvm/emulate.c:3931:35: error: 'fx' undeclared (first use in this function)
>      rc = asm_safe("fxsave %[fx]", , [fx] "+m"(old));
>                                       ^~
>    arch/x86/kvm/emulate.c: In function 'em_fxrstor':
> >> arch/x86/kvm/emulate.c:3977:34: error: expected expression before ':' token
>       rc = asm_safe("fxrstor %[fx]", : [fx] "m"(fx_state));
>                                      ^
>    arch/x86/kvm/emulate.c: At top level:
> >> arch/x86/kvm/emulate.c:4336:12: error: 'Aligned16' undeclared here (not in a function)
>      I(ModRM | Aligned16, em_fxsave),
>                ^
>    arch/x86/kvm/emulate.c:4185:31: note: in definition of macro 'I'
>     #define I(_f, _e) { .flags = (_f), .u.execute = (_e) }
>                                   ^~
>    cc1: some warnings being treated as errors
> 
> vim +/asm_safe +3910 arch/x86/kvm/emulate.c
> 
>   3904		rc = check_fxsr(ctxt);
>   3905		if (rc != X86EMUL_CONTINUE)
>   3906			return rc;
>   3907	
>   3908		ctxt->ops->get_fpu(ctxt);
>   3909	
> > 3910		rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
>   3911	
>   3912		ctxt->ops->put_fpu(ctxt);
>   3913	
>   3914		if (rc != X86EMUL_CONTINUE)
>   3915			return rc;
>   3916	
>   3917		if (ctxt->ops->get_cr(ctxt, 4) & X86_CR4_OSFXSR)
>   3918			size = offsetof(struct fxregs_state, xmm_space[8 * 16/4]);
>   3919		else
>   3920			size = offsetof(struct fxregs_state, xmm_space[0]);
>   3921	
>   3922		return segmented_write(ctxt, ctxt->memop.addr.mem, &fx_state, size);
>   3923	}
>   3924	
>   3925	static int fxrstor_fixup(struct x86_emulate_ctxt *ctxt,
>   3926			struct fxregs_state *new)
>   3927	{
>   3928		int rc = X86EMUL_CONTINUE;
>   3929		struct fxregs_state old;
>   3930	
> > 3931		rc = asm_safe("fxsave %[fx]", , [fx] "+m"(old));
>   3932		if (rc != X86EMUL_CONTINUE)
>   3933			return rc;
>   3934	
>   3935		/*
>   3936		 * 64 bit host will restore XMM 8-15, which is not correct on non-64
>   3937		 * bit guests.  Load the current values in order to preserve 64 bit
>   3938		 * XMMs after fxrstor.
>   3939		 */
>   3940	#ifdef CONFIG_X86_64
>   3941		/* XXX: accessing XMM 8-15 very awkwardly */
>   3942		memcpy(&new->xmm_space[8 * 16/4], &old.xmm_space[8 * 16/4], 8 * 16);
>   3943	#endif
>   3944	
>   3945		/*
>   3946		 * Hardware doesn't save and restore XMM 0-7 without CR4.OSFXSR, but
>   3947		 * does save and restore MXCSR.
>   3948		 */
>   3949		if (!(ctxt->ops->get_cr(ctxt, 4) & X86_CR4_OSFXSR))
>   3950			memcpy(new->xmm_space, old.xmm_space, 8 * 16);
>   3951	
>   3952		return rc;
>   3953	}
>   3954	
>   3955	static int em_fxrstor(struct x86_emulate_ctxt *ctxt)
>   3956	{
>   3957		struct fxregs_state fx_state;
>   3958		int rc;
>   3959	
>   3960		rc = check_fxsr(ctxt);
>   3961		if (rc != X86EMUL_CONTINUE)
>   3962			return rc;
>   3963	
>   3964		rc = segmented_read(ctxt, ctxt->memop.addr.mem, &fx_state, 512);
>   3965		if (rc != X86EMUL_CONTINUE)
>   3966			return rc;
>   3967	
>   3968		if (fx_state.mxcsr >> 16)
>   3969			return emulate_gp(ctxt, 0);
>   3970	
>   3971		ctxt->ops->get_fpu(ctxt);
>   3972	
>   3973		if (ctxt->mode < X86EMUL_MODE_PROT64)
>   3974			rc = fxrstor_fixup(ctxt, &fx_state);
>   3975	
>   3976		if (rc == X86EMUL_CONTINUE)
> > 3977			rc = asm_safe("fxrstor %[fx]", : [fx] "m"(fx_state));
>   3978	
>   3979		ctxt->ops->put_fpu(ctxt);
>   3980	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

  reply	other threads:[~2016-11-09 18:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 19:54 [PATCH v3 0/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 1/4] KVM: x86: add Align16 instruction flag Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 2/4] KVM: x86: save one bit in ctxt->d Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 3/4] KVM: x86: add asm_safe wrapper Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-08 23:25   ` Paolo Bonzini
2016-11-09 12:12     ` Radim Krčmář
2016-11-09 14:19       ` Radim Krčmář
2016-11-09 18:07   ` [PATCH v4] " Radim Krčmář
2016-11-09 18:42     ` kbuild test robot
2016-11-09 18:46       ` Radim Krčmář [this message]
2016-11-10  2:47         ` Fengguang Wu

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=20161109184628.GB8015@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;
as well as URLs for NNTP newsgroup(s).