Changeset 89942 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- Jun 29, 2021 8:37:15 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145400
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-x0.c
r89932 r89942 1518 1518 1519 1519 1520 static void bs3CpuBasic2_RaiseXcpt11Worker(uint8_t bMode, uint8_t *pbBuf, bool fAm,1520 static void bs3CpuBasic2_RaiseXcpt11Worker(uint8_t bMode, uint8_t *pbBuf, unsigned cbCacheLine, bool fAm, 1521 1521 BS3CPUBASIC2PFTTSTCMNMODE const BS3_FAR *pCmn) 1522 1522 { … … 1573 1573 for (iTest = 0; iTest < pCmn->cEntries; iTest++) 1574 1574 { 1575 uint8_t const fOp = pCmn->paEntries[iTest].fOp; 1575 1576 uint8_t const cbMem = pCmn->paEntries[iTest].cbMem; 1576 uint 8_t const fOp = pCmn->paEntries[iTest].fOp;1577 uint 8_toffMem;1577 uint16_t const cbMax = cbCacheLine + cbMem; 1578 uint16_t offMem; 1578 1579 uint8_t BS3_FAR *poffUd = (uint8_t BS3_FAR *)Bs3SelLnkPtrToCurPtr(pCmn->paEntries[iTest].pfn); 1579 1580 Bs3RegCtxSetRipCsFromLnkPtr(&Ctx, pCmn->paEntries[iTest].pfn); … … 1603 1604 /* 1604 1605 * Buffer misalignment loop. 1606 * Note! We must make sure to cross a cache line here to make sure 1607 * to cover the split-lock scenario. (The buffer is cache 1608 * line aligned.) 1605 1609 */ 1606 for (offMem = 0; offMem < cbM em; offMem++)1610 for (offMem = 0; offMem < cbMax; offMem++) 1607 1611 { 1608 unsigned offBuf = cbM em * 2 + cbMem;1612 unsigned offBuf = cbMax + cbMem * 2; 1609 1613 while (offBuf-- > 0) 1610 1614 pbBuf[offBuf] = 1; /* byte-by-byte to make sure it doesn't trigger AC. */ … … 1657 1661 BS3_DECL_FAR(uint8_t) BS3_CMN_FAR_NM(bs3CpuBasic2_RaiseXcpt11)(uint8_t bMode) 1658 1662 { 1659 uint8_t abBuf[4096 /** @todo 128 - but that went crazy in real mode; now it's long mode going wrong. */]; 1663 unsigned cbCacheLine = 128; /** @todo detect */ 1664 uint8_t abBuf[4096 /** @todo 512 - but that went crazy in real mode; now it's long mode going wrong. */]; 1660 1665 uint8_t BS3_FAR *pbBuf; 1661 1666 unsigned idxCmnModes; … … 1676 1681 /* Get us a 64-byte aligned buffer. */ 1677 1682 pbBuf = abBuf; 1678 if (BS3_FP_OFF(pbBuf) & 63)1679 pbBuf = &abBuf[ 64 - BS3_FP_OFF(pbBuf) & 63];1683 if (BS3_FP_OFF(pbBuf) & (cbCacheLine - 1)) 1684 pbBuf = &abBuf[cbCacheLine - BS3_FP_OFF(pbBuf) & (cbCacheLine - 1)]; 1680 1685 //Bs3TestPrintf("pbBuf=%p\n", pbBuf); 1681 1686 … … 1690 1695 BS3_ASSERT(!(fCr0 & X86_CR0_AM)); 1691 1696 Bs3RegSetCr0(fCr0 & ~X86_CR0_AM); 1692 bs3CpuBasic2_RaiseXcpt11Worker(bMode, pbBuf, false /*fAm*/, &g_aCmnModes[idxCmnModes]);1697 bs3CpuBasic2_RaiseXcpt11Worker(bMode, pbBuf, cbCacheLine, false /*fAm*/, &g_aCmnModes[idxCmnModes]); 1693 1698 1694 1699 #if 1 1695 1700 /* The second round is with aligment checks enabled. */ 1696 1701 Bs3RegSetCr0(Bs3RegGetCr0() | X86_CR0_AM); 1697 bs3CpuBasic2_RaiseXcpt11Worker(bMode, pbBuf, true /*fAm*/, &g_aCmnModes[idxCmnModes]);1702 bs3CpuBasic2_RaiseXcpt11Worker(bMode, pbBuf, cbCacheLine, true /*fAm*/, &g_aCmnModes[idxCmnModes]); 1698 1703 #endif 1699 1704
Note:
See TracChangeset
for help on using the changeset viewer.