From owner-freebsd-current@freebsd.org Thu Sep 26 20:12:36 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D64F1330F5 for ; Thu, 26 Sep 2019 20:12:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fR1H3vddz3Q49 for ; Thu, 26 Sep 2019 20:12:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f68.google.com with SMTP id o44so256840ota.10 for ; Thu, 26 Sep 2019 13:12:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IIw71Ak2d0v055iD5+SoCuCVpA4FXtkeVCr/V7bXQ70=; b=Kmf8M91dVhpgXUta81xfvV8+q/+mcPEuqfWzo7hvT+O6h2LKZeNJzswv6V38f/LVXI Ry1IId7CXjeIPCkPk879hxItHEBMl1sWEHLgsmWN13LvCAWoT9DRq4SAzLy9h+LZCliV C03JiOnDKGO2wcuczy0Ca9Rn8CpBIex+ZnEinWaztZ6YYXsQiNO40aOhBRzBprA64ScO hPINeuRJHwfo2+SiiYLPTT//kLSIRyIH0kSrY8sPFRYT+hgkFkwsv0loDz/d9I+y0Twp SIBvguVyBRglM6UvB4WJhazVbChHxPZHs+m15M1sbJmICThRMG4AQlxlAv7Xpse4YvGS qkpA== X-Gm-Message-State: APjAAAU32B1MJbkCGu0N51gFzj9/6h470f/e1Yl2sUqRKAG6OmsSSGR5 xcWM7mR7/8Do6Sfel/ut6pAWeoQuJ2wy5Grka2k= X-Google-Smtp-Source: APXvYqx1SB7NVEopcFYHiEH5VXO6fKWI5jsv2FP5Xh1Jk9PvRGoqiPhKbPTin/NwkcNJbIs15gvdo9h2C5LmK8eFUgM= X-Received: by 2002:a9d:378a:: with SMTP id x10mr408291otb.222.1569528752514; Thu, 26 Sep 2019 13:12:32 -0700 (PDT) MIME-Version: 1.0 References: <20190926170241.GG44691@kib.kiev.ua> <20190926172924.GH44691@kib.kiev.ua> In-Reply-To: <20190926172924.GH44691@kib.kiev.ua> From: Alan Somers Date: Thu, 26 Sep 2019 14:12:21 -0600 Message-ID: Subject: Re: panic: Unregistered use of FPU in kernel To: Konstantin Belousov Cc: FreeBSD CURRENT X-Rspamd-Queue-Id: 46fR1H3vddz3Q49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.68 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[68.210.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; URI_COUNT_ODD(1.00)[3]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[68.210.85.209.list.dnswl.org : 127.0.5.0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-1.10)[ipnet: 209.85.128.0/17(-3.29), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2019 20:12:36 -0000 On Thu, Sep 26, 2019 at 11:29 AM Konstantin Belousov wrote: > On Thu, Sep 26, 2019 at 11:20:51AM -0600, Alan Somers wrote: > > On Thu, Sep 26, 2019 at 11:02 AM Konstantin Belousov < > kostikbel@gmail.com> > > wrote: > > > > > On Thu, Sep 26, 2019 at 09:45:43AM -0600, Alan Somers wrote: > > > > The latest VM snapshot > > > (FreeBSD-13.0-CURRENT-amd64-20190920-r352544.qcow2) > > > > instapanics on boot: > > > > > > > > panic: Unregistered use of FPU in kernel > > > > > > > > stack trace: > > > > ... > > > > sse42_crc32c > > > > readsuper > > > > ffs_sbget > > > > g_label_ufs_taste_common > > > > g_label_taste > > > > g_new_provider_event > > > > g_run_events > > > > fork_exit > > > > ... > > > > > > > > Has anybody touched this area recently? I'll try to narrow down the > > > commit > > > > range. > > > > > > Start with disassembling the faulting instruction. I suspect that > somehow > > > vital compiler switches like -mno-sse got omitted in the build. > > > > > > > No problem with compiler switches here. The C file uses inline assembly > to > > generate a crc32q instruction, in crc32_sse42.c:257. But why would that > > generate a floating point exception? The instruction doesn't appear to > be > > using any floating point registers. This is on a Kaby Lake CPU. > > > > crc32q %rsi, %rbx > > No idea, this instruction does not generate #NP at all. > > Provide exact script of the panic and backtrace, > together with the disassembly of the function which contained the faulted > instruction. Do disassemble from ddb, in case text was corrupted. > Ok, here's the full stack trace: #0 __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55 #1 doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:392 #2 0xffffffff804a1edb in db_dump (dummy=, dummy2=, dummy3=, dummy4=) at /usr/src/sys/ddb/db_command.c:575 #3 0xffffffff804a1c8f in db_command (last_cmdp=, cmd_table=, dopager=1) at /usr/src/sys/ddb/db_command.c:482 #4 0xffffffff804a1a04 in db_command_loop () at /usr/src/sys/ddb/db_command.c:535 #5 0xffffffff804a4cbf in db_trap (type=, code=) at /usr/src/sys/ddb/db_main.c:252 #6 0xffffffff80c1e55c in kdb_trap (type=3, code=0, tf=) at /usr/src/sys/kern/subr_kdb.c:692 #7 0xffffffff811957df in trap (frame=0xfffffe00907e8d20) at /usr/src/sys/amd64/amd64/trap.c:621 #8 Your guess about corrupted text was prescient. Here is the disassembly according to ddb: https://people.freebsd.org/~asomers/Screenshot_fbsd-head_2019-09-26_13%3A51%3A34.png And here is the disassembly of the same section according to gdb: 0xffffffff8113b2e0 : mov %rsi,%r9 0xffffffff8113b2e3 : sub $0xffffffffffffff80,%r9 0xffffffff8113b2e7 : add $0x100,%rsi 0xffffffff8113b2ee : mov %r11,%rbx 0xffffffff8113b2f1 : xor %eax,%eax 0xffffffff8113b2f3 : xor %r11d,%r11d 0xffffffff8113b2f6 : nopw %cs:0x0(%rax,%rax,1) 0xffffffff8113b300 : mov %rsi,%rdx 0xffffffff8113b303 : mov -0x100(%rsi),%rsi 0xffffffff8113b30a : mov -0x80(%rdx),%rdi 0xffffffff8113b30e : crc32q %rsi,%rbx 0xffffffff8113b314 : crc32q %rdi,%rax 0xffffffff8113b31a : mov (%rdx),%rsi 0xffffffff8113b31d : crc32q %rsi,%r11 0xffffffff8113b323 : lea 0x8(%rdx),%rsi 0xffffffff8113b327 : add $0xffffffffffffff08,%rdx 0xffffffff8113b32e : cmp %r9,%rdx 0xffffffff8113b331 : jb 0xffffffff8113b300 0xffffffff8113b333 : movzbl %cl,%r9d 0xffffffff8113b337 : movzbl %ch,%edi 0xffffffff8113b33a : mov %ecx,%edx Care to guess what's causing the corruption? -Alan