[patch] Support for kernel 5.11.1 (Parallels Tools 16.1.3.4960)

This patch worked for me. I had to dust off some old linuxy cobwebs related to patching first. If anyone else is having trouble applying it without DKMS this is what I did:

  1. Mount the parallel-tools cd by going to Actions | Install Parallels Tools from the main menu on your MacOS host
  2. Copy the whole contents of the cd to your local hard drive (should be same dir where you downloaded the patch), it should be in something like /media/username/Parallels Tools
  3. go to the directory where you copied the files from Parallels Tools to
  4. go to the kmods directory
  5. extract prl_mod.tar.gz with something like tar zxf prl_mod.tar.gz
  6. apply the patch as GM originally suggested
    1. cd ..
    2. patch -p1 < parallels-tools-16.1.x.x-kernel-5.11.x.txt. (substitute the right version numbers for your specific patch)
    3. Pick the default response of [n] should you run into any parts of patch that were already applied
  7. After the patch has been applied rename prl_mod.tar.gz to something like prl_mod.tar.gz.orig
  8. Create a new tarball with the patched files
    1. cd kmods
    2. tar zcf prl_mod.tar.gz *
  9. At this point you have patched your local copy of the parallels-tools installer
  10. Go to the top level dir of the local installer, cd ..
  11. Run the install script, sudo ./install
I hope this makes it a bit easier for the next one to run into this issue.

And add one gripe point from me for the Parallels guys for making us go through this at all on a paid product that supposedly has support.

Hi,
Seems like that time of the year when I update to the shiny new kernel in my Arch and can no longer boot my VM came again. This time it took me quite a bit of time to fix all the incompatibilities (around 2.5 hours :( ), but I am up and running again. Attached is the patch against the latest Parallel Tools (as of this writing).
It works for me, but I am providing this as-is, so use your own judgement.

To apply the patch you need to unpack the "kmods/prl_mod.tar.gz" archive and then run "patch -p1 < /path/to/where/you/saved/parallels-tools-16.1.3.49160-kernel-5.11.1.diff". What to do next depends on your setup. You may repack the archive back and update using the official process (I never used it, so don't know how it works). If you are using DKMS, then you can just run "dkms add ." in that directory where you unpacked and patched files and it will add the modules to the current kernel.
 
Ok... so that should have been 5.12.13 (vice 5.11.13) but all that is overcome by events because the most recent update is kernel 5.13.4 as of today, so naturally tools won't build against it. This is freaking futile how Parallels' Linux support staff doesn't test kernel betas. Always playing catch-up or DIY.
 
First issue found with 5.13.4 is with how prl_kms_atomic* are no longer compatible pointers with drm:

/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:999:25: error: initialization of 'int (*)(s
truct drm_plane *, struct drm_atomic_state *)' from incompatible pointer type 'int (*)(struct drm_plane *, struct drm_plane_state *)
' [-Werror=incompatible-pointer-types]
999 | .atomic_check = prl_kms_atomic_check_plane_helper,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:999:25: note: (near initialization for 'prl
_kms_primary_plane_helper_funcs.atomic_check')

/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1000:26: error: initialization of 'void (*)
(struct drm_plane *, struct drm_atomic_state *)' from incompatible pointer type 'void (*)(struct drm_plane *, struct drm_plane_state
*)' [-Werror=incompatible-pointer-types]
1000 | .atomic_update = prl_kms_atomic_update_primary_plane_helper,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1000:26: note: (near initialization for 'pr
l_kms_primary_plane_helper_funcs.atomic_update')

/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1004:25: error: initialization of 'int (*)(
struct drm_plane *, struct drm_atomic_state *)' from incompatible pointer type 'int (*)(struct drm_plane *, struct drm_plane_state *
)' [-Werror=incompatible-pointer-types]
1004 | .atomic_check = prl_kms_atomic_check_plane_helper,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1004:25: note: (near initialization for 'pr
l_kms_cursor_plane_helper_funcs.atomic_check')

/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1005:26: error: initialization of 'void (*)
(struct drm_plane *, struct drm_atomic_state *)' from incompatible pointer type 'void (*)(struct drm_plane *, struct drm_plane_state
*)' [-Werror=incompatible-pointer-types]
1005 | .atomic_update = prl_kms_atomic_update_cursor_plane_helper,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/parallels-tools/16.5.1.49187/build/prl_vid/Video/Guest/Linux/kmod/prldrm.c:1005:26: note: (near initialization for 'pr
l_kms_cursor_plane_helper_funcs.atomic_update')
 
First issue found with 5.13.4 is with how prl_kms_atomic* are no longer compatible pointers with drm:
The patch for 5.13 has been posted a week ago by @Evan123 in reply to your comment :). Anyhow, I just created a thread with a patch for 5.13 (my version is a bit cleaner, but essential is the same as Evan's). Additionally, I included a patch for the executable shared folders. I am writing this message from a system running 5.13.4, by the way :).
 
@YossiZ I am on Macbook Pro with M1 chip and I managed to install Parallels Tools in Ubuntu Focal ARM64 following your post. Thank you!

Hi,
Had the same issue. (ERROR: modpost: "irq_to_desc" [/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko] undefined!)
After a few hours of digging into it I found a solution. It seems that the symbol irq_to_desc is not anymore exported from the kernel. I managed to change the code to use irq_get_irq_data instead.
Relevant code:
kmods/prl_mod/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h L118-126
Code:
//extern struct irq_desc *irq_to_desc(unsigned int irq);
#include <asm/irq.h>
#define prl_for_each_irq_desc(irq, irq_data)                        \
    for (irq = 0, irq_data = irq_get_irq_data(irq); irq < NR_IRQS;        \
         irq++, irq_data = irq_get_irq_data(irq))                        \
        if (!irq_data)                                                \
            ;                                                    \
        else
#else
kmods/prl_mod/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c L420
Code:
struct irq_data *irq_data;
kmods/prl_mod/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c L460-468
Code:
    prl_for_each_irq_desc(desc_idx, irq_data) {
        if (irq_count >= regs.a2)
            break;
        if (!irq_data)
            continue;

        if (irq_data->hwirq == regs.a1 + irq_count)
            dev->irqs[irq_count++] = desc_idx;
    }
kmods/prl_mod/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c L736 :)
Code:
MODULE_LICENSE("GPL");
The only problem is that that symbol is only exported for GPL licensed code... so I edited the license also to get it to compile...
 
patch with 16.1.2 and ubuntu 20.04.3 LTS , prompt "Reserved ..." and select [n] with default option, compile errors at /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:780:14 prlfs_getattr, any idea ?
 
patch with 16.1.2 and ubuntu 20.04.3 LTS , prompt "Reserved ..." and select [n] with default option, compile errors at /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:780:14 prlfs_getattr, any idea ?
By the way, setattr_copy show incompatible pointer type setattr_copu(inode, attr); include/linux/fs.h declare is setattr_copy(struct user_namespace*, struct inode * inode, Type error?
 
Oof, this is embarrassing (or should be) for users to be fixing their software for them.. Thanks for posting these fixes!
 
Hi, I just ran into this issue. Is anyone has a patch yet? I plan to purchase after the trial period but this thing is a show stopper for me
 
Back
Top