Changeset 70977 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Feb 12, 2018 8:45:31 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 120824
- Location:
- trunk/src/VBox/VMM/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/NEMInternal.h
r70954 r70977 116 116 void nemR3NativeResetCpu(PVMCPU pVCpu); 117 117 int nemR3NativeNotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb); 118 int nemR3NativeNotifyPhysMmioExMap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags );118 int nemR3NativeNotifyPhysMmioExMap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags, void *pvMmio2); 119 119 int nemR3NativeNotifyPhysMmioExUnmap(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags); 120 int nemR3NativeNotifyPhysRomRegisterEarly(PVM pVM, RTGCPHYS GCPhys, RT UINTcb, uint32_t fFlags);121 int nemR3NativeNotifyPhysRomRegisterLate(PVM pVM, RTGCPHYS GCPhys, RT UINTcb, uint32_t fFlags);120 int nemR3NativeNotifyPhysRomRegisterEarly(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags); 121 int nemR3NativeNotifyPhysRomRegisterLate(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb, uint32_t fFlags); 122 122 void nemR3NativeNotifySetA20(PVMCPU pVCpu, bool fEnabled); 123 /* NEMHCNotifyXxxx for ring-3: */ 124 void nemR3NativeNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb); 125 void nemR3NativeNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, 126 int fRestoreAsRAM, bool fRestoreAsRAM2); 127 void nemR3NativeNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, 128 RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fRestoreAsRAM); 129 int nemR3NativeNotifyPhysPageAllocated(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt, 130 PGMPAGETYPE enmType, uint8_t *pu2State); 131 void nemR3NativeNotifyPhysPageProtChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhys, uint32_t fPageProt, 132 PGMPAGETYPE enmType, uint8_t *pu2State); 133 void nemR3NativeNotifyPhysPageChanged(PVM pVM, RTGCPHYS GCPhys, RTHCPHYS HCPhysPrev, RTHCPHYS HCPhysNew, uint32_t fPageProt, 134 PGMPAGETYPE enmType, uint8_t *pu2State); 123 135 #endif 124 136 -
trunk/src/VBox/VMM/include/PGMInline.h
r70948 r70977 33 33 #include <VBox/vmm/gmm.h> 34 34 #include <VBox/vmm/hm.h> 35 #ifndef IN_RC 36 # include <VBox/vmm/nem.h> 37 #endif 35 38 #include <iprt/asm.h> 36 39 #include <iprt/assert.h> … … 514 517 } 515 518 519 520 /** 521 * Calculates NEM page protection flags. 522 */ 523 DECL_FORCE_INLINE(uint32_t) pgmPhysPageCalcNemProtection(PPGMPAGE pPage, PGMPAGETYPE enmType) 524 { 525 /* 526 * Deal with potentially writable pages first. 527 */ 528 if (PGMPAGETYPE_IS_RWX(enmType)) 529 { 530 if (!PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage)) 531 { 532 if (PGM_PAGE_IS_ALLOCATED(pPage)) 533 return NEM_PAGE_PROT_READ | NEM_PAGE_PROT_EXECUTE | NEM_PAGE_PROT_WRITE; 534 return NEM_PAGE_PROT_READ | NEM_PAGE_PROT_EXECUTE; 535 } 536 if (!PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage)) 537 return NEM_PAGE_PROT_READ | NEM_PAGE_PROT_EXECUTE; 538 } 539 /* 540 * Potentially readable & executable pages. 541 */ 542 else if ( PGMPAGETYPE_IS_ROX(enmType) 543 && !PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage)) 544 return NEM_PAGE_PROT_READ | NEM_PAGE_PROT_EXECUTE; 545 546 /* 547 * The rest is needs special access handling. 548 */ 549 return NEM_PAGE_PROT_NONE; 550 } 551 516 552 #endif /* !IN_RC */ 517 553 … … 546 582 Assert(PGM_PAGE_GET_PDE_TYPE(pFirstPage) == PGM_PAGE_PDE_TYPE_PDE_DISABLED); 547 583 } 584 585 #ifndef IN_RC 586 /* Tell NEM. */ 587 if (VM_IS_NEM_ENABLED(pVM)) 588 { 589 uint8_t u2State = PGM_PAGE_GET_NEM_STATE(pPage); 590 PGMPAGETYPE enmType = (PGMPAGETYPE)PGM_PAGE_GET_TYPE(pPage); 591 NEMHCNotifyPhysPageProtChanged(pVM, GCPhysPage, PGM_PAGE_GET_HCPHYS(pPage), 592 pgmPhysPageCalcNemProtection(pPage, enmType), enmType, &u2State); 593 PGM_PAGE_SET_NEM_STATE(pPage, u2State); 594 } 595 #endif 548 596 } 549 597 -
trunk/src/VBox/VMM/include/PGMInternal.h
r70954 r70977 785 785 786 786 787 /** @name Page type predicates.788 * @{ */789 #define PGMPAGETYPE_IS_READABLE(type) ( (type) <= PGMPAGETYPE_ROM )790 #define PGMPAGETYPE_IS_WRITEABLE(type) ( (type) <= PGMPAGETYPE_ROM_SHADOW )791 #define PGMPAGETYPE_IS_RWX(type) ( (type) <= PGMPAGETYPE_ROM_SHADOW )792 #define PGMPAGETYPE_IS_ROX(type) ( (type) == PGMPAGETYPE_ROM )793 #define PGMPAGETYPE_IS_NP(type) ( (type) == PGMPAGETYPE_MMIO )794 /** @} */795 796 797 787 /** 798 788 * A Physical Guest Page tracking structure. … … 823 813 /** 9:8 - The physical handler state (PGM_PAGE_HNDL_VIRT_STATE_*). */ 824 814 uint64_t u2HandlerVirtStateY : 2; 825 /** 11:10 - Unused. */826 uint64_t u2 Unused1: 2;815 /** 11:10 - NEM state bits. */ 816 uint64_t u2NemStateY : 2; 827 817 /** 12:48 - The host physical frame number (shift left to get the 828 818 * address). */ … … 1426 1416 */ 1427 1417 #define PGM_PAGE_INC_WRITE_LOCKS(a_pPage) do { ++(a_pPage)->s.cWriteLocksY; } while (0) 1418 1419 1420 /** Gets the NEM state. 1421 * @returns NEM state value (two bits). 1422 * @param a_pPage Pointer to the physical guest page tracking structure. 1423 */ 1424 #define PGM_PAGE_GET_NEM_STATE(a_pPage) ((a_pPage)->s.u2NemStateY) 1425 1426 /** Sets the NEM state. 1427 * @param a_pPage Pointer to the physical guest page tracking structure. 1428 * @param a_u2State The NEM state value (specific to NEM impl.). 1429 */ 1430 #define PGM_PAGE_SET_NEM_STATE(a_pPage, a_u2State) \ 1431 do { Assert((a_u2State) < 4); (a_pPage)->s.u2NemStateY = (a_u2State); } while (0) 1428 1432 1429 1433 … … 4217 4221 int pgmPhysPageLoadIntoTlb(PVM pVM, RTGCPHYS GCPhys); 4218 4222 int pgmPhysPageLoadIntoTlbWithPage(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys); 4219 void pgmPhysPageMakeWriteMonitoredWritable(PVM pVM, PPGMPAGE pPage );4223 void pgmPhysPageMakeWriteMonitoredWritable(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys); 4220 4224 int pgmPhysPageMakeWritable(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys); 4221 4225 int pgmPhysPageMakeWritableAndMap(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys, void **ppv); … … 4235 4239 DECLEXPORT(FNPGMRZPHYSPFHANDLER) pgmPhysRomWritePfHandler; 4236 4240 #endif 4237 int pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys); 4241 int pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys, 4242 PGMPAGETYPE enmNewType); 4238 4243 void pgmPhysInvalidRamRangeTlbs(PVM pVM); 4239 4244 void pgmPhysInvalidatePageMapTLB(PVM pVM);
Note:
See TracChangeset
for help on using the changeset viewer.