VirtualBox

Changeset 105616 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Aug 7, 2024 8:22:21 PM (6 months ago)
Author:
vboxsync
Message:

VMM/IEM: Another iemTlbInvalidateLargePageWorkerInner optimization attempt and some stats. bugref:10727

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r105579 r105616  
    558558#endif
    559559
     560/** Enable the large page bitmap TLB optimization.
     561 *
     562 * The idea here is to avoid scanning the full 32 KB (2MB pages, 2*512 TLB
     563 * entries) or 64 KB (4MB pages, 2*1024 TLB entries) worth of TLB entries during
     564 * invlpg when large pages are used, and instead just scan 128 or 256 bytes of
     565 * the bmLargePage bitmap to determin which TLB entires that might be containing
     566 * large pages and actually require checking.
     567 *
     568 * There is a good posibility of false positives since we currently don't clear
     569 * the bitmap when flushing the TLB, but it should help reduce the workload when
     570 * the large pages aren't fully loaded into the TLB in their entirity...
     571 */
     572#define IEMTLB_WITH_LARGE_PAGE_BITMAP
    560573
    561574/**
     
    672685    uint32_t            cTlbPhysRevRollovers;
    673686
    674     /*uint32_t            au32Padding[2];*/
     687    /** Number of INVLPG (and similar) operations. */
     688    uint32_t            cTlbInvlPg;
     689    /** Subset of cTlbInvlPg that involved non-global large pages. */
     690    uint32_t            cTlbInvlPgLargeNonGlobal;
     691    /** Subset of cTlbInvlPg that involved global large pages. */
     692    uint32_t            cTlbInvlPgLargeGlobal;
     693
     694    uint32_t            au32Padding[13];
    675695
    676696    /** The TLB entries.
     
    678698     * Odd  entries are for PTE.G=1 and uses uTlbRevisionGlobal. */
    679699    IEMTLBENTRY         aEntries[IEMTLB_ENTRY_COUNT * 2];
     700#ifdef IEMTLB_WITH_LARGE_PAGE_BITMAP
     701    /** Bitmap tracking TLB entries for large pages.
     702     * This duplicates IEMTLBE_F_PT_LARGE_PAGE for each TLB entry. */
     703    uint64_t            bmLargePage[IEMTLB_ENTRY_COUNT * 2 / 64];
     704#endif
    680705} IEMTLB;
    681706AssertCompileSizeAlignment(IEMTLB, 64);
     707#ifdef IEMTLB_WITH_LARGE_PAGE_BITMAP
     708AssertCompile(IEMTLB_ENTRY_COUNT >= 32 /* bmLargePage ASSUMPTION */);
     709#endif
    682710/** The width (in bits) of the address portion of the TLB tag.   */
    683711#define IEMTLB_TAG_ADDR_WIDTH   36
     
    862890    iemTlbTrace(a_pVCpu, kIemTlbTraceType_User3, a_u64Param1, a_u64Param2, a_bParam, a_u32Param)
    863891#else
     892# define IEMTLBTRACE_USER0(a_pVCpu, a_u64Param1, a_u64Param2, a_u32Param, a_bParam) do { } while (0)
    864893# define IEMTLBTRACE_USER1(a_pVCpu, a_u64Param1, a_u64Param2, a_u32Param, a_bParam) do { } while (0)
    865894# define IEMTLBTRACE_USER2(a_pVCpu, a_u64Param1, a_u64Param2, a_u32Param, a_bParam) do { } while (0)
    866895# define IEMTLBTRACE_USER3(a_pVCpu, a_u64Param1, a_u64Param2, a_u32Param, a_bParam) do { } while (0)
    867 # define IEMTLBTRACE_USER4(a_pVCpu, a_u64Param1, a_u64Param2, a_u32Param, a_bParam) do { } while (0)
    868896#endif
    869897
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