Received: by 10.223.185.116 with SMTP id b49csp1184032wrg; Wed, 21 Feb 2018 13:42:06 -0800 (PST) X-Google-Smtp-Source: AH8x227TPltQ3RziAYcdvrcmFj8Uup+BAjy6hfa9GfW3TXQnOzV4sg5WArP7Q2CJOf8LWsANiJGO X-Received: by 10.101.66.129 with SMTP id j1mr3727057pgp.56.1519249326132; Wed, 21 Feb 2018 13:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519249326; cv=none; d=google.com; s=arc-20160816; b=oixm5s01vV6JfYkSO5icRhOez1ulnCp4uojFO1ikTyiUNVjH2dOrDsLeHmPiDUFEeU YNNvMOhB8WhdgDeIy1C5Cdi/r+3Jr1FotPyOmU2cpgJvCG423xvaPyb7sL5rnhohh9Ay NMZIkb1sso2ygxrffdDoR8vO1t6BQz6+64ky1alHn/0ByNSYuFBFHf+8DDLtmZYWW8OH iC9x1yDv9JLKSFCwgeKmZ0Qiqcj+y665mzmtNRPlL2vuCjy3yHQ9Z6gk8vpZPsv/hBDy mGZ5ja/RFFwVg4jlaF5a+gcCVCbGnYT9X7q2kRKOIrOtb8HUK/wax0GqMxS0K8MKwtDE lC7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=OREjpIcqA4q33AsOiL1yw3Vhpl2J1YyyCAcEWwDAlwg=; b=N/Ii/oiaNxlfe2uCbhEBP5WduTEHzTZtXLyuZmF2aYof0TjSwNKPyIuA+ywMLx9zqU P8RB6ib2V0Sdzyat7tLkRIWVhyXTB7c6RJkG5m2Q8mN22rJz1IwL+T2Xi4PU7F9hlGYv m2gGDINsXQkG7oYnEIb+XujSED0PeEfJmh7o0B0xoDQDsuxAFl2IjO6Nlt9sYUG5tVrQ lzoGN6+Bl0AzMSIVvKdVYD8sg1h/bLxbUClnHKNIMgpHS22tXgRKck017pEtAwteBFuA XFdJGb1/kSX8IuwFhN//qKpxZ9HyQEEHdjIK1G7qJIHgxV981ReWAW7iqvHNUxDkNMFo +VIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nxRdnf2g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si7862113plb.68.2018.02.21.13.41.51; Wed, 21 Feb 2018 13:42:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=nxRdnf2g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbeBUVjz (ORCPT + 99 others); Wed, 21 Feb 2018 16:39:55 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:33899 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330AbeBUVjy (ORCPT ); Wed, 21 Feb 2018 16:39:54 -0500 Received: by mail-it0-f41.google.com with SMTP id a203so10090490itd.1 for ; Wed, 21 Feb 2018 13:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OREjpIcqA4q33AsOiL1yw3Vhpl2J1YyyCAcEWwDAlwg=; b=nxRdnf2gykd/kV+SwGUI+CMeLLrTHufE6A4aprDkNdJC0HzXqMloxbuLsbfmiEkYh8 7ueaaQN6q2W2AbokiH11GCLaWfIvplxvkbXlUqWNqQybYSwb0Kjf83KTUdqTvFc6z+6Y uHgdVEKC9IdRrB1pFhnAeVAAlwL0ioERXlppMq0u8zldHJxq22f2cx5Z5vVEqyB63+GV Qd4BzwnUQj/fRdjoOMbPkX2+hbcRBY5rrScBw6+0q0TdihjKpJqqNnm+PRAhr8kL6k1+ xK/bGik0KLX3fWq153rHAFVK2xy9FEFK1qQ2t7cq4/8i2FW9PEI5Hza1FSCTRKe+4KgY A88A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OREjpIcqA4q33AsOiL1yw3Vhpl2J1YyyCAcEWwDAlwg=; b=Z/UnjdwWuOhQtetFYEJVpyi6JU4nvkwPjW2y1t3ceOiozelJDNmZEG/xseEc59mwQ1 Fe8EJaT6bw0m0xRclck7UmbNXaebgMqavM02FkTKJTD+pFK7MOn63BKaesdWjcChtSn4 wms9uDMsVFZX0vpvUR+CK5mj5s8fZW4925rDbFUKQPjIYYufZ4ica3j+0FnDWLFB+7j5 caw92JvtXjN4VGti8kYob4jaLGBMii1GX70u9lVucntMg5U8EMv7D5Ky/Ec/ZLijJ9/K Bb6kS329l+ymeLaDcBv4DWUtNb04CCT52Nzo00chFM8KlJrmBkJFNIWArIQFCpwhA5A/ G1Dw== X-Gm-Message-State: APf1xPBSCv1afbk44v5c9nEcsyMLf9XNixD1cGtRol+ZQ+LCTkrpbhHr P23S965JCrJlgJn8EuuDoGfpZ78BnJLFxPhbWTw= X-Received: by 10.36.89.13 with SMTP id p13mr5143380itb.16.1519249193344; Wed, 21 Feb 2018 13:39:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Wed, 21 Feb 2018 13:39:52 -0800 (PST) In-Reply-To: <20180221175429.GC9989@pd.tnic> References: <20180219202826.19797-1-bp@alien8.de> <20180220192956.si2a6m3ckskexvte@treble> <20180220204435.GC24320@pd.tnic> <20180221091553.gxnvhbitiewo2mjc@gmail.com> <20180221175429.GC9989@pd.tnic> From: Linus Torvalds Date: Wed, 21 Feb 2018 13:39:52 -0800 X-Google-Sender-Auth: MmP30eyoL4QTN_Wu9FFRetwJKZI Message-ID: Subject: Re: [PATCH 0/5] x86/dumpstack: Cleanups and user opcode bytes Code: section To: Borislav Petkov Cc: Ingo Molnar , Josh Poimboeuf , Andy Lutomirski , X86 ML , Peter Zijlstra , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 21, 2018 at 9:54 AM, Borislav Petkov wrote: > > Ok, lemme run it by Linus too as he probably stares at this part of the > output a *lot* :-) Less than I used to, since there are others who are pretty good at decoding them, but yes... > Anyway, here's a 64-bit splat. I'm basically dumping opcode bytes > everytime we dump RIP. So I think that's probably a good idea, but the way it ends up being repeated is really confusing. Particularly when you now do it for the user code too - which might be occasionally useful, but your example also shows how there are now _three_ code lines due to the duplication at the end (for "maybe the first one scrolled off the screen" and the user code). And the "executive summary" used to be a dense one-liner (to not scroll the non-summary away), now it's generally four lines on the screen (you also made the RIP/RSP be now two lines, and the Code line is usually two lines because it's so long). So my gut feel is that yes, this is moving in the right direction, but I also really think that it now makes the normal oops too big to fit on a screen. That matters, because we still end up having the "take a picture of the oops" issue for hard hangs etc that don't survive in the logs. Do I know what the right answer is? No. But I suspect at the very least we would want to get rid of the RSP line from show_ip(), and make that part of the regular regs. That would make the summary one line less. Hmm. The Code: line actually ends up being *three* lines on the default 80x25 screen, so in your 64-bit example, you actually get something like this: ? preempt_count_sub+0xa8/0x100 vfs_write+0xc0/0x190 SyS_write+0x64/0xe0 ? trace_hardirqs_off_thunk+0x1a/0x1c do_syscall_64+0x76/0x140 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x7ffff74b9620 RSP: 002b:00007fffffffe7a8 EFLAGS: 00000246 Code: ff 73 01 c3 48 8b 0d 68 98 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d bd f1 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ce 8f 01 00 48 89 04 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007ffff74b9620 RDX: 0000000000000002 RSI: 0000000000705408 RDI: 0000000000000001 RBP: 0000000000705408 R08: 000000000000000a R09: 00007ffff7fdb700 R10: 00007ffff77826a0 R11: 0000000000000246 R12: 00007ffff77842a0 R13: 0000000000000002 R14: 0000000000000001 R15: 0000000000000000 RIP: 0010:sysrq_handle_crash+0x17/0x20 RSP: 0018:ffffc90000c23df0 EFLAGS: 00010246 Code: eb d1 e8 fd ca b6 ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 e8 f6 de bc ff c7 05 84 0d 1a 01 01 00 00 00 0f ae f8 04 25 00 00 00 00 01 c3 0f 1f 44 00 00 e8 86 df c1 ff fb 66 CR2: 0000000000000000 ---[ end trace e17dc9a4aa5cc4d9 ]--- Kernel panic - not syncing: Fatal exception showing with a hung kernel. And most of the above is actually completely useless. Those are the *usermode* registers it shows, not the kernel registers at the time of the crash (the final rip/rsp/code lines are for the actual kernel crash, but I'm talking about the register dump above it). So notice how most of the *useful* data has actually scrolled off the screen and is all gone because the machine is hung. Instead, we've added stuff that doesn't help at all, usually. It's not just that last patch, obviously. The big hunk o fuser register dumping is actually from Josh's trace improvements. But the above really is a great example of how we have made oopses *harder* to read by trying to add more data. They have gotten messier, but they have also gotten so verbose that the *good* stuff has all scrolled away. So I think we should take a hard look at that "more data is better". Look at the above 25 lines and tell me - is that actually 25 useful lines for debugging a crash in sysrq_handle_crash? No. The only really _useful_ lines above are RIP: 0010:sysrq_handle_crash+0x17/0x20 RSP: 0018:ffffc90000c23df0 EFLAGS: 00010246 Code: eb d1 e8 fd ca b6 ff 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 e8 f6 de bc ff c7 05 84 0d 1a 01 01 00 00 00 0f ae f8 04 25 00 00 00 00 01 c3 0f 1f 44 00 00 e8 86 df c1 ff fb 66 CR2: 0000000000000000 which are actually about the crash. The rest is almost entirely useless. Do I know what the corrent answer is? No. Linus