Changeset 10013 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 30, 2008 11:39:41 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r9989 r10013 2356 2356 { 2357 2357 uint64_t uMask = 0; 2358 uint64_t oldval = pCtx->msrEFER; 2358 2359 2359 2360 /* Filter out those bits the guest is allowed to change. (e.g. LMA is read-only) */ … … 2377 2378 AssertMsg(!(val & ~(MSR_K6_EFER_NXE|MSR_K6_EFER_LME|MSR_K6_EFER_LMA /* ignored anyway */ |MSR_K6_EFER_SCE)), ("Unexpected value %RX64\n", val)); 2378 2379 pCtx->msrEFER = (pCtx->msrEFER & ~uMask) | (val & uMask); 2380 2381 /* AMD64 Achitecture Programmer's Manual: 15.15 TLB Control; flush the TLB if MSR_K6_EFER_NXE, MSR_K6_EFER_LME or MSR_K6_EFER_LMA are changed. */ 2382 if ((oldval & (MSR_K6_EFER_NXE|MSR_K6_EFER_LME|MSR_K6_EFER_LMA)) != (pCtx->msrEFER & (MSR_K6_EFER_NXE|MSR_K6_EFER_LME|MSR_K6_EFER_LMA))) 2383 HWACCMFlushTLB(pVM); 2384 2379 2385 break; 2380 2386 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r10012 r10013 1770 1770 * Get the shadow PDE, find the shadow page table in the pool. 1771 1771 */ 1772 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT;1773 1772 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 1773 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; 1774 1774 X86PDE PdeDst = pVM->pgm.s.CTXMID(p,32BitPD)->a[iPDDst]; 1775 # else /* PAE */ 1775 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 1776 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; /* no mask; flat index into the 2048 entry array. */ 1776 1777 X86PDEPAE PdeDst = pVM->pgm.s.CTXMID(ap,PaePDs)[0]->a[iPDDst]; 1778 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 1779 const unsigned iPDDst = ((GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK); 1780 const unsigned iPdpte = (GCPtrPage >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 1781 PX86PDPAE pPDDst; 1782 X86PDEPAE PdeDst; 1783 PX86PDPT pPdptDst; 1784 1785 int rc = PGMShwGetLongModePDPtr(pVM, GCPtrPage, &pPdptDst, &pPDDst); 1786 AssertRCReturn(rc, rc); 1787 Assert(pPDDst && pPdptDst); 1788 PdeDst = pPDDst->a[iPDDst]; 1777 1789 # endif 1778 1790 Assert(PdeDst.n.u1Present); … … 2216 2228 PX86PD pPDDst = pVM->pgm.s.CTXMID(p,32BitPD); 2217 2229 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 2218 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; /* 0 - 2047*/2230 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; /* no mask; flat index into the 2048 entry array. */ 2219 2231 const unsigned iPdpte = (GCPtrPage >> X86_PDPT_SHIFT); 2220 2232 PX86PDPT pPdptDst = pVM->pgm.s.CTXMID(p,PaePDPT); 2221 2233 PX86PDPAE pPDDst = pVM->pgm.s.CTXMID(ap,PaePDs)[0]; 2222 2234 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 2223 const unsigned iPml4e = (GCPtrPage >> X86_PML4_SHIFT) & X86_PML4_MASK;2224 2235 const unsigned iPdpte = (GCPtrPage >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 2225 2236 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; … … 2603 2614 */ 2604 2615 # if PGM_SHW_TYPE == PGM_TYPE_32BIT 2616 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; 2605 2617 PX86PD pPDDst = pVM->pgm.s.CTXMID(p,32BitPD); 2606 # else 2618 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 2619 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; /* no mask; flat index into the 2048 entry array. */ 2607 2620 PX86PDPAE pPDDst = pVM->pgm.s.CTXMID(ap,PaePDs)[0]; 2608 # endif 2609 const unsigned iPDDst = GCPtrPage >> SHW_PD_SHIFT; 2621 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 2622 const unsigned iPdpte = (GCPtrPage >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; 2623 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; 2624 PX86PDPAE pPDDst; 2625 PX86PDPT pPdptDst; 2626 rc = PGMShwGetLongModePDPtr(pVM, GCPtrPage, &pPdptDst, &pPDDst); 2627 if (rc != VINF_SUCCESS) 2628 { 2629 AssertMsg(rc == VINF_PGM_SYNC_CR3, ("Unexpected rc=%Vrc\n", rc)); 2630 return rc; 2631 } 2632 Assert(pPDDst); 2633 2634 /* Fetch the pgm pool shadow descriptor. */ 2635 PPGMPOOLPAGE pShwPde = pgmPoolGetPageByHCPhys(pVM, pPdptDst->a[iPdpte].u & X86_PDPE_PG_MASK); 2636 Assert(pShwPde); 2637 # endif 2610 2638 PSHWPDE pPdeDst = &pPDDst->a[iPDDst]; 2611 2639 SHWPDE PdeDst = *pPdeDst; … … 2630 2658 /* Virtual address = physical address */ 2631 2659 GCPhys = GCPtrPage & X86_PAGE_4K_BASE_MASK_32; 2660 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 2661 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); 2662 # else 2632 2663 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, SHW_POOL_ROOT_IDX, iPDDst, &pShwPage); 2664 # endif 2633 2665 2634 2666 if ( rc == VINF_SUCCESS
Note:
See TracChangeset
for help on using the changeset viewer.