On Thu, May 09, 2013 at 10:13:15AM -0400, Jim Ohlstein wrote:
> # sysctl hw.model
> hw.model: AMD FX(tm)-8350 Eight-Core Processor
Ahh, so it seems that this is a CPU with the LWP.
Please try the patch at the end of message.

As another workaround, which does not disable AVX support, you
could try loader tunable hw.xsave_mask=0x7.

> #0  0x00007ffffffff1e3 in ?? ()
> (gdb) info registers
> rax            0x16     22
> rbx            0x101    257
> rcx            0x7ffffffff1e3   140737488351715
> rdx            0x7fffffffc980   140737488341376
> rsi            0x1      1
> rdi            0x7fffffffc980   140737488341376
> rbp            0x7fffffffd000   0x7fffffffd000
> rsp            0x7fffffffc968   0x7fffffffc968
> r8             0x0      0
> r9             0x19     25
> r10            0x50     80
> r11            0x203    515
> r12            0x801460400      34381104128
> r13            0x0      0
> r14            0x7fffffffcfb0   140737488342960
> r15            0x7fffffffcfd0   140737488342992
> rip            0x7ffffffff1e3   0x7ffffffff1e3
> eflags         0x10203  66051
> cs             0x43     67
> ss             0x3b     59
> ds             0x0      0
> es             0x0      0
> fs             0x0      0
> gs             0x0      0
> (gdb) x/2xg 0x7fffffffc980+0x300
> 0x7fffffffcc80: 0x00007fffffffcd40      0x00000000000001c0
> (gdb) x/8xg 0x00007fffffffcd40
> 0x7fffffffcd40: 0xffffffffffffffff      0x0000000000000000
> 0x7fffffffcd50: 0x0000000000000000      0x0000000000000000
> 0x7fffffffcd60: 0x0000000000000000      0x0000000000000000
> 0x7fffffffcd70: 0x0000000000000000      0x0000000000000000

> (kgdb) x/1xw use_xsave
> 0x1:  Error accessing memory address 0x1: Bad address.
> (kgdb) x/1xg xsave_mask
> 0x4000000000000007:   Error accessing memory address 0x4000000000000007: Bad 
> address.

diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index de79baa..61ce94d 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -687,7 +687,7 @@ fpugetregs(struct thread *td)
                    offsetof(struct xstate_hdr, xstate_bv));
                max_ext_n = flsl(xsave_mask);
                for (i = 0; i < max_ext_n; i++) {
-                       bit = 1 << i;
+                       bit = 1ULL << i;
                        if ((*xstate_bv & bit) != 0)
                                continue;
                        bcopy((char *)fpu_initialstate +

Attachment: pgpT0LzYN0QsN.pgp
Description: PGP signature

Reply via email to