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

I will guarantee it works with Fedora 33. I'm using it right now. Make sure it's actually installing the correct version of Tools because it does not delete the old one and for some stupid reason the install process uses the first one listed in an alphanumeric search (yeah, I know... it's dumb).
Delete any old version of parallels-tools from /usr/src/ EXCEPT parallel-tools-16.5.0.49183. Then try to reinstall.
 
The only version of Tools I have on there is 1.16.5.0.50692
Code:
ls -alr /usr/src
total 0
drwxr-xr-x. 1 root root 138 Apr 17 17:39 parallels-tools-16.5.0.50692
drwxr-xr-x. 1 root root  94 Apr 17 17:51 kernels
drwxr-xr-x. 1 root root   0 Jul 27  2020 debug
drwxr-xr-x. 1 root root 100 Oct 19  2020 ..
drwxr-xr-x. 1 root root  80 Apr 17 17:39 .
Output at end of /var/log/parallels-tools-install.log
Code:
ODPOST /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers
ERROR: modpost: "irq_to_desc" [/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko] undefined!
make[3]: *** [scripts/Makefile.modpost:111: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers] Error 1
make[3]: *** Deleting file '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers'
make[2]: *** [Makefile:1725: modules] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.11.14-200.fc33.aarch64'
make[1]: *** [Makefile:43: prl_tg] Error 2
make[1]: Leaving directory '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg'
make: *** [Makefile.kmods:30: compile] Error 2
make: Leaving directory '/usr/lib/parallels-tools/kmods'
Error: could not build kernel modules
 
Well, that was the most common reason, but I see you're running aarch64. I'm running x86_64. Perhaps there's a problem building Tools on ARM64?
 
Well, that was the most common reason, but I see you're running aarch64. I'm running x86_64. Perhaps there's a problem building Tools on ARM64?

Yep. I'm trying to run on an M1 Mac. Must be ask issue with aarch64. Thanks for the suggestion anyway.
 
This seems like the place I might actually get a response - have any of you had issues with i3 and multiple displays?

Can't get it working on arch no matter what I try. Compositors, different backends for such compositors, latest parallels tools are installed and are working okay ( shared clipboard, automatic resolution change with prlcc ) but can't get multiple monitors working no matter what I try.
 
Parallels Tools works for me on openSUSE Tumbleweed, kernel 5.12.3, Parallels 16.5.0. I didn't need to do anything special.
 
Parallels Tools works for me on openSUSE Tumbleweed, kernel 5.12.3, Parallels 16.5.0. I didn't need to do anything special.
Sorry, I should add -- although I don't have to do anything special to get Parallels Tools to work with modern kernels up to at least 5.12.4 (Tumbleweed as of today), I do have to reinstall Parallels Tools after every kernel upgrade. Failure to reinstall Parallels Tools after a kernel upgrade causes the system to hang on boot during the switch to GUI.
 
Yep. I'm trying to run on an M1 Mac. Must be ask issue with aarch64. Thanks for the suggestion anyway.
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...
 
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...
Well I gave this a shot but no joy. Thanks anyway. Users shouldn't have to decompile and recompile code to make commercially available software to work. I guess I'll just wait until VMWare comes out with the M1 version of Fusion. Meanwhile, I'll stick with Ubuntu 20.10 for now. You would think Parallels would patch these issues when they become know. But then again, it seems they have all of their eggs in the Microsoft basket.
 
Code:
Start installation or upgrade of Guest Tools
new version of parallels tools
Installed Guest Tools were not found
Register service to install new Guest Tools
Perform installation into the /usr/lib/parallels-tools directory
make: Entering directory '/usr/lib/parallels-tools/kmods'
make: Makefile.kmods: No such file or directory
make: Leaving directory '/usr/lib/parallels-tools/kmods'
make: *** No rule to make target 'Makefile.kmods'.  Stop.
Error: could not build kernel modules
Error: failed to install Parallels Guest Tools!
2021-07-12T13:48:17-0500: Started installation of Parallels Guest Tools version '16.5.0.50692'

Mon Jul 12 13:48:17 CDT 2021
Start installation or upgrade of Guest Tools
make: Makefile.kmods: No such file or directory
make: *** No rule to make target 'Makefile.kmods'.  Stop.
Error: could not build kernel modules
Error: failed to install Parallels Guest Tools!
2021-07-12T13:48:17-0500: execCmd: ./install --install [167]
2021-07-12T13:48:17-0500: Error: An error occurred when installing Parallels Tools. Please go to /var/log/parallels-tools-install.log for more information.
2021-07-12T13:48:32-0500: Exiting with code 1

This is what I got after making the listed changes and trying to reinstall.
 
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.
I also have tried your suggestion, but it still fails.
Start installation or upgrade of Guest Tools
installer:%10.000000
installer:%20.000000
new version of parallels tools
Installed Guest Tools were not found
Register service to install new Guest Tools
installer:%30.000000
Perform installation into the /usr/lib/parallels-tools directory
installer:%40.000000
make: Entering directory '/usr/lib/parallels-tools/kmods'
Will use compiler CC="cc".
Compiler version "cc (Ubuntu 10.3.0-1ubuntu1) 10.3.0"
cd prl_tg/Toolgate/Guest/Linux/prl_tg && make CC=cc
make[1]: Entering directory '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg'
1: /lib/modules/5.11.0-22-generic/build
2: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg
3: 20210705
4: 1.9.0
Start compile prl_tg...
make -C /lib/modules/5.11.0-22-generic/build M=/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg SRCROOT=/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg CC=cc modules
make[2]: Entering directory '/usr/src/linux-headers-5.11.0-22-generic'
1: /lib/modules/5.11.0-22-generic/build
2: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg
3: 20210705
4: 1.9.0
CC [M] /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.o
In file included from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:21:
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h: In function 'tg_out':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:186:7: warning: assignment to 'long unsigned int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
186 | port += dev->base_addr;
| ^~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:190:17: warning: passing argument 2 of 'iowrite64' makes pointer from integer without a cast [-Wint-conversion]
190 | iowrite64(val, port);
| ^~~~
| |
| long unsigned int
In file included from ./arch/arm64/include/asm/io.h:194,
from ./include/linux/io.h:13,
from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:8:
./include/asm-generic/io.h:769:64: note: expected 'volatile void *' but argument is of type 'long unsigned int'
769 | static inline void iowrite64(u64 value, volatile void __iomem *addr)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prl_tg_initialize':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:434:22: warning: multi-character character constant [-Wmultichar]
434 | if ((int)regs.a0 != 'MMIO') {
| ^~~~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:447:22: warning: multi-character character constant [-Wmultichar]
447 | if ((int)regs.a0 != 'EIRQ' || regs.a1 + regs.a2 > NR_IRQS) {
| ^~~~~~
In file included from ./include/linux/printk.h:7,
from ./include/linux/kernel.h:16,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:5:
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prl_tg_probe_common':
./include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'void *' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
./include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
14 | #define KERN_INFO KERN_SOH "6" /* informational */
| ^~~~~~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:568:9: note: in expansion of macro 'KERN_INFO'
568 | printk(KERN_INFO "detected %s, base addr %llx, IRQ = {%d, %d %d %d}\n",
| ^~~~~~~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:568:46: note: format string is defined here
568 | printk(KERN_INFO "detected %s, base addr %llx, IRQ = {%d, %d %d %d}\n",
| ~~~^
| |
| long long unsigned int
| %p
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c: In function 'prl_tg_deinitialize':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:599:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
599 | int i = 0;
| ^~~
CC [M] /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.o
In file included from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:15:
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h: In function 'tg_out':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:186:7: warning: assignment to 'long unsigned int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
186 | port += dev->base_addr;
| ^~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:190:17: warning: passing argument 2 of 'iowrite64' makes pointer from integer without a cast [-Wint-conversion]
190 | iowrite64(val, port);
| ^~~~
| |
| long unsigned int
In file included from ./arch/arm64/include/asm/io.h:194,
from ./include/linux/scatterlist.h:9,
from ./include/linux/dma-mapping.h:10,
from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:9:
./include/asm-generic/io.h:769:64: note: expected 'volatile void *' but argument is of type 'long unsigned int'
769 | static inline void iowrite64(u64 value, volatile void __iomem *addr)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c: In function 'tg_req_map_internal':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:66:18: warning: unused variable 'pdev' [-Wunused-variable]
66 | struct pci_dev *pdev = req->dev->pci_dev;
| ^~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c: In function 'tg_req_map_user_pages':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:105:18: warning: unused variable 'pdev' [-Wunused-variable]
105 | struct pci_dev *pdev = req->dev->pci_dev;
| ^~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c: In function 'tg_req_map_kernel_pages':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:168:18: warning: unused variable 'pdev' [-Wunused-variable]
168 | struct pci_dev *pdev = req->dev->pci_dev;
| ^~~~
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c: In function 'tg_req_unmap_pages':
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:236:18: warning: unused variable 'pdev' [-Wunused-variable]
236 | struct pci_dev *pdev = req->dev->pci_dev;
| ^~~~
LD [M] /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.o
1: /lib/modules/5.11.0-22-generic/build
2: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg
3: 20210705
4: 1.9.0
MODPOST /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers
ERROR: modpost: "irq_to_desc" [/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko] undefined!
make[3]: *** [scripts/Makefile.modpost:111: /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers] Error 1
make[3]: *** Deleting file '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/Module.symvers'
make[2]: *** [Makefile:1752: modules] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.11.0-22-generic'
make[1]: *** [Makefile:43: prl_tg] Error 2
make[1]: Leaving directory '/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg'
make: *** [Makefile.kmods:30: compile] Error 2
make: Leaving directory '/usr/lib/parallels-tools/kmods'
Error: could not build kernel modules
Error: failed to install Parallels Guest Tools!
It would have been nice. Parallels support has told me that they are aware and wil come with an update. But when? When the next version of Ubuntu is coming along?
At least Ubuntu still works fine in a way, but no more shares of macOS or copy paste functions between guest and host. May be you find a fix?
 
Sorry to hear that. What was the exact error?
Hi @YossiZ. Thank you! Your are a hero! It does work. I had a spacing issue or better say wrong alined. After correcting it it does work.
I have Ubuntu 21.04 running perfectly on my M1 Mac mini in Parallels. The shares are finally back again.
Please ignore my previous post.
 

Attachments

  • Schermafbeelding 2021-07-18 om 00.34.59.png
    Schermafbeelding 2021-07-18 om 00.34.59.png
    123.8 KB · Views: 17
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...

Hi @YossiZ. Thank you for your huge work! But I couldn't reproduce all your steps.
I did all that you wrote and got new error.
I attached log.
 

Attachments

I gave this another shot and it worked this time. The last time I think I might have used the pro-lin.iso instead of the pro-lin-arm.iso image. Thanks for the information and the patch!
 
Ref Fedora 34:

Starting to notice a new thing that started with 5.11.13: There's a real annoying long delay after it finds the root partition, and just before it finds the swap partition. It used to breeze right through boot up. Not anymore...

Also, within the past week, right after the Gnome extensions were updated, something seems to be messing up the mouse something fierce. After a while, left clicks don't want to register, making you have to use keyboard workarounds. Unsure if this is a Gnome thing or a Tools interface issue with the .15 kernel (which was updated right about the same time).

Anyone else seeing these?
 
Hi @IliaD
I apologize for not creating a standard diff file for my edits... it seems that you have not edited the code correctly
The relevant line from the error log is this:
Code:
/usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c:466:15: error: 'struct irq_data' has no member named 'irq_data'
  466 |   if (irq_data->irq_data.hwirq == regs.a1 + irq_count)
      |               ^~
However the line of code should read as follows:
Code:
if (irq_data->hwirq == regs.a1 + irq_count)
Please make sure you have edited all relevant sections correctly
 
Ref Fedora 34:
Starting to notice a new thing that started with 5.11.13: There's a real annoying long delay after it finds the root partition, and just before it finds the swap partition. It used to breeze right through boot up. Not anymore...
Anyone else seeing these?
I am running Arch Linux and stumbled upon the same after Arch updated to systemd v249. The issue manifests itself with the boot sequence sitting at the ":: trigerring uvents..." message for approximately 60 seconds. I didn't have the time to investigate it yet, though. My suspicion is that it is the result of the recent changes in the udev subsystem of systemd (the changelog mentions that the logic has been reworked over the last couple of versions).
 
I am running Arch Linux and stumbled upon the same after Arch updated to systemd v249. The issue manifests itself with the boot sequence sitting at the ":: trigerring uvents..." message for approximately 60 seconds. I didn't have the time to investigate it yet, though. My suspicion is that it is the result of the recent changes in the udev subsystem of systemd (the changelog mentions that the logic has been reworked over the last couple of versions).
Thanks. I haven't been keeping track of what they've been doing to the kernel or subsystems but I'm certain one of these bi-weekly kernel updates will finally fix it.
As for the mouse issue, like it always seems with Gnome changes, it clears up after a few reboots... it's never just one or two reboots until it sorts itself out. Very wierd.
 
Back
Top