[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 0/7] Implement forced unplug and forced activation



On Thu, Jul 24, 2025 at 11:01:40AM +0000, Tu Dinh wrote:
> On 24/07/2025 12:49, Marek Marczykowski-Górecki wrote:
> > On Thu, Jul 24, 2025 at 10:43:32AM +0000, Tu Dinh wrote:
> >> Hi Marek,
> >>
> >> On 24/07/2025 12:40, Marek Marczykowski-Górecki wrote:
> >>> On Wed, Jul 23, 2025 at 01:58:27PM +0000, Tu Dinh wrote:
> >>>> The goal of these two features is to simplify driver servicing and avoid
> >>>> requiring storing driver state in Registry.
> >>>>
> >>>> Forced unplug, as name implies, forcefully unplugs emulated devices when
> >>>> a driver is present, rather than when it's active. It defines a Registry
> >>>> key at CurrentControlSet\XEN\ForceUnplug. Drivers can opt into forced
> >>>> unplug by creating an appropriate value (DISKS/NICS) in this key.
> >>>>
> >>>> Forced activation is the companion to forced unplug. It aims to make
> >>>> activation of Xenbus FDOs deterministic and stateless, using a
> >>>> precedence mapping based on device IDs, prioritizing the vendor device
> >>>> over the generic ones. This avoids situations where the wrong FDO is
> >>>> activated, which will prevent Windows Update from working.
> >>>>
> >>>> With forced activation, Xenfilt is now installed via INF on top of the
> >>>> current installation routines. This means PV drivers can be injected
> >>>> offline without needing another reboot to be reconfigured.
> >>>>
> >>>> To avoid affecting older drivers, the two features are conditioned
> >>>> behind new build variables FORCE_UNPLUG and FORCE_ACTIVATE.
> >>>>
> >>>> The following scenarios have been successfully tested, both requiring
> >>>> only one reboot:
> >>>> * Offline driver installation via DISM
> >>>> * Toggling vendor device
> >>>
> >>> Hi,
> >>>
> >>> I tested this series (or rather
> >>> https://github.com/xcp-ng/win-xenbus/tree/emulated-v3 at
> >>> 9424383b7c2f0b6d9f4a7fd554662c8679cc935f) and got the following failure:
> >>>
> >>>       xen platform: xenbus|PdoQueryId: (ULONG_PTR)Buffer - 
> >>> (ULONG_PTR)Id.Buffer = 1032
> >>>       xen platform: xenbus|PdoQueryId: REGSTR_VAL_MAX_HCID_LEN = 1024
> >>>       xen platform: xenbus|PdoQueryId: ASSERTION FAILED: 
> >>> ((ULONG_PTR)Buffer - (ULONG_PTR)Id.Buffer) < (1024)
...
> >>>
> >>> This is on fresh Windows 10 (22H2) domU, with opt-in patches for both 
> >>> xenvbd
> >>> and xennet.
> >>>
> >>> The test was done on our CI system, more logs are available at
> >>> https://openqa.qubes-os.org/tests/147544#downloads. Especially it
> >>> includes tarball of the whole /var/log, where you can find
> >>> /var/log/xen/console/guest-windows-test-dm.log with messages before the
> >>> above failure.
> >>>
> >>
> >> That tree is stale, could you try again (or apply the patches directly)?
> >> That BSOD should already be fixed with 3e93bee44bbc "xenbus: Use
> >> nonpaged pool in FdoQueryId".
> >
> > Hm, I have this patch included already. Now when fetched diff shows two
> > logical differences:
> > - change in evtchn_fifo.c (change while loop to for)
> > - changes in xenbus.inf adding FORCE_ACTIVATION among other things
> >
> > BTW, should I enable also FORCE_ACTIVATION?
> >
> 
> You're right, I missed the assertion failure. Looks like adding rev
> 0900000C caused the compatible ID list to exceed
> REGSTR_VAL_MAX_HCID_LEN. Although I have no idea how to fix this without
> breaking compatibility somehow.
> 
> The evtchn_fifo fix is a minor fix that only concerns failure cleanup.
> 
> If you use forced unplug you'll very likely want forced activation as
> well, as you'll get to avoid the reboots needed to change the active
> Xenbus FDO.

With a patch that strips older revisions it doesn't crash this way
anymore. But installation of Qubes Windows Tools fail on starting
services (they use xeniface from userspace). I'm not sure what exactly
went wrong there (Omeg, do you have some debugging hints? Logs aren't
created for some reason...), but I double checked it's related to this
series - without it all works fine.

I posted all the info I know at
https://github.com/QubesOS/qubes-vmm-xen-windows-pvdrivers/pull/4#issuecomment-3139380653
(which isn't much).

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

Attachment: signature.asc
Description: PGP signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.