vboxguestdrivers: fix compilation against 6.4 kernel / headers

The vboxguest drivers (vboxsf) fail to build against the 6.4 kernel
due to iovec iterator changes.

This is a port of the gentoo patches (which are picked from the upstream
virtualbox repository) to address the compilation issues.

We obviously can drop these when the next version of the guest additions
is available.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Bruce Ashfield
2023-07-04 16:11:21 +00:00
committed by Khem Raj
parent c4622575ff
commit 26a65327ef
3 changed files with 74 additions and 0 deletions
@@ -0,0 +1,29 @@
Initial support for kernel 6.4
https://www.virtualbox.org/changeset/99666/vbox
Upstream-Status: Backport [https://gitweb.gentoo.org/repo/gentoo.git/tree/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-7.0.8-kernel-6.4-patch-1.patch]
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -75,4 +75,11 @@
#if RTLNX_VER_MAX(2,5,12)
# define PageUptodate(a_pPage) Page_Uptodate(a_pPage)
+#endif
+
+/** Starting from 6.4.0, iter_iov() macro should be used in order to access to iov field. */
+#if RTLNX_VER_MIN(6,4,0)
+# define VBOX_ITER_IOV(_iter) iter_iov(_iter)
+#else
+# define VBOX_ITER_IOV(_iter) iter->iov
#endif
@@ -2400,5 +2407,5 @@
if (iter_is_iovec(iter) || (VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)) {
# endif
- const struct iovec *pCurIov = iter->iov;
+ const struct iovec *pCurIov = VBOX_ITER_IOV(iter);
size_t cLeft = iter->nr_segs;
size_t cPagesSpan = 0;
@@ -0,0 +1,43 @@
Initial support for kernel 6.4
https://www.virtualbox.org/changeset/99667/vbox
Upstream-Status: Backport [https://gitweb.gentoo.org/repo/gentoo.git/tree/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-7.0.8-kernel-6.4-patch-2.patch]
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -77,11 +77,4 @@
#endif
-/** Starting from 6.4.0, iter_iov() macro should be used in order to access to iov field. */
-#if RTLNX_VER_MIN(6,4,0)
-# define VBOX_ITER_IOV(_iter) iter_iov(_iter)
-#else
-# define VBOX_ITER_IOV(_iter) iter->iov
-#endif
-
/*********************************************************************************************************************************
@@ -94,4 +87,12 @@
#else
# define VBSF_GET_ITER_TYPE(a_pIter) ((a_pIter)->type)
+#endif
+
+/** Starting from 6.4.0, iter_iov() macro should be used in order to access to iov field
+ * of struct iov_iter. */
+#if RTLNX_VER_MIN(6,4,0)
+# define VBSF_GET_ITER_IOV(_iter) iter_iov(_iter)
+#else
+# define VBSF_GET_ITER_IOV(_iter) iter->iov
#endif
@@ -2407,5 +2408,5 @@
if (iter_is_iovec(iter) || (VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)) {
# endif
- const struct iovec *pCurIov = VBOX_ITER_IOV(iter);
+ const struct iovec *pCurIov = VBSF_GET_ITER_IOV(iter);
size_t cLeft = iter->nr_segs;
size_t cPagesSpan = 0;
@@ -13,6 +13,8 @@ VBOX_NAME = "VirtualBox-${PV}"
SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \
file://Makefile.utils \
file://virtualbox-guest-additions-7.0.8-kernel-6.4-patch-1.patch \
file://virtualbox-guest-additions-7.0.8-kernel-6.4-patch-2.patch \
"
SRC_URI[sha256sum] = "c305fbe480f507eac7c36893ead66dffaacda944f19c3813a4533e9c39bae237"