<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The latest version of the Guest Additions (both 6.1.4 and master) fail to compile the kernel modules on a CentOS 8.1 guest using kernel 4.18.0-177.el8.x86_64 – the latest kernel available through the “Streams” release (which allows CentOS
 users to get early versions of packages that will be in the next minor release).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve provided an initial patch that partly fixes this below (authored by me, released under the MIT license).  With this patch the video module compiles and works  - *but* I’m not sure exactly what the #include guards ought to be.  We can’t
 actually test for RHEL_81 being defined, because then guest additions will stop compiling for anyone on the main RHEL/CentOS 8.1 release.  Unfortunately there’s no real way I can see to tell if we are using at least  4.18.0-177.el8 (which needs these changes)
 or an earlier 8.1 kernel.  The kernel release number is available as the RHEL_RELEASE #define in the kernel tree, but that’s a string, not an integer, and the C pre-processor can’t do string comparisons.  I think we’d need some Makefile enhancements to pass
 in extra #defines, but not sure exactly where in the Makefiles those should live…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Even if this isn’t fixed for CentOS 8 Streams guests, this patch will almost certainly be needed for RHEL/CentOS 8.2 when that comes out<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Mark<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">diff -uNr -w a/vbox_fb.c b/vbox_fb.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">--- a/vbox_fb.c 2020-02-18 15:31:10.000000000 +0000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">+++ b/vbox_fb.c 2020-03-03 16:33:07.197239177 +0000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">@@ -335,14 +331,14 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) || defined(RHEL_81)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     drm_fb_helper_fill_info(info, &fbdev->helper, sizes);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#else<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_81)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">     drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">                       sizes->fb_height);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">diff -uNr -w a/vbox_ttm.c b/vbox_ttm.c<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">--- a/vbox_ttm.c 2020-02-14 11:35:05.000000000 +0000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">+++ b/vbox_ttm.c 2020-03-03 16:33:07.199239341 +0000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">@@ -312,7 +308,7 @@<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">                                  dev->vma_offset_manager,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">-#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) && !defined(RHEL_81)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">                      DRM_FILE_PAGE_OFFSET,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">                      true);<o:p></o:p></span></p>
</div>
</body>
</html>