mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Michael Kelley <mhklinux@outlook.com>
Cc: Jork Loeser <jloeser@linux.microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Anirudh Rayabharam <anrayabh@linux.microsoft.com>,
	Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>,
	Mukesh Rathor <mrathor@linux.microsoft.com>
Subject: Re: [PATCH v3 3/6] x86/hyperv: Skip LP/VP creation on kexec
Date: Wed, 27 May 2026 16:17:39 -0700	[thread overview]
Message-ID: <20260527231739.GH3518940@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <SN6PR02MB41578A8F9A225227FB5E79E6D4312@SN6PR02MB4157.namprd02.prod.outlook.com>

On Mon, May 04, 2026 at 03:09:21PM +0000, Michael Kelley wrote:
> From: Jork Loeser <jloeser@linux.microsoft.com> Sent: Tuesday, April 7, 2026 6:37 PM
> > 
> > After a kexec the logical processors and virtual processors already
> > exist in the hypervisor because they were created by the previous
> > kernel. Attempting to add them again causes either a BUG_ON or
> > corrupted VP state leading to MCEs in the new kernel.
> > 
> > Add hv_lp_exists() to probe whether an LP is already present by
> > calling HVCALL_GET_LOGICAL_PROCESSOR_RUN_TIME. When it succeeds the
> > LP exists and we skip the add-LP and create-VP loops entirely.
> > 
> > Also add hv_call_notify_all_processors_started() which informs the
> > hypervisor that all processors are online. This is required after
> > adding LPs (fresh boot) and is a no-op on kexec since we skip that
> > path.
> 
> Adding hv_call_notify_all_processors_started() seems like it should be
> a separate patch. And this paragraph in the commit message leaves me
> with questions:  Is it really "required"?  If it is, how does the existing
> upstream code ever work? Does the change need to be backported
> to stable kernels? If it isn't *really* required, what are the implications
> of not doing it?

It is complicated. If I remember correctly, we realized this call was
absolutely needed if SEV-SNP host side support is enabled. If that
support is not enabled, then things continue to work. I think it is the
right thing to do to always make this call.

We don't need to backport this yet.

Wei

  reply	other threads:[~2026-05-27 23:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  1:36 [PATCH v3 0/6] Hyper-V: kexec fixes for L1VH (mshv) Jork Loeser
2026-04-08  1:36 ` [PATCH v3 1/6] Drivers: hv: vmbus: fix hyperv_cpuhp_online variable shadowing Jork Loeser
2026-04-08  1:36 ` [PATCH v3 2/6] x86/hyperv: move stimer cleanup to hv_machine_shutdown() Jork Loeser
2026-05-04 15:08   ` Michael Kelley
2026-04-08  1:36 ` [PATCH v3 3/6] x86/hyperv: Skip LP/VP creation on kexec Jork Loeser
2026-05-04 15:09   ` Michael Kelley
2026-05-27 23:17     ` Wei Liu [this message]
2026-04-08  1:36 ` [PATCH v3 4/6] mshv: limit SynIC management to MSHV-owned resources Jork Loeser
2026-04-08  1:36 ` [PATCH v3 5/6] mshv: clean up SynIC state on kexec for L1VH Jork Loeser
2026-04-08  1:36 ` [PATCH v3 6/6] mshv: unmap debugfs stats pages on kexec Jork Loeser

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=20260527231739.GH3518940@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=anrayabh@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=jloeser@linux.microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=mrathor@linux.microsoft.com \
    --cc=stanislav.kinsburskii@gmail.com \
    --cc=tglx@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

all inboxes | Powered by JetHome®