summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Rossi <rossi.f@inwind.it>2020-04-07 17:54:50 +0200
committerFabio Rossi <rossi.f@inwind.it>2020-04-07 17:54:50 +0200
commit2d4cac59511d20ffe9d4c9f99d76be32f84e573b (patch)
tree896b05c88aea6b547b12d6b52afdb22917d44419
parentapp-emulation/vmware-modules: fixes for kernel 5.3 (diff)
downloadvmware-2d4cac59511d20ffe9d4c9f99d76be32f84e573b.tar.gz
vmware-2d4cac59511d20ffe9d4c9f99d76be32f84e573b.tar.bz2
vmware-2d4cac59511d20ffe9d4c9f99d76be32f84e573b.zip
app-emulation/vmware-modules: fixes for kernel 5.4
Added patch to face the following upstream commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d5c3a62d0bb9b763e9378fe8f4cd79502e16cce8 Signed-off-by: Fabio Rossi <rossi.f@inwind.it>
-rw-r--r--app-emulation/vmware-modules/files/308-5.04-00-skb_frag_t.patch52
-rw-r--r--app-emulation/vmware-modules/vmware-modules-308.5.9.ebuild1
2 files changed, 53 insertions, 0 deletions
diff --git a/app-emulation/vmware-modules/files/308-5.04-00-skb_frag_t.patch b/app-emulation/vmware-modules/files/308-5.04-00-skb_frag_t.patch
new file mode 100644
index 0000000..f2a79ae
--- /dev/null
+++ b/app-emulation/vmware-modules/files/308-5.04-00-skb_frag_t.patch
@@ -0,0 +1,52 @@
+--- ./vmnet-only/userif.c 2020-03-22 00:10:12.265769247 +0100
++++ ./vmnet-only/userif.c.new 2020-03-22 00:13:38.735785312 +0100
+@@ -86,9 +86,12 @@
+ #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
+ # define compat_kmap(page) kmap(page)
+ # define compat_kunmap(page) kunmap(page)
+-#else
++#elif COMPAT_LINUX_VERSION_CHECK_LT(5, 4, 0)
+ # define compat_kmap(page) kmap((page).p)
+ # define compat_kunmap(page) kunmap((page).p)
++#else
++# define compat_kmap(page) kmap(page)
++# define compat_kunmap(page) kunmap(page)
+ #endif
+
+ /*
+@@ -598,20 +601,35 @@
+ for (frag = skb_shinfo(skb)->frags;
+ frag != skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags;
+ frag++) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ if (frag->size > 0) {
++#else
++ if (skb_frag_size(frag) > 0) {
++#endif
+ unsigned int tmpCsum;
+ const void *vaddr;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ vaddr = compat_kmap(frag->page);
+ tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
+ curr, frag->size, 0, &err);
+ compat_kunmap(frag->page);
++#else
++ vaddr = compat_kmap(skb_frag_page(frag));
++ tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
++ curr, skb_frag_size(frag), 0, &err);
++ compat_kunmap(skb_frag_page(frag));
++#endif
+
+ if (err) {
+ return err;
+ }
+ csum = csum_block_add(csum, tmpCsum, curr - buf);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ curr += frag->size;
++#else
++ curr += skb_frag_size(frag);
++#endif
+ }
+ }
+
diff --git a/app-emulation/vmware-modules/vmware-modules-308.5.9.ebuild b/app-emulation/vmware-modules/vmware-modules-308.5.9.ebuild
index d92cd23..aebac67 100644
--- a/app-emulation/vmware-modules/vmware-modules-308.5.9.ebuild
+++ b/app-emulation/vmware-modules/vmware-modules-308.5.9.ebuild
@@ -127,6 +127,7 @@ src_prepare() {
kernel_is ge 5 01 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.01-00-vm_fault_t.patch"
kernel_is ge 5 01 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.01-01-kernel_ds.patch"
kernel_is ge 5 03 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.03-00-force_sig.patch"
+ kernel_is ge 5 04 0 && epatch "${FILESDIR}/${PV_MAJOR}-5.04-00-skb_frag_t.patch"
# Allow user patches so they can support RC kernels and whatever else
epatch_user