virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
2.01k stars 385 forks source link

viosock: Do not inline functions working with spinlocks to paged code #1018

Closed MartinDrab closed 9 months ago

MartinDrab commented 9 months ago

Spin locks are operated at IRQL >= DISPATCH_LEVEL, thus, such code must not be paged. Otherwise, it can be paged out during its execution which provides the user with a IRQL_NOT_LESS_OR_EQUAL bug check. Virtio Socket driver wraps some of its spinlock usage into several inline functions:

However, these functions are than called from routines marked as pageable code which can trigger the bug check. This commit makes the functions not inline, thus, making them reside in nonpaged memory.