From: Mukesh R <mrathor@linux.microsoft.com>
To: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
arnd@arndb.de
Subject: Re: [PATCH v0 5/6] x86/hyperv: Implement hypervisor ram collection into vmcore
Date: Mon, 8 Sep 2025 10:38:36 -0700 [thread overview]
Message-ID: <d8b8f47d-8e17-95bd-a637-ea42d0eaa709@linux.microsoft.com> (raw)
In-Reply-To: <aL8Cfsl3Vaeuw-QI@skinsburskii.localdomain>
On 9/8/25 09:21, Stanislav Kinsburskii wrote:
> On Wed, Sep 03, 2025 at 07:10:16PM -0700, Mukesh Rathor wrote:
>> This commit introduces a new file to enable collection of hypervisor ram
>> into the vmcore collected by linux. By default, the hypervisor ram is locked,
>> ie, protected via hw page table. Hyper-V implements a disable hypercall which
>> essentially devirtualizes the system on the fly. This mechanism makes the
>> hypervisor ram accessible to linux without any extra work because it is
>> already mapped into linux address space. Details of the implementation
>> are available in the file prologue.
>>
>> Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com>
>> ---
>> arch/x86/hyperv/hv_crash.c | 618 +++++++++++++++++++++++++++++++++++++
>> 1 file changed, 618 insertions(+)
>> create mode 100644 arch/x86/hyperv/hv_crash.c
>>
>> diff --git a/arch/x86/hyperv/hv_crash.c b/arch/x86/hyperv/hv_crash.c
>> new file mode 100644
>> index 000000000000..50c54d39f0e2
>> --- /dev/null
>> +++ b/arch/x86/hyperv/hv_crash.c
>> +
>
> <snip>
>
>> +/*
>> + * generic nmi callback handler: could be called without any crash also.
>> + * hv crash: hypervisor injects nmi's into all cpus
>> + * lx crash: panicing cpu sends nmi to all but self via crash_stop_other_cpus
>> + */
>> +static int hv_crash_nmi_local(unsigned int cmd, struct pt_regs *regs)
>> +{
>> + int ccpu = smp_processor_id();
>> +
>> + if (!hv_has_crashed && hv_cda && hv_cda->cda_valid)
>> + hv_has_crashed = 1;
>> +
>> + if (!hv_has_crashed && !lx_has_crashed)
>> + return NMI_DONE; /* ignore the nmi */
>> +
>> + if (hv_has_crashed && !hv_crash_enabled) {
>> + if (ccpu == 0) {
>> + pr_emerg("Hyper-V: core collect not setup. Reboot\n");
>> + native_wrmsrq(HV_X64_MSR_RESET, 1); /* reboot */
>> + } else
>> + for (;;)
>> + cpu_relax();
>> + }
>> +
>> + crash_nmi_callback(regs);
>> + return NMI_DONE;
>> +}
>
> One more thing.
> It looks like the function above goes through the new logic even when
> hypervisor is intact and there is no crash kernel loaded.
> This is redundant and it should rather return back to the existent
> generic kernel panic logic.
Yeah, that is already addressed in V1 coming up.
next prev parent reply other threads:[~2025-09-08 17:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 2:10 [PATCH v0 0/6] Hyper-V: Implement hypervisor core collection Mukesh Rathor
2025-09-04 2:10 ` [PATCH v0 1/6] x86/hyperv: Rename guest shutdown functions Mukesh Rathor
2025-09-04 17:22 ` Anirudh Rayabharam
2025-09-04 2:10 ` [PATCH v0 2/6] Hyper-V: Add two new hypercall numbers to guest ABI public header Mukesh Rathor
2025-09-04 2:10 ` [PATCH v0 3/6] Hyper-V: Add definitions for hypervisor crash dump support Mukesh Rathor
2025-09-04 2:10 ` [PATCH v0 4/6] x86/hyperv: Add trampoline asm code to transition from hypervisor Mukesh Rathor
2025-09-04 2:10 ` [PATCH v0 5/6] x86/hyperv: Implement hypervisor ram collection into vmcore Mukesh Rathor
2025-09-04 22:37 ` Stanislav Kinsburskii
2025-09-05 2:38 ` Mukesh R
2025-09-09 17:29 ` Stanislav Kinsburskii
2025-09-09 18:25 ` Mukesh R
2025-09-08 16:21 ` Stanislav Kinsburskii
2025-09-08 17:38 ` Mukesh R [this message]
2025-09-04 2:10 ` [PATCH v0 6/6] Hyper-V: Enable build of hypervisor crash collection files Mukesh Rathor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8b8f47d-8e17-95bd-a637-ea42d0eaa709@linux.microsoft.com \
--to=mrathor@linux.microsoft.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox