VirtualBox

Changeset 85776 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 14, 2020 8:05:40 PM (4 years ago)
Author:
vboxsync
Message:

SUPDrv/linux: Corrections to the 5.8 changes to supdrvOSChangeCR4. bugref:9801 ticketref:19644

File:
1 edited

Legend:

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

    r85698 r85776  
    758758{
    759759#if RTLNX_VER_MIN(5,8,0)
    760     RTCCUINTREG const uOld = __read_cr4();
    761 #elif RTLNX_VER_MIN(3,20,0)
     760    unsigned long fSavedFlags;
     761    local_irq_save(fSavedFlags);
     762    RTCCUINTREG const uOld = cr4_read_shadow();
     763    cr4_update_irqsoff(fOrMask, ~fAndMask); /* Same as this function, only it is not returning the old value. */
     764    AssertMsg(cr4_read_shadow() == ((uOld & fAndMask) | fOrMask),
     765              ("fOrMask=%#RTreg fAndMask=%#RTreg uOld=%#RTreg; new cr4=%#llx\n", fOrMask, fAndMask, uOld, cr4_read_shadow()));
     766    local_irq_restore(fSavedFlags);
     767#else
     768# if RTLNX_VER_MIN(3,20,0)
    762769    RTCCUINTREG const uOld = this_cpu_read(cpu_tlbstate.cr4);
    763 #else
     770# else
    764771    RTCCUINTREG const uOld = ASMGetCR4();
    765 #endif
     772# endif
    766773    RTCCUINTREG const uNew = (uOld & fAndMask) | fOrMask;
    767774    if (uNew != uOld)
    768775    {
    769 #if RTLNX_VER_MIN(5,8,0)
    770         ASMSetCR4(uNew);
    771 #elif RTLNX_VER_MIN(3,20,0)
     776# if RTLNX_VER_MIN(3,20,0)
    772777        this_cpu_write(cpu_tlbstate.cr4, uNew);
    773778        __write_cr4(uNew);
    774 #else
     779# else
    775780        ASMSetCR4(uNew);
    776 #endif
    777     }
     781# endif
     782    }
     783#endif
    778784    return uOld;
    779785}
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