[patch] Support for kernel 5.17 (Parallels Tools 17.1.2.51548)

Discussion in 'Linux Guest OS Discussion' started by (GalaxyMaster), Mar 31, 2022.

  1. (GalaxyMaster)

    (GalaxyMaster) Kilo Poster

    Messages:
    106
    Hello,

    Once again, the time has come when a new kernel has been released and yet the official latest tools do not yet support it, so here is a patch that addresses the compatibility with kernels 5.17+. It is a very small patch that reflects a change for `PDE_DATA()` being renamed to `pde_data()` in kernels 5.17.

    P.S. As always, I am writing this message from a VM running on the kernel and patched guest tools, so it works for me, but you mileage may vary. I do not have M1, so this patch has been tested only on Intel-based Macs. It should not be hard to patch M1's version accordingly.
     

    Attached Files:

    Meng-Yuan Huang and StanislavM3 like this.
  2. RayR2

    RayR2 Bit Poster

    Messages:
    19
    Can confirm this patch works on M1 MacBook. Thanks!
     
    (GalaxyMaster) likes this.
  3. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    More may have to be done for non-ARM machines for 5.17.4 in prltg_common.h. Apparently, the compiler no longer likes dev->base_addr being void in tg_in32(), tg_out32(), and tg_out(). Typecasting it as 'unsigned long' in each seems to fix it.
     
  4. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    Two more issues in prl_eth...
    1. In prl_eth/pvmnet/pvmnet.c: Compiler no longer likes dev->dev_addr dropping 'const' from 'unsigned char *' in io_get_mac_address(), so it has to be typecasted as well.
    2. Also in prl_eth/pvmnet/pvmnet.c: Apparently eth_change_mtu no longer exists... tracking down what happened there.
     
  5. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    So eth_change_mtu is depricated and no longer used... Can't see any other use of .ndo_change_mtu nor .extended.ndo_change_mtu so best to remove the references from pvmnet.c
     
  6. StanislavM3

    StanislavM3 Bit Poster

    Messages:
    1
    Yes, patch work, thank you!
     
  7. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    Here is the updated patch file given the changes I made.

    Please note that since 5.17.4 is the first 5.17.x kernel I've installed in FC35 the patch includes conditional ifs for KERNEL_VERSION(5,17,4). I have no idea if the changes are required for anything earlier than that so the ',4)' part may have to be adjusted for any earlier kernel you may be trying to apply it to.

    Cheers to @(GalaxyMaster) for taking the first crack at this.
     

    Attached Files:

    SeanK8, BoranL and StanislavM3 like this.
  8. HanwenZ

    HanwenZ Bit Poster

    Messages:
    4
    Excuse me but, how can I use this patch? thanks.
     
    HalukT1 and RobJ6 like this.
  9. RobJ6

    RobJ6 Bit Poster

    Messages:
    2
    +1
     
    FranciscoS6 likes this.
  10. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    A search would have found the entire procedure I wrote on Nov 28, 2020, aptly entitled, Tools Patch Procedure: https://forum.parallels.com/threads/tools-patch-procedure.351669/

    Disclaimer: Do at your own risk. The procedure is only recommended for those who are familiar with code modification and simple *nix commands. Otherwise, I don't recommend the average user doing it.
     
    FranciscoS6, SeanK8 and RobJ6 like this.
  11. RobJ6

    RobJ6 Bit Poster

    Messages:
    2
    Thanks. Worked perfect.
     
    Mark Fine likes this.
  12. Alex103

    Alex103

    Messages:
    1
    thanks for the patch!
     
  13. Angelo C

    Angelo C Bit Poster

    Messages:
    2
    Use the attached file to replace the prl_mod.tar.gz file in the kmods folder. This file has the patches implemented. I needed to do it manually since the patch process did not work for me. I can confirm that this is working in Fedora 36 on kernel version 5.17.6.

    Note: remove the .zip extension so the file is named "prl_mod.tar.gz". The uploaded did not allow gz files so I just added the ".zip" to the end of the filename.
     

    Attached Files:

  14. DarrenS2

    DarrenS2 Bit Poster

    Messages:
    7
    A time saver - thanks. I also had issues with the patching on Fedora's kernel. This worked a treat
     
  15. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    FYI: Just want to point out that there are a whole host of reasons for providing a textual patch file, which avoids the potential for passing undetectable malware and/or violating Parallels' intellectual property rights. This is a real bad idea.
     
  16. DarrenS2

    DarrenS2 Bit Poster

    Messages:
    7
    That's a good point actually. Ideally Parallels would support their paying customers with timely updates
     
  17. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    They haven't kept up with evolving Linux kernals for at least a decade. Yes, it would be ideal if they did, but so would having a dolphin that sang my name.
     
  18. SeanK8

    SeanK8 Bit Poster

    Messages:
    3
    The patch file named parallels-tools-17.1.2.51548-fixes-r2.txt linked above and the directions Tools Patch Procedure: https://forum.parallels.com/threads/tools-patch-procedure.351669/ finally got me to a working solution with Fedora 35.

    I did have to remove the patch relating to parallels-tools-17.1.2.51548/kmods/prl_eth/pvmnet/pvmnet.c as there was no prl_eth directory in my kmod folder at all, even though I am running Parallels Version 17.1.2 (51548). I attached my tweaked version, just in case, this directory is missing for others as well.

    Thank you for posting the patches and direction links! They were very helpful!

    Sean
     

    Attached Files:

  19. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    449
    The patch was for an Intel installation. It may be possible that there is no hooking of internet services (prl_eth) in the ARM version of Parallels, though I'd find that to be a little strange that the Tools would be packaged differently. If you are using ARM on an M1 Mac, you might want to clarify that your patch is for that kind of installation to avoid any confusion to those installing for Intel.
     
  20. SeanK8

    SeanK8 Bit Poster

    Messages:
    3
    You are indeed correct. I was working with the ARM64 version of Parallels, so the parallels-tools-17.1.2.51548-fixes-r2-minus-eth.txt patch that I posted above is modified to work with Parallels running on Apple Silicon (ARM64/M1) systems.

    I have no idea why prl_eth/pvmnet/pvmnet.c is not int the Parallels Tools on ARM, but it is not there, and applying this patch worked great for me on a fully updated Fedora 36 VM.
     

Share This Page