VirtualBox

Ignore:
Timestamp:
Jul 23, 2020 11:58:10 AM (4 years ago)
Author:
vboxsync
Message:

SUPDrv/supdrvOSChangeCR4: Adjustments for 5.8. bugref:9801

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r83325 r85431  
    757757RTCCUINTREG VBOXCALL supdrvOSChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask)
    758758{
    759 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
    760     RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4);
    761     RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask;
     759#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     760    RTCCUINTREG const uOld = __read_cr4();
     761#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
     762    RTCCUINTREG const uOld = this_cpu_read(cpu_tlbstate.cr4);
     763#else
     764    RTCCUINTREG const uOld = ASMGetCR4();
     765#endif
     766    RTCCUINTREG const uNew = (uOld & fAndMask) | fOrMask;
    762767    if (uNew != uOld)
    763768    {
     769#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
     770        ASMSetCR4(uNew);
     771#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
    764772        this_cpu_write(cpu_tlbstate.cr4, uNew);
    765773        __write_cr4(uNew);
    766     }
    767774#else
    768     RTCCUINTREG uOld = ASMGetCR4();
    769     RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask;
    770     if (uNew != uOld)
    771775        ASMSetCR4(uNew);
    772776#endif
     777    }
    773778    return uOld;
    774779}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette