[LLVMbugs] [Bug 3402] New: sse cannot be turned off for x86-64 -> linux kernel panics

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jan 25 05:35:53 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3402

           Summary: sse cannot be turned off for x86-64 -> linux kernel
                    panics
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


[    0.004000] Call Trace:
[    0.004000]  [<ffffffff80212f37>] init_fpu+0x107/0x140
[    0.004000]  [<ffffffff8020d449>] math_state_restore+0x89/0xc0
[    0.004000]  [<ffffffff805950c9>] do_device_not_available+0x9/0x10
[    0.004000]  [<ffffffff8020cfe5>] device_not_available+0x15/0x20
[    0.004000]  [<ffffffff80472c69>] ? uart_set_options+0x9/0xe0
[    0.004000]  [<ffffffff8047557f>] ? uart_parse_options+0x2f/0xa0
[    0.004000]  [<ffffffff80732ee8>] serial8250_console_setup+0xa8/0xc0
[    0.004000]  [<ffffffff80239676>] register_console+0x216/0x300
[    0.004000]  [<ffffffff8073306b>] serial8250_console_init+0x2b/0x30
[    0.004000]  [<ffffffff8073208f>] console_init+0x22/0x36
[    0.004000]  [<ffffffff80713a76>] start_kernel+0x22b/0x3e4
[    0.004000]  [<ffffffff80713284>] x86_64_start_reservations+0x94/0xb9
[    0.004000]  [<ffffffff8071337c>] x86_64_start_kernel+0xd3/0xda
[    0.004000] Code: 00 00 00 00 00 55 48 89 e5 48 83 ec 20 4c 89 6c 24 10 48
89 1c 24 4c 89 64 24 08 4c 89 74 24 18 41 89 f5 48 8b 4d 08 9c 41 5c fa <48> 8b
9f e0 00 00 00 44 8b b7 f8 00 00 00 48 85 db 74 47 8b 87
[    0.004000] RIP  [<ffffffff802b57d6>] kmem_cache_alloc+0x26/0xa0

init_fpu gave me a hint, and looking at the disassembly confirmed it:
ffffffff80472c60 <uart_set_options>:
ffffffff80472c60:       55                      push   %rbp
ffffffff80472c61:       48 89 e5                mov    %rsp,%rbp
ffffffff80472c64:       53                      push   %rbx
ffffffff80472c65:       48 83 ec 38             sub    $0x38,%rsp
ffffffff80472c69:       0f 57 c0                xorps  %xmm0,%xmm0
ffffffff80472c6c:       0f 29 45 d0             movaps %xmm0,-0x30(%rbp)
ffffffff80472c70:       0f 29 45 c0             movaps %xmm0,-0x40(%rbp)

The kernel is built (on purpose) with -mno-sse -mno-mmx -mno-sse2 -mno-3dnow,
however llvm-gcc didn't take that into consideration.

Testcase:
/* llvm-gcc -m64 -O1 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -S < %s | not grep
xmm0 */
typedef unsigned long __kernel_size_t;
typedef __kernel_size_t size_t;
void *memset(void *s, int c, size_t n);

typedef unsigned char cc_t;
typedef unsigned int speed_t;
typedef unsigned int tcflag_t;

struct ktermios {
 tcflag_t c_iflag;
 tcflag_t c_oflag;
 tcflag_t c_cflag;
 tcflag_t c_lflag;
 cc_t c_line;
 cc_t c_cc[19];
 speed_t c_ispeed;
 speed_t c_ospeed;
};
void bar(struct ktermios*);
void foo()
{
    struct ktermios termios;
    memset(&termios, 0, sizeof(termios));
    bar(&termios);
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list