Parallels Tools Linux 5.14 patch

Discussion in 'Linux Guest OS Discussion' started by Evan123, Sep 9, 2021.

  1. Evan123

    Evan123 Bit Poster

    Messages:
    14
    Linux 5.14 continues on from 5.13 renaming kernel structures, causing Parallels Tools build to fail. This patch seems to work in very limited testing. I do not know what this code does, use at your own risk.

    --- prldrm.c.orig 2021-09-09 23:59:05.384654927 +0800
    +++ prldrm.c 2021-09-10 00:18:56.872610562 +0800
    @@ -1542,9 +1542,9 @@
    {
    DRM_DEBUG_DRIVER(PFX_FMT "pci:0000:%02x:%02x.%d",
    PFX_ARG,
    - dev->pdev->bus->number,
    - PCI_SLOT(dev->pdev->devfn),
    - PCI_FUNC(dev->pdev->devfn));
    + dev->dev->bus->number,
    + PCI_SLOT(dev->dev->devfn),
    + PCI_FUNC(dev->dev->devfn));
    return drm_pci_set_busid(dev, master);
    }
    #endif
    @@ -2582,7 +2582,7 @@
    DRM_ERROR(PFX_FMT "Failed allocating a drm device.", PFX_ARG);
    return PTR_ERR(dev);
    }
    - dev->pdev = pdev;
    + dev->dev = &pdev->dev;

    prl_dev = kzalloc(sizeof(*prl_dev), GFP_KERNEL);
    if (unlikely(!prl_dev)) {
     
    Mark Fine likes this.
  2. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    349
    These kernel updates have literally started to take the 'p'
     
  3. Mark Fine

    Mark Fine Kilo Poster

    Messages:
    349
    Implemented in advance (F34 is still on 5.13.14), but with kernel version dependencies:
    ---------------------------------------------------------------------
    #if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
    dev->pdev->bus->number,
    PCI_SLOT(dev->pdev->devfn),
    PCI_FUNC(dev->pdev->devfn));
    #else
    dev->dev->bus->number,
    PCI_SLOT(dev->dev->devfn),
    PCI_FUNC(dev->dev->devfn));
    #endif
    ---------------------------------------------------------------------
    #if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
    dev->pdev = pdev;
    #else
    dev->dev = &pdev->dev;
    #endif
    ---------------------------------------------------------------------
     
  4. (GalaxyMaster)

    (GalaxyMaster) Kilo Poster

    Messages:
    90
    Oh, I missed your thread guys :(. I did the same patch. Actually, the only thing that needed was to drop the line `dev->pdev` - it is unused in the kernel and was only used by parallel tools for the debugging output. @Evan123 correctly solved it in the debugging output with "dev->dev->bus->number", but even that is not needed since that block is dormant and is not used. What a mess that source code :)
     

Share This Page