Re: [PATCH v2 4/6] mshv: limit SynIC management to MSHV-owned resources
From: Jork Loeser
Date: Tue Apr 07 2026 - 17:30:17 EST
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.
Best,
Jork