From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Michael Kelley <mhklinux@outlook.com>,
"haiyangz@microsoft.com" <haiyangz@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"decui@microsoft.com" <decui@microsoft.com>,
"kys@microsoft.com" <kys@microsoft.com>,
"corbet@lwn.net" <corbet@lwn.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] Documentation: hyperv: Add overview of guest VM hibernation
Date: Wed, 8 Jan 2025 16:30:22 +0700 [thread overview]
Message-ID: <Z35FriFiFcQn4Wi7@archie.me> (raw)
In-Reply-To: <SN6PR02MB4157AC80E1975CE9BB6E3E62D4122@SN6PR02MB4157.namprd02.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 4260 bytes --]
On Wed, Jan 08, 2025 at 04:50:15AM +0000, Michael Kelley wrote:
> From: Bagas Sanjaya <bagasdotme@gmail.com> Sent: Tuesday, January 7, 2025 8:07 PM
> >
> > On Tue, Jan 07, 2025 at 12:20:47PM -0800, mhkelley58@gmail.com wrote:
> > > +VMBus devices are identified by class and instance GUID. (See section
> > > +"VMBus device creation/deletion" in
> > > +Documentation/virt/hyperv/vmbus.rst.) Upon resume from hibernation,
> > > +the resume functions expect that the devices offered by Hyper-V have
> > > +the same class/instance GUIDs as the devices present at the time of
> > > +hibernation. Having the same class/instance GUIDs allows the offered
> > > +devices to be matched to the primary VMBus channel data structures in
> > > +the memory of the now resumed hibernation image. If any devices are
> > > +offered that don't match primary VMBus channel data structures that
> > > +already exist, they are processed normally as newly added devices. If
> > > +primary VMBus channels that exist in the resumed hibernation image are
> > > +not matched with a device offered in the resumed VM, the resume
> > > +sequence waits for 10 seconds, then proceeds. But the unmatched device
> > > +is likely to cause errors in the resumed VM.
> >
> > Did you mean for example, conflicting synthetic NICs?
>
> In the resumed hibernation image, the unmatched device is in a weird
> state where it is exist and has a driver, but is no longer "open" in the VMBus
> layer. Any attempt to do I/O to the device will fail, and interrupts received
> from the device are ignored. Presumably there's user space software or a
> network connection that has the device open and expects to be able to
> interact with it. That software will error out due to the I/O failure.
>
> I haven't thought through all the implications of such a scenario, so
> just left the documentation as "likely to cause errors" without going
> into detail. It's an unsupported scenario, so not likely something that
> will be improved.
>
> I don't think the issue is necessarily conflicting NICs, though if a NIC with
> a different instance GUID was offered, it would show up as a new NIC
> in the resumed image, and that might cause conflicts/confusion with
> the "dead" NIC.
Understand.
>
> >
> > > +The Linux ends of Hyper-V sockets are forced closed at the time of
> > > +hibernation. The guest can't force closing the host end of the socket,
> > > +but any host-side actions on the host end will produce an error.
> >
> > Nothing can be done on host-side?
>
> Not really. Whatever host-side software that is using the Hyper-V
> socket will just get an error that next time it tries to do I/O over
> the socket.
>
> Is there something you had in mind that the host could/should do?
None really.
>
> >
> > > +Virtual PCI devices are physical PCI devices that are mapped directly
> > > +into the VM's physical address space so the VM can interact directly
> > > +the hardware. vPCI devices include those accessed via what Hyper-V
> > "... interact directly with the hardware."
>
> Thanks for your careful reading. I'll add the missing "with". :-)
>
> > > +calls "Discrete Device Assignment" (DDA), as well as SR-IOV NIC
> > > +Virtual Functions (VF) devices. See Documentation/virt/hyperv/vpci.rst.
> > > +
> > > <snipped>...
> > > +SR-IOV NIC VFs similarly have a VMBus identity as well as a PCI
> > > +identity, and overall are processed similarly to DDA devices. A
> > > +difference is that VFs are not offered to the VM during initial boot
> > > +of the VM. Instead, the VMBus synthetic NIC driver first starts
> > > +operating and communicates to Hyper-V that it is prepared to accept a
> > > +VF, and then the VF offer is made. However, if the VMBus connection is
> > > +unloaded and then re-established without the VM being rebooted (as
> > > +happens in Steps 3 and 5 in the Detailed Hibernation Sequence above,
> > > +and similarly in the Detailed Resume Sequence), VFs are already part
> > "... that are already ..."
>
> Right. I'll fix this wording problem as well.
OK, thanks!
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2025-01-08 9:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 20:20 [PATCH v2 1/1] Documentation: hyperv: Add overview of guest VM hibernation mhkelley58
2025-01-08 4:06 ` Bagas Sanjaya
2025-01-08 4:50 ` Michael Kelley
2025-01-08 9:30 ` Bagas Sanjaya [this message]
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=Z35FriFiFcQn4Wi7@archie.me \
--to=bagasdotme@gmail.com \
--cc=corbet@lwn.net \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=wei.liu@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;
as well as URLs for NNTP newsgroup(s).