From: Wei Liu <wei.liu@kernel.org>
To: Anirudh Rayabharam <anirudh@anirudhrb.com>
Cc: Jork Loeser <jloeser@linux.microsoft.com>,
linux-hyperv@vger.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>,
Michael Kelley <mhklinux@outlook.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v2 4/6] mshv: limit SynIC management to MSHV-owned resources
Date: Wed, 15 Apr 2026 05:54:24 +0000 [thread overview]
Message-ID: <20260415055424.GA3381607@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <20260414-successful-loyal-magpie-9b7faf@anirudhrb>
On Tue, Apr 14, 2026 at 03:49:53PM +0000, Anirudh Rayabharam wrote:
> On Tue, Apr 07, 2026 at 02:27:52PM -0700, Jork Loeser wrote:
> > On Mon, 6 Apr 2026, Anirudh Rayabharam wrote:
> >
> > > On Fri, Apr 03, 2026 at 12:06:10PM -0700, Jork Loeser wrote:
> > > > The SynIC is shared between VMBus and MSHV. VMBus owns the message
> > > > page (SIMP), event flags page (SIEFP), global enable (SCONTROL),
> > > > and SINT2. MSHV adds SINT0, SINT5, and the event ring page (SIRBP).
> > > >
> > > > Currently mshv_synic_init() redundantly enables SIMP, SIEFP, and
> > >
> > > The redundant enable is probably a no-op from the hypervisor side so it
> > > probably doesn't hurt us. The main problem is with the tear down.
> >
> > It's an MSR intercept. If we can replace this by an "if()" we shave a few
> > cycles.
> >
> > > An alternative approach could be: check if SIMP/SIEFP/SCONTROL is
> > > already enabled. If so, don't enable it again. If not enabled, enable it
> > > and keep track of what all stuf we have enabled. Then disable all of
> > > them during cleanup. This approach makes less assumptions about the
> > > behavior of the VMBUS driver and what stuff it does or doesn't use.
> >
> > It would, yes. Then again, we drag yet more state and make debugging more
> > complicated / less clear to reason what happens dynamically. I had been
> > debating this briefly myself, and ultimately decided against it for that
> > very reason.
>
> Ultimately, both approaches are fragile in their own ways because the
> contract that "VMBus owns SIMP, SIEFP, SCONTROL, SINT2 and MSHV owns
> SIRBP and SINT0 and SINT5" are not enforced anywhere in code and are
> just assumptions that everyone will play nice. To do that, we'll need to
> refactor the code such that there is a common component that sort of
> facilitates access to SynIC for both VMBus and MSHV.
>
> I would say that checking the state dynamically and then deciding
> whether or not to enable SIMP/SIEFP/SCONTROL would be less fragile
> because we make lesser assumptions about what VMBus does or doesn't do.
>
I think it is important to keep the changes as small as possible for
ease of backporting.
> Also, do you know of any cases where the VMBus stuff can get initialized
> after MSHV? Maybe if VMBus is a module (if that is even possible)? That
> would really mess up our logic here.
>
It is possible to configure Vmbus as a module today. We should think of
a way to resolve what you say. Designing a new component is one way. The
other way is to find a working build configuration and enforce it via
Kconfig.
Wei
> Thanks,
> Anirudh.
>
> >
> > Best,
> > Jork
next prev parent reply other threads:[~2026-04-15 5:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 19:06 [PATCH v2 0/6] Hyper-V: kexec fixes for L1VH (mshv) Jork Loeser
2026-04-03 19:06 ` [PATCH v2 1/6] Drivers: hv: vmbus: fix hyperv_cpuhp_online variable shadowing Jork Loeser
2026-04-03 19:06 ` [PATCH v2 2/6] x86/hyperv: move stimer cleanup to hv_machine_shutdown() Jork Loeser
2026-04-03 19:06 ` [PATCH v2 3/6] x86/hyperv: Skip LP/VP creation on kexec Jork Loeser
2026-04-03 19:06 ` [PATCH v2 4/6] mshv: limit SynIC management to MSHV-owned resources Jork Loeser
2026-04-06 17:18 ` Anirudh Rayabharam
2026-04-07 21:27 ` Jork Loeser
2026-04-14 15:49 ` Anirudh Rayabharam
2026-04-15 5:54 ` Wei Liu [this message]
2026-04-03 19:06 ` [PATCH v2 5/6] mshv: clean up SynIC state on kexec for L1VH Jork Loeser
2026-04-06 17:22 ` Anirudh Rayabharam
2026-04-08 1:25 ` Jork Loeser
2026-04-03 19:06 ` [PATCH v2 6/6] mshv: unmap debugfs stats pages on kexec Jork Loeser
2026-04-06 17:28 ` Anirudh Rayabharam
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=20260415055424.GA3381607@liuwe-devbox-debian-v2.local \
--to=wei.liu@kernel.org \
--cc=anirudh@anirudhrb.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=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