[Pkg-xen-devel] Bug#649349: Bug#649349: xen-hypervisor-4.1-amd64: pygrub fails due to invalid opcode trapped

Ian Campbell ijc at hellion.org.uk
Wed Nov 23 14:08:15 UTC 2011


On Tue, 2011-11-22 at 21:14 +0100, Alexandre Vaissière wrote:
> Le 22/11/2011 14:55, Ian Campbell a écrit :
> > On Tue, 2011-11-22 at 13:18 +0000, Ian Campbell wrote:
> >> Looking at the eglibc source (2.13-21) x86_64/dl-trampoline.S:139 is:
> >>         vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE 
> > This appears to be an AVX instruction which none of my test systems
> > appear to support which is probably why I cannot reproduce this.
> >
> > Which dom0 kernel are you running?
> % uname -a
> Linux glamdring 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011 x86_64
> GNU/Linux
> 
> > If you boot the same kernel natively what happens when you run pygrub?
> > (this should work natively, although obviously you won't be able to
> > actually start a VM).
> Yes it does work: I see the grub interface.

What happens if you pass "noxsave" to the native kernel?

I think the underlying bug here is that libc is only checking for the
AVX cpuid feature bit but the presence of that bit does not necessarily
imply that the OS is prepared to deal with userspace using AVX.

The Intel manuals[0] suggest (in section 13.5 "DETECTION OF AVX
INSTRUCTIONS") that the appropriate sequence to use from userspace to
detect AVX is:
     1. Detect CPUID.1:ECX.OSXSAVE[bit 27] = 1 (XGETBV enabled for
        application use1)
     2. Issue XGETBV and verify that XCR0[2:1] = ‘11b’ (XMM state and
        YMM state are enabled by OS).
     3. detect CPUID.1:ECX.AVX[bit 28] = 1 (AVX instructions supported).

glibc currently only does #3.

If I am right then using "noxsave" on native should demonstrate the
issue as well and show that there is a bug in libc.

However that doesn't rule out a bug in the hypervisor as well since it
should support xsave... except I've just noticed that xsave is
deliberately disabled in Xen 4.1!

It has been re-enabled in xen-unstable with the comment "re-enable xsave
by default now that it supports live migration" (so it will work in 4.2
when it is released). This suggests that you could try with "xsave=1" on
your hypervisor command line (but that migration won't work).

[0]
http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-manual-325462-rmver.html

Ian.


-- 
Ian Campbell
Current Noise: Callenish Circle - Soul Messiah

Writing free verse is like playing tennis with the net down.






More information about the Pkg-xen-devel mailing list