VirtualBox

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


Ignore:
Timestamp:
Jan 19, 2022 11:35:13 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149428
Message:

VMM/NEM-win: Kicked out most of the ring-0 code because bugref:10118 + bugref:10162 means we won't use it again.

File:
1 edited

Legend:

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

    r93207 r93351  
    5353 * Windows: Code configuration.
    5454 */
    55 # ifndef VBOX_WITH_PGM_NEM_MODE
    56 #  define NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    57 #endif
    5855//# define NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS   /**< Applies to ring-3 code only. Useful for testing VID API. */
    5956//# define NEM_WIN_USE_OUR_OWN_RUN_API            /**< Applies to ring-3 code only. Useful for testing VID API. */
    60 //# define NEM_WIN_WITH_RING0_RUNLOOP             /**< Enables the ring-0 runloop. */
    61 //# define NEM_WIN_USE_RING0_RUNLOOP_BY_DEFAULT   /**< For quickly testing ring-3 API without messing with CFGM. */
    6257# if defined(NEM_WIN_USE_OUR_OWN_RUN_API) && !defined(NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS)
    6358#  error "NEM_WIN_USE_OUR_OWN_RUN_API requires NEM_WIN_USE_HYPERCALLS_FOR_REGISTERS"
    64 # endif
    65 # if defined(NEM_WIN_USE_OUR_OWN_RUN_API) && !defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES)
    66 #  error "NEM_WIN_USE_OUR_OWN_RUN_API requires NEM_WIN_USE_HYPERCALLS_FOR_PAGES"
    67 # endif
    68 # if defined(NEM_WIN_WITH_RING0_RUNLOOP) && !defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES)
    69 #  error "NEM_WIN_WITH_RING0_RUNLOOP requires NEM_WIN_USE_HYPERCALLS_FOR_PAGES"
    70 # endif
    71 # if defined(VBOX_WITH_PGM_NEM_MODE) && defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES)
    72 #  error "VBOX_WITH_PGM_NEM_MODE cannot be used together with NEM_WIN_USE_HYPERCALLS_FOR_PAGES"
    7359# endif
    7460
     
    263249    /** Number of currently mapped pages. */
    264250    uint32_t volatile           cMappedPages;
    265 #  ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    266251    /** Max number of pages we dare map at once. */
     252#ifdef VBOX_WITH_PGM_NEM_MODE
     253    /** @todo consider removing this.   */
     254#endif
    267255    uint32_t                    cMaxMappedPages;
    268 #  endif
    269256    STAMCOUNTER                 StatMapPage;
    270257    STAMCOUNTER                 StatUnmapPage;
    271 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    272     STAMCOUNTER                 StatRemapPage;
    273     STAMCOUNTER                 StatRemapPageFailed;
    274 #  elif !defined(VBOX_WITH_PGM_NEM_MODE)
     258#  if !defined(VBOX_WITH_PGM_NEM_MODE)
    275259    STAMCOUNTER                 StatUnmapAllPages;
    276260#  endif
     
    281265    STAMPROFILE                 StatProfUnmapGpaRange;
    282266#  endif
    283 #  ifndef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    284267    STAMPROFILE                 StatProfMapGpaRangePage;
    285268    STAMPROFILE                 StatProfUnmapGpaRangePage;
    286 #  endif
    287 
    288 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    289     /** Info about the VidGetHvPartitionId I/O control interface. */
    290     NEMWINIOCTL                 IoCtlGetHvPartitionId;
    291     /** Info about the VidGetPartitionProperty I/O control interface. */
    292     NEMWINIOCTL                 IoCtlGetPartitionProperty;
    293 #  endif
    294 #  ifdef NEM_WIN_WITH_RING0_RUNLOOP
    295     /** Info about the VidStartVirtualProcessor I/O control interface. */
    296     NEMWINIOCTL                 IoCtlStartVirtualProcessor;
    297     /** Info about the VidStopVirtualProcessor I/O control interface. */
    298     NEMWINIOCTL                 IoCtlStopVirtualProcessor;
    299     /** Info about the VidStopVirtualProcessor I/O control interface. */
    300     NEMWINIOCTL                 IoCtlMessageSlotHandleAndGetNext;
    301 #  endif
    302269
    303270    /** Statistics updated by NEMR0UpdateStatistics. */
     
    406373    /** Last copy of HV_X64_VP_EXECUTION_STATE::InterruptShadow. */
    407374    bool                        fLastInterruptShadow : 1;
    408 # ifdef NEM_WIN_WITH_RING0_RUNLOOP
    409     /** Pending VINF_NEM_FLUSH_TLB. */
    410     int32_t                     rcPending;
    411 # else
    412375    uint32_t                    uPadding;
    413 # endif
    414376    /** The VID_MSHAGN_F_XXX flags.
    415377     * Either VID_MSHAGN_F_HANDLE_MESSAGE | VID_MSHAGN_F_GET_NEXT_MESSAGE or zero. */
     
    635597typedef struct NEMR0PERVCPU
    636598{
    637 # if defined(RT_OS_WINDOWS) && defined(NEM_WIN_USE_HYPERCALLS_FOR_PAGES)
    638     /** Hypercall input/ouput page. */
    639     NEMR0HYPERCALLDATA          HypercallData;
    640     /** Delta to add to convert a ring-0 pointer to a ring-3 one.   */
    641     uintptr_t                   offRing3ConversionDelta;
    642 # else
    643599    uint32_t                    uDummy;
    644 # endif
    645600} NEMR0PERVCPU;
    646601
     
    650605typedef struct NEMR0PERVM
    651606{
    652 # ifdef RT_OS_WINDOWS
    653 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    654     /** The partition ID. */
    655     uint64_t                    idHvPartition;
    656     /** I/O control context. */
    657     PSUPR0IOCTLCTX              pIoCtlCtx;
    658     /** Info about the VidGetHvPartitionId I/O control interface. */
    659     NEMWINIOCTL                 IoCtlGetHvPartitionId;
    660     /** Info about the VidGetPartitionProperty I/O control interface. */
    661     NEMWINIOCTL                 IoCtlGetPartitionProperty;
    662 #  endif
    663 #  ifdef NEM_WIN_WITH_RING0_RUNLOOP
    664     /** Info about the VidStartVirtualProcessor I/O control interface. */
    665     NEMWINIOCTL                 IoCtlStartVirtualProcessor;
    666     /** Info about the VidStopVirtualProcessor I/O control interface. */
    667     NEMWINIOCTL                 IoCtlStopVirtualProcessor;
    668     /** Info about the VidStopVirtualProcessor I/O control interface. */
    669     NEMWINIOCTL                 IoCtlMessageSlotHandleAndGetNext;
    670     /** Whether we may use the ring-0 runloop or not. */
    671     bool                        fMayUseRing0Runloop;
    672 #  endif
    673 
    674 #  ifdef NEM_WIN_USE_HYPERCALLS_FOR_PAGES
    675     /** Hypercall input/ouput page for non-EMT. */
    676     NEMR0HYPERCALLDATA          HypercallData;
    677     /** Critical section protecting use of HypercallData. */
    678     RTCRITSECT                  HypercallDataCritSect;
    679 #  endif
    680 
    681 # else
    682607    uint32_t                    uDummy;
    683 # endif
    684608} NEMR0PERVM;
    685609
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