VirtualBox

Changeset 64880 in vbox


Ignore:
Timestamp:
Dec 15, 2016 2:53:09 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112287
Message:

VMM/HMVMXR0: "& 0xf" is redundant while right-shifting a uint8_t by 4 bits. Also comment clarification.

File:
1 edited

Legend:

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

    r64873 r64880  
    34143414            && APICIsEnabled(pVCpu))
    34153415        {
    3416             /* Setup TPR shadowing. Also setup TPR patching for 32-bit guests. */
    34173416            if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_TPR_SHADOW)
    34183417            {
     
    34263425
    34273426                /*
    3428                  * If there are external interrupts pending but masked by the TPR value, instruct VT-x to cause a VM-exit when
    3429                  * the guest lowers its TPR below the highest-priority pending interrupt and we can deliver the interrupt.
    3430                  * If there are no external interrupts pending, set threshold to 0 to not cause a VM-exit. We will eventually deliver
    3431                  * the interrupt when we VM-exit for other reasons.
     3427                 * If there are interrupts pending but masked by the TPR, instruct VT-x to cause a TPR-below-threshold VM-exit
     3428                 * when the guest lowers its TPR below the priority of the pending interrupt so we can deliver the interrupt.
     3429                 * If there are no interrupts pending, set threshold to 0 to not cause any TPR-below-threshold VM-exits.
    34323430                 */
    34333431                pVCpu->hm.s.vmx.pbVirtApic[XAPIC_OFF_TPR] = u8Tpr;
     
    34363434                {
    34373435                    /* Bits 3:0 of the TPR threshold field correspond to bits 7:4 of the TPR (which is the Task-Priority Class). */
    3438                     const uint8_t u8PendingPriority = (u8PendingIntr >> 4) & 0xf;
    3439                     const uint8_t u8TprPriority     = (u8Tpr >> 4) & 0xf;
     3436                    const uint8_t u8PendingPriority = u8PendingIntr >> 4;
     3437                    const uint8_t u8TprPriority     = u8Tpr >> 4;
    34403438                    if (u8PendingPriority <= u8TprPriority)
    34413439                        u32TprThreshold = u8PendingPriority;
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