virt: Add vboxguest driver for Virtual Box Guest integration UAPI
PATCH v3 1/3 virt: Add vboxguest driver for Virtual Box Guest integration UAPI
This commit adds the headers describing the ioctl API for the /dev/vboxguest device used by the Virtual Box Guest Additions in Virtual Box virtual machines.
The driver providing the /dev/vboxguest device will allow Virtual Box Guest Additions features such as copy-and-paste, seamless mode and OpenGL pass-through.
---
Changes in v2:
-Change all uapi headers to kernel coding style: Drop struct and enum typedefs
make type and struct-member names all lowercase, enum values all uppercase.
-Remove unused struct type declarations from some headers (shaving of another
1000 lines)
-Remove or fixup doxygen style comments
-Get rid of CHECK macros, use a function taking in_ and out_size args instead -Some other small codyingstyle fixes
-Split into multiple patches
Changes in v3:
-Add Larry's Reviewed-by
--- MAINTAINERS | 7 + include/uapi/linux/vbox_err.h | 170 ++++++++++++++++ include/uapi/linux/vbox_vmmdev_types.h | 237 +++++++++++++++++++++++ include/uapi/linux/vboxguest.h | 341 +++++++++++++++++++++++++++++++++ 4 files changed, 755 insertions(+) create mode 100644 include/uapi/linux/vbox_err.h create mode 100644 include/uapi/linux/vbox_vmmdev_types.h create mode 100644 include/uapi/linux/vboxguest.h
MAINTAINERS +7 -0
@@ -14549,6 +14549,13 @@ S: Maintained F: drivers/virtio/virtio_input.c F: include/uapi/linux/virtio_input.h +VIRTUAL BOX GUEST DEVICE DRIVER +M: Hans de Goede <[email protected]> +M: Arnd Bergmann <[email protected]> +M: Greg Kroah-Hartman <[email protected]> +S: Maintained +F: include/uapi/linux/vbox*.h + VIRTUAL SERIO DEVICE DRIVER M: Stephen Chandler Paul <[email protected]> S: Maintained
include/uapi/linux/vbox_err.h new file +170 -0
170 lines not on this page · raw message
include/uapi/linux/vbox_vmmdev_types.h new file +237 -0
237 lines not on this page · raw message
include/uapi/linux/vboxguest.h new file +341 -0
341 lines not on this page · raw message
Signature · 1 line
2.14.3
PATCH v3 2/3 virt: Add vboxguest VMMDEV communication code
This commits adds a header describing the hardware interface for the Virtual Box Guest PCI device used in Virtual Box virtual machines and utility functions for talking to the Virtual Box hypervisor over this interface.
These utility functions will used both by the vboxguest driver for the PCI device which offers the /dev/vboxguest ioctl API and by the vboxfs driver which offers folder sharing support.
---
Changes in v2:
-Change all uapi headers to kernel coding style: Drop struct and enum typedefs
make type and struct-member names all lowercase, enum values all uppercase.
-Remove unused struct type declarations from some headers (shaving of another
1000 lines)
-Remove or fixup doxygen style comments
-Get rid of CHECK macros, use a function taking in_ and out_size args instead -Some other small codyingstyle fixes
-Split into multiple patches
Changes in v3:
-Add Larry's Reviewed-by
-Add a "Fall Through" comment to a default: in a switch-case which falls-
through to other handling
--- MAINTAINERS | 2 + drivers/virt/vboxguest/vboxguest_utils.c | 812 +++++++++++++++++++++++++++++++ drivers/virt/vboxguest/vmmdev.h | 460 +++++++++++++++++ include/linux/vbox_utils.h | 92 ++++ 4 files changed, 1366 insertions(+) create mode 100644 drivers/virt/vboxguest/vboxguest_utils.c create mode 100644 drivers/virt/vboxguest/vmmdev.h create mode 100644 include/linux/vbox_utils.h
MAINTAINERS +2 -0
@@ -14554,7 +14554,9 @@ M: Hans de Goede <[email protected]> M: Arnd Bergmann <[email protected]> M: Greg Kroah-Hartman <[email protected]> S: Maintained +F: include/linux/vbox_utils.h F: include/uapi/linux/vbox*.h +F: drivers/virt/vboxguest/ VIRTUAL SERIO DEVICE DRIVER M: Stephen Chandler Paul <[email protected]>
drivers/virt/vboxguest/vboxguest_utils.c new file +812 -0
812 lines not on this page · raw message
drivers/virt/vboxguest/vmmdev.h new file +460 -0
460 lines not on this page · raw message
include/linux/vbox_utils.h new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
2.14.3
PATCH v3 3/3 virt: Add vboxguest driver for Virtual Box Guest integration
In reply to Hans de GoedeThis commit adds a driver for the Virtual Box Guest PCI device used in Virtual Box virtual machines. Enabling this driver will add support for Virtual Box Guest integration features such as copy-and-paste, seamless mode and OpenGL pass-through.
This driver also offers vboxguest IPC functionality which is needed for the vboxfs driver which offers folder sharing support.
---
Changes in v2:
-Change all uapi headers to kernel coding style: Drop struct and enum typedefs
make type and struct-member names all lowercase, enum values all uppercase.
-Remove unused struct type declarations from some headers (shaving of another
1000 lines)
-Remove or fixup doxygen style comments
-Get rid of CHECK macros, use a function taking in_ and out_size args instead -Some other small codyingstyle fixes
-Split into multiple patches
Changes in v3:
-Add Larry's Reviewed-by
-Clarify / improve some comments
-Do not deref possible "NULL" req pointer in vbg_set_session_event_filter
and vbg_set_session_capabilities
--- drivers/virt/Kconfig | 1 + drivers/virt/Makefile | 1 + drivers/virt/vboxguest/Kconfig | 18 + drivers/virt/vboxguest/Makefile | 3 + drivers/virt/vboxguest/vboxguest_core.c | 1582 ++++++++++++++++++++++++++++ drivers/virt/vboxguest/vboxguest_core.h | 187 ++++ drivers/virt/vboxguest/vboxguest_linux.c | 469 +++++++++ drivers/virt/vboxguest/vboxguest_version.h | 18 + 8 files changed, 2279 insertions(+) create mode 100644 drivers/virt/vboxguest/Kconfig create mode 100644 drivers/virt/vboxguest/Makefile create mode 100644 drivers/virt/vboxguest/vboxguest_core.c create mode 100644 drivers/virt/vboxguest/vboxguest_core.h create mode 100644 drivers/virt/vboxguest/vboxguest_linux.c create mode 100644 drivers/virt/vboxguest/vboxguest_version.h
drivers/virt/Kconfig +1 -0
@@ -30,4 +30,5 @@ config FSL_HV_MANAGER 4) A kernel interface for receiving callbacks when a managed partition shuts down. +source "drivers/virt/vboxguest/Kconfig" endif
drivers/virt/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_FSL_HV_MANAGER) += fsl_hypervisor.o +obj-y += vboxguest/
drivers/virt/vboxguest/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +config VBOXGUEST + tristate "Virtual Box Guest integration support" + depends on X86 && PCI && INPUT + help + This is a driver for the Virtual Box Guest PCI device used in + Virtual Box virtual machines. Enabling this driver will add + support for Virtual Box Guest integration features such as + copy-and-paste, seamless mode and OpenGL pass-through. + + This driver also offers vboxguest IPC functionality which is needed + for the vboxfs driver which offers folder sharing support. + + If you enable this driver you should also enable the VBOXVIDEO option. + + Although it is possible to build this module in, it is advised + to build this driver as a module, so that it can be updated + independently of the kernel. Select M to build this driver as a + module.
drivers/virt/vboxguest/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +vboxguest-y := vboxguest_linux.o vboxguest_core.o vboxguest_utils.o + +obj-$(CONFIG_VBOXGUEST) += vboxguest.o
drivers/virt/vboxguest/vboxguest_core.c new file +1582 -0
1,582 lines not on this page · raw message
drivers/virt/vboxguest/vboxguest_core.h new file +187 -0
187 lines not on this page · raw message
drivers/virt/vboxguest/vboxguest_linux.c new file +469 -0
469 lines not on this page · raw message
drivers/virt/vboxguest/vboxguest_version.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* VBox Guest additions version info, this is used by the host to determine +* supported guest-addition features in some cases. So this will need to be +* synced with vbox upstreams versioning scheme when we implement / port +* new features from the upstream out-of-tree vboxguest driver. +*/ + +#ifndef __VBOX_VERSION_H__ +#define __VBOX_VERSION_H__ + +/* Last synced October 4th 2017 */ +#define VBG_VERSION_MAJOR 5 +#define VBG_VERSION_MINOR 2 +#define VBG_VERSION_BUILD 0 +#define VBG_SVN_REV 68940 +#define VBG_VERSION_STRING "5.2.0" + +#endif
Signature · 1 line
2.14.3
Re: [PATCH v3 3/3] virt: Add vboxguest driver for Virtual Box Guest integration
Quoted 13 lines · Hans de Goede
drivers/virt/vboxguest/vboxguest_core.c new file +7
-0@@ -0,0 +1,1582 @@ +/* +* vboxguest core guest-device handling code, VBoxGuest.cpp in upstream svn. +* +* Copyright (C) 2007-2016 Oracle Corporation +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as
drivers/virt/vboxguest/vboxguest_core.c line 17
Quoted 10 lines
drivers/virt/vboxguest/vboxguest_core.c new file +10
-0+* published by the Free Software Foundation. +* +* The contents of this file may alternatively be used under the terms +* of the Common Development and Distribution License Version 1.0 +* (CDDL) only, in which case the provisions of the CDDL are applicable +* instead of those of the GPL. +* +* You may elect to license modified versions of this file under the +* terms and conditions of either the GPL or the CDDL or both. +*/
Hans:
Could it make sense to replace this whole license boilerplate with the new SPDX license ids? e.g. use this instead:
drivers/virt/vboxguest/vboxguest_core.c line 4
Quoted 5 lines
drivers/virt/vboxguest/vboxguest_core.c new file +5
-0+// SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) +/* +* vboxguest core guest-device handling code, VBoxGuest.cpp in upstream svn. +* +* Copyright (C) 2007-2016 Oracle Corporation
This would me much more compact and has the same effect. IMHO this especially makes sense for new code as we are still cleaning the rest of the kernel, so this would avoid extra work to clean this up later.
Signature · 2 lines
Cordially Philippe Ombredanne
Re: [PATCH v3 3/3] virt: Add vboxguest driver for Virtual Box Guest integration
Hi,
Quoted 29 lines · Philippe Ombredanne
Quoted 13 lines · Hans de Goede
drivers/virt/vboxguest/vboxguest_core.c new file +7
-0@@ -0,0 +1,1582 @@ +/* +* vboxguest core guest-device handling code, VBoxGuest.cpp in upstream svn. +* +* Copyright (C) 2007-2016 Oracle Corporation +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as drivers/virt/vboxguest/vboxguest_core.c line 17
Quoted 10 lines
drivers/virt/vboxguest/vboxguest_core.c new file +10
-0+* published by the Free Software Foundation. +* +* The contents of this file may alternatively be used under the terms +* of the Common Development and Distribution License Version 1.0 +* (CDDL) only, in which case the provisions of the CDDL are applicable +* instead of those of the GPL. +* +* You may elect to license modified versions of this file under the +* terms and conditions of either the GPL or the CDDL or both. +*/ Hans:
Could it make sense to replace this whole license boilerplate with the new SPDX license ids? e.g. use this instead:
Quoted 9 lines
drivers/virt/vboxguest/vboxguest_core.c line 4
Quoted 5 lines
drivers/virt/vboxguest/vboxguest_core.c new file +5
-0+// SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) +/* +* vboxguest core guest-device handling code, VBoxGuest.cpp in upstream svn. +* +* Copyright (C) 2007-2016 Oracle Corporation This would me much more compact and has the same effect. IMHO this especially makes sense for new code as we are still cleaning the rest of the kernel, so this would avoid extra work to clean this up later.
Yes that is a good idea, thank you.
I've made that change locally and I will post a v4 with this change right after this mail.
Regards,
Hans