Re: [PATCH 5/8] virt: vbox: Add support for the new VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl

From: Arnd Bergmann
Date: Wed May 20 2020 - 17:47:36 EST


On Wed, May 20, 2020 at 9:55 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Add support for the new VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES ioctl, this
> is necessary for automatic resizing of the guest resolution to match the
> VM-window size to work with the new VMSVGA virtual GPU which is now the
> new default in VirtualBox.
>
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1789545
> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>

This is not a great interface, but I see no bugs in the implementation
or problems with portability.

If you want to improve it a little bit, note that spin_lock_irqsave() inside
of mutex_lock() is a little bit silly since you know at this point that
interrupts are enabled and you could use spin_lock_irq() instead.

I assume the driver does the same thing everywhere but I did not check.

Arnd