Skip to contentSkip to conversation

virt: Add vboxguest driver for Virtual Box Guest integration UAPI

PATCH New Hans de Goede 1 participant 3 messages Nov 30, 2017 Virtual box guest device driver

lore
Share & tools
lore
#0 lore raw

PATCH v4 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

Changes in v4:
-Change license headers to use SPDX identifiers

---
 MAINTAINERS                            |   7 +
 include/uapi/linux/vbox_err.h          | 151 +++++++++++++++
 include/uapi/linux/vbox_vmmdev_types.h | 226 ++++++++++++++++++++++
 include/uapi/linux/vboxguest.h         | 330 +++++++++++++++++++++++++++++++++
 4 files changed, 714 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
index aa71ab52fd76..6873b076eb7b 100644
@@ -14538,6 +14538,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 +151 -0

151 lines not on this page · raw message

include/uapi/linux/vbox_vmmdev_types.h new file +226 -0

226 lines not on this page · raw message

include/uapi/linux/vboxguest.h new file +330 -0

330 lines not on this page · raw message

Signature · 1 line
2.14.3
#1 lore raw

PATCH v4 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

Changes in v4:
-Change license headers to use SPDX identifiers

---
 MAINTAINERS                              |   2 +
 drivers/virt/vboxguest/vboxguest_utils.c | 801 +++++++++++++++++++++++++++++++
 drivers/virt/vboxguest/vmmdev.h          | 449 +++++++++++++++++
 include/linux/vbox_utils.h               |  79 +++
 4 files changed, 1331 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
index 6873b076eb7b..4a719fa047d6 100644
@@ -14543,7 +14543,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 +801 -0

801 lines not on this page · raw message

drivers/virt/vboxguest/vmmdev.h new file +449 -0

449 lines not on this page · raw message

include/linux/vbox_utils.h new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
2.14.3
#2 lore raw

PATCH v4 3/3 virt: Add vboxguest driver for Virtual Box Guest integration

In reply to Hans de Goede

This 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

Changes in v4:
-Change license headers to use SPDX identifiers

---
 drivers/virt/Kconfig                       |    1 +
 drivers/virt/Makefile                      |    1 +
 drivers/virt/vboxguest/Kconfig             |   18 +
 drivers/virt/vboxguest/Makefile            |    3 +
 drivers/virt/vboxguest/vboxguest_core.c    | 1571 ++++++++++++++++++++++++++++
 drivers/virt/vboxguest/vboxguest_core.h    |  174 +++
 drivers/virt/vboxguest/vboxguest_linux.c   |  466 +++++++++
 drivers/virt/vboxguest/vboxguest_version.h |   19 +
 8 files changed, 2253 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
index 99ebdde590f8..8d9cdfbd6bcc 100644
@@ -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
index c47f04dd343b..d3f7b2540890 100644
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_FSL_HV_MANAGER)	+= fsl_hypervisor.o
+obj-y				+= vboxguest/
drivers/virt/vboxguest/Kconfig new file +18 -0
new file mode 100644
index 000000000000..fffd318a10fe
@@ -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
new file mode 100644
index 000000000000..203b8f465817
@@ -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 +1571 -0

1,571 lines not on this page · raw message

drivers/virt/vboxguest/vboxguest_core.h new file +174 -0

174 lines not on this page · raw message

drivers/virt/vboxguest/vboxguest_linux.c new file +466 -0

466 lines not on this page · raw message

drivers/virt/vboxguest/vboxguest_version.h new file +19 -0
new file mode 100644
index 000000000000..77f0c8f8a231
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR CDDL-1.0) */
+/*
+ * 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