VirtualBox

Changeset 48567 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Sep 19, 2013 10:51:40 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89119
Message:

CPUMR0: Avoid EFER writes whenever possible. Don't know which kernels actually set the EFER.FFXSR bit.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/CPUMR0.cpp

    r48545 r48567  
    490490        /* Clear MSR_K6_EFER_FFXSR or else we'll be unable to save/restore the XMM state with fxsave/fxrstor. */
    491491        uint64_t oldMsrEFERHost = 0;
     492        bool fRestoreEfer = false;
    492493        if (pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE)
    493494        {
    494495            oldMsrEFERHost = ASMRdMsr(MSR_K6_EFER);
    495             ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost & ~MSR_K6_EFER_FFXSR);
     496            if (oldMsrEFERHost & MSR_K6_EFER_FFXSR)
     497            {
     498                ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost & ~MSR_K6_EFER_FFXSR);
     499                fRestoreEfer = true;
     500            }
    496501        }
    497502        cpumR0SaveGuestRestoreHostFPUState(&pVCpu->cpum.s);
    498503
    499504        /* Restore EFER MSR */
    500         if (pVCpu->cpum.s.fUseFlags & CPUM_USED_MANUAL_XMM_RESTORE)
     505        if (fRestoreEfer)
    501506            ASMWrMsr(MSR_K6_EFER, oldMsrEFERHost | MSR_K6_EFER_FFXSR);
    502507
  • trunk/src/VBox/VMM/VMMR0/CPUMR0A.asm

    r48541 r48567  
    55
    66;
    7 ; Copyright (C) 2006-2011 Oracle Corporation
     7; Copyright (C) 2006-2013 Oracle Corporation
    88;
    99; This file is part of VirtualBox Open Source Edition (OSE), as
Note: See TracChangeset for help on using the changeset viewer.

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