From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751718AbbFYLhr (ORCPT ); Thu, 25 Jun 2015 07:37:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbbFYLhY (ORCPT ); Thu, 25 Jun 2015 07:37:24 -0400 From: Vitaly Kuznetsov To: "K. Y. Srinivasan" Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com Subject: Re: [PATCH V2 06/10] Drivers: hv: vmbus: use 'die' notification chain instead of 'panic' References: <1433460339-9346-1-git-send-email-kys@microsoft.com> <1433460376-9387-1-git-send-email-kys@microsoft.com> <1433460376-9387-6-git-send-email-kys@microsoft.com> Date: Thu, 25 Jun 2015 13:37:20 +0200 In-Reply-To: <1433460376-9387-6-git-send-email-kys@microsoft.com> (K. Y. Srinivasan's message of "Thu, 4 Jun 2015 16:26:12 -0700") Message-ID: <87wpys3tov.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "K. Y. Srinivasan" writes: > From: Vitaly Kuznetsov > > current_pt_regs() returns regs of the userspace process and in case of > kernel crash this is not what we need to report. E.g. when we trigger > crash with sysrq we see the following: > ... > RIP: 0010:[] [] sysrq_handle_crash+0x16/0x20 > RSP: 0018:ffff8800db0a7d88 EFLAGS: 00010246 > RAX: 000000000000000f RBX: ffffffff820a0660 RCX: 0000000000000000 > ... > at the same time current_pt_regs() give us: > ip=7f899ea7e9e0, ax=ffffffffffffffda, bx=26c81a0, cx=7f899ea7e9e0, ... > These registers come from the userspace process triggered the crash. As we > don't even know which process it was this information is rather useless. > > When kernel crash happens proper regs are being passed to all receivers on > the die_chain (and panic_notifier_list is being notified with the string > passed to panic() only). Let's move our Hyper-V MSR reporter there. This > change has the following implication: when panic() is called manually from > some other part of kernel we won't be reporting crash to the hypervisor > (but we have no valuable information to report anyway). We can, actually, do better: we can has this reporter in _both_ notification chains (with a static preventng double reporting). In this case we'll have panics reported on e.g BUG_ON() As this patch is still not merged I'll fix and resend instead of creating a separate patch. -- Vitaly