Changeset 95397 in vbox
- Timestamp:
- Jun 27, 2022 5:49:40 PM (2 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-3-template.c
r95379 r95397 112 112 BS3_FNBS3FAR_PROTOTYPES_CMN(bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp); 113 113 BS3_FNBS3FAR_PROTOTYPES_CMN(bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp); 114 BS3_FNBS3FAR_PROTOTYPES_CMN(bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp); 115 BS3_FNBS3FAR_PROTOTYPES_CMN(bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp); 114 116 #endif 115 117 … … 134 136 { 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_DB, X86_XCPT_DB }, /* #1 */ 135 137 { 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_UD, X86_XCPT_DB }, /* #2 */ 136 { 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_NM, X86_XCPT_NM, X86_XCPT_ DB}, /* #3 */137 { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_UD, X86_XCPT_ DB}, /* #4 */138 { 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_NM, X86_XCPT_NM, X86_XCPT_NM }, /* #3 */ 139 { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_UD, X86_XCPT_NM }, /* #4 */ 138 140 { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_UD, X86_XCPT_DB }, /* #5 */ 139 141 { 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_DB, X86_XCPT_UD }, /* #6 */ … … 371 373 { 372 374 FPFNBS3FAR pfnWorker; 375 uint8_t bAvxMisalignXcpt; 373 376 uint8_t enmRm; 374 377 uint8_t enmType; 375 uint8_t cbInstr;376 378 uint8_t iRegDst; 377 379 uint8_t iRegSrc1; … … 453 455 { 454 456 BS3CPUINSTR3_TEST1_VALUES_T const BS3_FAR *paValues = paTests[iTest].paValues; 457 uint8_t const cbInstr = ((uint8_t const BS3_FAR *)(uintptr_t)paTests[iTest].pfnWorker)[-1]; 455 458 unsigned const cValues = paTests[iTest].cValues; 456 459 bool const fMmxInstr = paTests[iTest].enmType < T_SSE; 457 460 bool const fSseInstr = paTests[iTest].enmType >= T_SSE && paTests[iTest].enmType < T_AVX_128; 461 bool const fAvxInstr = paTests[iTest].enmType >= T_AVX_128; 458 462 uint8_t const cbOperand = paTests[iTest].enmType < T_128BITS ? 64/8 459 463 : paTests[iTest].enmType < T_256BITS ? 128/8 : 256/8; … … 461 465 uint8_t bXcptExpect = !g_afTypeSupports[paTests[iTest].enmType] ? X86_XCPT_UD 462 466 : fMmxInstr ? paConfigs[iCfg].bXcptMmx 463 : fSseInstr ? paConfigs[iCfg].bXcptSse : paConfigs[iCfg].bXcptAvx; 467 : fSseInstr ? paConfigs[iCfg].bXcptSse 468 : BS3_MODE_IS_RM_OR_V86(bMode) ? X86_XCPT_UD : paConfigs[iCfg].bXcptAvx; 464 469 uint16_t idTestStep = bRing * 10000 + iCfg * 100 + iTest * 10; 465 470 unsigned iVal; … … 475 480 continue; 476 481 477 /* #AC is only raised in ring-3: */ 478 if (bXcptExpect == X86_XCPT_AC && bRing != 3) 479 bXcptExpect = X86_XCPT_DB; 482 /* #AC is only raised in ring-3.: */ 483 if (bXcptExpect == X86_XCPT_AC) 484 { 485 if (bRing != 3) 486 bXcptExpect = X86_XCPT_DB; 487 else if (fAvxInstr) 488 bXcptExpect = paTests[iTest].bAvxMisalignXcpt; /* they generally don't raise #AC */ 489 } 480 490 481 491 Bs3RegCtxSetRipCsFromCurPtr(&Ctx, paTests[iTest].pfnWorker); … … 515 525 else if (fMmxInstr) 516 526 Bs3ExtCtxSetMm(pExtCtx, paTests[iTest].iRegSrc1, paValues[iVal].uSrc1.QWords.qw0); 527 else if (fSseInstr) 528 Bs3ExtCtxSetXmm(pExtCtx, paTests[iTest].iRegSrc1, &paValues[iVal].uSrc1.DQWords.dqw0); 517 529 else 518 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegSrc1, &paValues[iVal].uSrc1, fSseInstr);530 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegSrc1, &paValues[iVal].uSrc1, 32); 519 531 520 532 /* source #2 */ … … 528 540 else if (fMmxInstr) 529 541 Bs3ExtCtxSetMm(pExtCtx, paTests[iTest].iRegSrc2, paValues[iVal].uSrc2.QWords.qw0); 542 else if (fSseInstr) 543 Bs3ExtCtxSetXmm(pExtCtx, paTests[iTest].iRegSrc2, &paValues[iVal].uSrc2.DQWords.dqw0); 530 544 else 531 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegSrc2, &paValues[iVal].uSrc2, fSseInstr);545 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegSrc2, &paValues[iVal].uSrc2, 32); 532 546 533 547 /* Memory pointer. */ … … 556 570 if (fMmxInstr) 557 571 Bs3ExtCtxSetMm(pExtCtx, paTests[iTest].iRegDst, paValues[iVal].uDstOut.QWords.qw0); 572 else if (fSseInstr) 573 Bs3ExtCtxSetXmm(pExtCtx, paTests[iTest].iRegDst, &paValues[iVal].uDstOut.DQWords.dqw0); 558 574 else 559 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegDst, &paValues[iVal].uDstOut, fSseInstr);575 Bs3ExtCtxSetYmm(pExtCtx, paTests[iTest].iRegDst, &paValues[iVal].uDstOut, cbOperand); 560 576 } 561 577 Bs3TestCheckExtCtx(pExtCtxOut, pExtCtx, 0 /*fFlags*/, pszMode, idTestStep); … … 571 587 TrapFrame.Ctx.rflags.u32 |= X86_EFL_AC; 572 588 } 573 Bs3TestCheckRegCtxEx(&TrapFrame.Ctx, &Ctx, bXcptExpect == X86_XCPT_DB ? paTests[iTest].cbInstr + 1 : 0, 0,589 Bs3TestCheckRegCtxEx(&TrapFrame.Ctx, &Ctx, bXcptExpect == X86_XCPT_DB ? cbInstr + 1 : 0, 0, 574 590 bXcptExpect == X86_XCPT_DB || BS3_MODE_IS_16BIT_SYS(bMode) ? 0 : X86_EFL_RF, 575 591 pszMode, idTestStep); … … 580 596 581 597 if (cErrors != Bs3TestSubErrorCount()) 582 Bs3TestFailedF("ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%#x)", 583 bRing, iCfg, iTest, iVal, bXcptExpect); 598 { 599 if (paConfigs[iCfg].fAligned) 600 Bs3TestFailedF("ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%#x)", 601 bRing, iCfg, iTest, iVal, bXcptExpect); 602 else 603 Bs3TestFailedF("ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%#x, puMemOp=%p, EFLAGS=%#RX32, CR0=%#RX32)", 604 bRing, iCfg, iTest, iVal, bXcptExpect, puMemOp, TrapFrame.Ctx.rflags.u32, TrapFrame.Ctx.cr0); 605 Bs3TestPrintf("\n"); 606 } 584 607 } 585 608 } … … 609 632 BS3_DECL_FAR(uint8_t) BS3_CMN_NM(bs3CpuInstr3_xorps)(uint8_t bMode) 610 633 { 611 /** Input values for 128 bit wide operations: */ 612 static BS3CPUINSTR3_TEST1_VALUES_T const s_aValues128[] = 613 { 614 { RTUINT256_INIT_C(0, 0, 0x1111222233334444, 0x5555666677778888), 615 /* ^ */ RTUINT256_INIT_C(0, 0, 0x9999aaaabbbbcccc, 0xddddeeeeffff0000), 616 /* = */ RTUINT256_INIT_C(0, 0, 0x8888888888888888, 0x8888888888888888) }, 634 static BS3CPUINSTR3_TEST1_VALUES_T const s_aValues[] = 635 { 636 { RTUINT256_INIT_C(0, 0, 0, 0), 637 /* ^ */ RTUINT256_INIT_C(0, 0, 0, 0), 638 /* = */ RTUINT256_INIT_C(0, 0, 0, 0) }, 639 { RTUINT256_INIT_C(0x5555666677778888, 0x1111222233334444, 0x1111222233334444, 0x5555666677778888), 640 /* ^ */ RTUINT256_INIT_C(0xddddeeeeffff0000, 0x9999aaaabbbbcccc, 0x9999aaaabbbbcccc, 0xddddeeeeffff0000), 641 /* = */ RTUINT256_INIT_C(0x8888888888888888, 0x8888888888888888, 0x8888888888888888, 0x8888888888888888) }, 642 { RTUINT256_INIT_C(0x4d09f02a6cdc73d5, 0x3ef417c8666b3fe6, 0xb4212fa8564c9ba2, 0x9c5ce073930996bb), 643 /* ^ */ RTUINT256_INIT_C(0x1eddddac09633294, 0xf95c8eec40725633, 0x8800e95bbf9962c3, 0x43d3cda0238499fd), 644 /* = */ RTUINT256_INIT_C(0x53d42d8665bf4141, 0xc7a89924261969d5, 0x3c21c6f3e9d5f961, 0xdf8f2dd3b08d0f46) }, 617 645 }; 618 646 619 647 static BS3CPUINSTR3_TEST1_T const s_aTests16[] = 620 648 { 621 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c16, RM_REG, T_SSE2, 3, 1, 1, 2, RT_ELEMENTS(s_aValues128), s_aValues128 }, 622 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c16, RM_MEM, T_SSE2, 4, 1, 1, 255, RT_ELEMENTS(s_aValues128), s_aValues128 }, 649 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c16, 255, RM_REG, T_SSE2, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 650 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c16, 255, RM_MEM, T_SSE2, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 651 { bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp_c16, 255, RM_REG, T_AVX_128, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 652 { bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp_c16, X86_XCPT_DB, RM_MEM, T_AVX_128, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 653 { bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp_c16, 255, RM_REG, T_AVX_256, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 654 { bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp_c16, X86_XCPT_DB, RM_MEM, T_AVX_256, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 623 655 }; 624 625 #if ARCH_BITS >= 32 656 # if ARCH_BITS >= 32 626 657 static BS3CPUINSTR3_TEST1_T const s_aTests32[] = 627 658 { 628 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c32, RM_REG, T_SSE2, 3, 1, 1, 2, RT_ELEMENTS(s_aValues128), s_aValues128 }, 629 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c32, RM_MEM, T_SSE2, 4, 1, 1, 255, RT_ELEMENTS(s_aValues128), s_aValues128 }, 659 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c32, 255, RM_REG, T_SSE2, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 660 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c32, 255, RM_MEM, T_SSE2, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 661 { bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp_c32, 255, RM_REG, T_AVX_128, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 662 { bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp_c32, X86_XCPT_DB, RM_MEM, T_AVX_128, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 663 { bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp_c32, 255, RM_REG, T_AVX_256, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 664 { bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp_c32, X86_XCPT_DB, RM_MEM, T_AVX_256, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 630 665 }; 631 #endif 632 633 #if ARCH_BITS >= 64 666 # endif 667 # if ARCH_BITS >= 64 634 668 static BS3CPUINSTR3_TEST1_T const s_aTests64[] = 635 669 { 636 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c64, RM_REG, T_SSE2, 3, 1, 1, 2, RT_ELEMENTS(s_aValues128), s_aValues128 }, 637 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c64, RM_MEM, T_SSE2, 4, 1, 1, 255, RT_ELEMENTS(s_aValues128), s_aValues128 }, 670 { bs3CpuInstr3_xorps_XMM1_XMM2_icebp_c64, 255, RM_REG, T_SSE2, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 671 { bs3CpuInstr3_xorps_XMM1_FSxBX_icebp_c64, 255, RM_MEM, T_SSE2, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 672 { bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp_c64, 255, RM_REG, T_AVX_128, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 673 { bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp_c64, X86_XCPT_DB, RM_MEM, T_AVX_128, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 674 { bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp_c64, 255, RM_REG, T_AVX_256, 1, 1, 2, RT_ELEMENTS(s_aValues), s_aValues }, 675 { bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp_c64, X86_XCPT_DB, RM_MEM, T_AVX_256, 1, 1, 255, RT_ELEMENTS(s_aValues), s_aValues }, 638 676 }; 639 # endif677 # endif 640 678 641 679 static BS3CPUINSTR3_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR3_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-3-template.mac
r95377 r95397 44 44 %ifdef BS3_INSTANTIATING_CMN 45 45 46 47 ;; 48 ; Variant on BS3_PROC_BEGIN_CMN w/ BS3_PBC_NEAR that prefixes the function 49 ; with an instruction length byte. 50 ; 51 ; ASSUMES the length is between the start of the function and the .again label. 52 ; 53 %ifndef BS3CPUINSTR3_PROC_BEGIN_CMN 54 %define BS3CPUINSTR3_PROC_BEGIN_CMN_DEFINED 55 %macro BS3CPUINSTR3_PROC_BEGIN_CMN 1 56 align 8, db 0cch 57 db BS3_CMN_NM(%1).again - BS3_CMN_NM(%1) 58 BS3_PROC_BEGIN_CMN %1, BS3_PBC_NEAR 59 %endmacro 60 %endif 61 46 62 ; 47 63 ; XORPS (SSE2) & VXORPS (AVX) 48 64 ; 49 BS3 _PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_XMM2_icebp, BS3_PBC_NEAR50 xorps 65 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_XMM2_icebp 66 xorps xmm1, xmm2 51 67 .again: 52 68 icebp … … 54 70 BS3_PROC_END_CMN bs3CpuInstr3_xorps_XMM1_XMM2_icebp 55 71 56 BS3 _PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_FSxBX_icebp, BS3_PBC_NEAR57 xorps 72 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_xorps_XMM1_FSxBX_icebp 73 xorps xmm1, [fs:xBX] 58 74 .again: 59 75 icebp … … 61 77 BS3_PROC_END_CMN bs3CpuInstr3_xorps_XMM1_FSxBX_icebp 62 78 63 BS3 _PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp, BS3_PBC_NEAR79 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp 64 80 vxorps xmm1, xmm1, xmm2 65 81 .again: … … 68 84 BS3_PROC_END_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_XMM2_icebp 69 85 70 BS3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp, BS3_PBC_NEAR 86 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp 87 %if 0 88 .again2: 89 pause 90 jmp .again2 91 %endif 71 92 vxorps xmm1, xmm1, [fs:xBX] 72 93 .again: … … 75 96 BS3_PROC_END_CMN bs3CpuInstr3_vxorps_XMM1_XMM1_FSxBX_icebp 76 97 98 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp 99 vxorps ymm1, ymm1, ymm2 100 .again: 101 icebp 102 jmp .again 103 BS3_PROC_END_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_YMM2_icebp 104 105 BS3CPUINSTR3_PROC_BEGIN_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp 106 vxorps ymm1, ymm1, [fs:xBX] 107 .again: 108 icebp 109 jmp .again 110 BS3_PROC_END_CMN bs3CpuInstr3_vxorps_YMM1_YMM1_FSxBX_icebp 111 77 112 78 113 %endif ; BS3_INSTANTIATING_CMN -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r95376 r95397 151 151 bs3-cmn-ExtCtxGetMm.c \ 152 152 bs3-cmn-ExtCtxSetMm.c \ 153 bs3-cmn-ExtCtxGetXmm.c \ 154 bs3-cmn-ExtCtxSetXmm.c \ 153 155 bs3-cmn-ExtCtxGetYmm.c \ 154 156 bs3-cmn-ExtCtxSetYmm.c \ -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxGetXmm.c
r95372 r95397 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3ExtCtxGet Ymm3 * BS3Kit - Bs3ExtCtxGetXmm 4 4 */ 5 5 … … 32 32 33 33 34 #undef Bs3ExtCtxGet Ymm35 BS3_CMN_DEF(PRTUINT 256U, Bs3ExtCtxGetYmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT256U pValue))34 #undef Bs3ExtCtxGetXmm 35 BS3_CMN_DEF(PRTUINT128U, Bs3ExtCtxGetXmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT128U pValue)) 36 36 { 37 pValue->au128[0].au64[0] = 0; 38 pValue->au128[0].au64[1] = 0; 39 pValue->au128[1].au64[0] = 0; 40 pValue->au128[1].au64[1] = 0; 41 37 AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aXMM, BS3EXTCTX, Ctx.x.x87.aXMM); 42 38 switch (pExtCtx->enmMethod) 43 39 { 44 40 case BS3EXTCTXMETHOD_FXSAVE: 41 case BS3EXTCTXMETHOD_XSAVE: 45 42 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 46 pValue->au128[0] = pExtCtx->Ctx.x87.aXMM[iReg].uXmm;47 break;48 49 case BS3EXTCTXMETHOD_XSAVE:50 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM))51 43 { 52 pValue->au128[0] = pExtCtx->Ctx.x87.aXMM[iReg].uXmm; 53 if (pExtCtx->fXcr0Nominal & XSAVE_C_YMM) 54 pValue->au128[1] = pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm; 44 pValue->u = pExtCtx->Ctx.x87.aXMM[iReg].xmm; 45 return pValue; 55 46 } 56 47 break; 57 48 } 49 50 pValue->au64[0] = 0; 51 pValue->au64[1] = 0; 58 52 return pValue; 59 53 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetXmm.c
r95374 r95397 1 1 /* $Id$ */ 2 2 /** @file 3 * BS3Kit - Bs3ExtCtxSet Ymm3 * BS3Kit - Bs3ExtCtxSetXmm 4 4 */ 5 5 … … 32 32 33 33 34 #undef Bs3ExtCtxSet Ymm35 BS3_CMN_DEF(bool, Bs3ExtCtxSet Ymm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit))34 #undef Bs3ExtCtxSetXmm 35 BS3_CMN_DEF(bool, Bs3ExtCtxSetXmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT128U pValue)) 36 36 { 37 AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aXMM, BS3EXTCTX, Ctx.x.x87.aXMM); 37 38 switch (pExtCtx->enmMethod) 38 39 { 39 40 case BS3EXTCTXMETHOD_FXSAVE: 41 case BS3EXTCTXMETHOD_XSAVE: 40 42 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 41 43 { 42 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 43 return true; 44 } 45 break; 46 47 case BS3EXTCTXMETHOD_XSAVE: 48 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM)) 49 { 50 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 51 if ((pExtCtx->fXcr0Nominal & XSAVE_C_YMM) && !f128Bit) 52 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->au128[1]; 44 pExtCtx->Ctx.x87.aXMM[iReg].xmm = pValue->u; 53 45 return true; 54 46 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetYmm.c
r95374 r95397 33 33 34 34 #undef Bs3ExtCtxSetYmm 35 BS3_CMN_DEF(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit))35 BS3_CMN_DEF(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, uint8_t cbValue)) 36 36 { 37 BS3_ASSERT(cbValue == 16 || cbValue == 32); 37 38 switch (pExtCtx->enmMethod) 38 39 { … … 40 41 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x87.aXMM)) 41 42 { 42 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue-> au128[0];43 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->DQWords.dqw0; 43 44 return true; 44 45 } … … 48 49 if (iReg < RT_ELEMENTS(pExtCtx->Ctx.x.x87.aXMM)) 49 50 { 50 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->au128[0]; 51 if ((pExtCtx->fXcr0Nominal & XSAVE_C_YMM) && !f128Bit) 52 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->au128[1]; 51 pExtCtx->Ctx.x87.aXMM[iReg].uXmm = pValue->DQWords.dqw0; 52 if (pExtCtx->fXcr0Nominal & XSAVE_C_YMM) 53 { 54 if (cbValue >= 32) 55 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].uXmm = pValue->DQWords.dqw1; 56 else 57 { 58 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].au64[0] = 0; 59 pExtCtx->Ctx.x.u.YmmHi.aYmmHi[iReg].au64[1] = 0; 60 } 61 /** @todo zero high ZMM part. */ 62 } 53 63 return true; 54 64 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
r95376 r95397 38 38 $(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,Bs3RegCtxSaveEx,8) 39 39 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetMm) 40 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetXmm) 40 41 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxSetYmm) 41 42 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TestCheckExtCtx) … … 63 64 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxInit) 64 65 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3TrapSetHandler) 66 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetXmm) 65 67 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3ExtCtxGetYmm) 66 68 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3Printf) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
r95376 r95397 37 37 #define Bs3ExtCtxGetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxGetMxCsr) 38 38 #define Bs3ExtCtxGetSize BS3_CMN_MANGLER(Bs3ExtCtxGetSize) 39 #define Bs3ExtCtxGetXmm BS3_CMN_MANGLER(Bs3ExtCtxGetXmm) 39 40 #define Bs3ExtCtxGetYmm BS3_CMN_MANGLER(Bs3ExtCtxGetYmm) 40 41 #define Bs3ExtCtxInit BS3_CMN_MANGLER(Bs3ExtCtxInit) … … 43 44 #define Bs3ExtCtxSetMm BS3_CMN_MANGLER(Bs3ExtCtxSetMm) 44 45 #define Bs3ExtCtxSetMxCsr BS3_CMN_MANGLER(Bs3ExtCtxSetMxCsr) 46 #define Bs3ExtCtxSetXmm BS3_CMN_MANGLER(Bs3ExtCtxSetXmm) 45 47 #define Bs3ExtCtxSetYmm BS3_CMN_MANGLER(Bs3ExtCtxSetYmm) 46 48 #define Bs3GetCpuVendor BS3_CMN_MANGLER(Bs3GetCpuVendor) -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
r95376 r95397 37 37 #undef Bs3ExtCtxGetMxCsr 38 38 #undef Bs3ExtCtxGetSize 39 #undef Bs3ExtCtxGetXmm 39 40 #undef Bs3ExtCtxGetYmm 40 41 #undef Bs3ExtCtxInit … … 43 44 #undef Bs3ExtCtxSetMm 44 45 #undef Bs3ExtCtxSetMxCsr 46 #undef Bs3ExtCtxSetXmm 45 47 #undef Bs3ExtCtxSetYmm 46 48 #undef Bs3GetCpuVendor -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r95376 r95397 2916 2916 2917 2917 /** 2918 * Gets the value of XMM register number @a iReg from @a pExtCtx. 2919 * 2920 * @returns pValue 2921 * @param pExtCtx The extended CPU context. 2922 * @param iReg The register to get. 2923 * @param pValue Where to return the value. Zeroed if the state 2924 * doesn't support SSE or if @a iReg is invalid. 2925 */ 2926 BS3_CMN_PROTO_STUB(PRTUINT128U, Bs3ExtCtxGetXmm,(PCBS3EXTCTX pExtCtx, uint8_t iReg, PRTUINT128U pValue)); 2927 2928 /** 2929 * Sets the value of XMM register number @a iReg in @a pExtCtx to @a pValue. 2930 * 2931 * @returns True if set, false if not set (not supported by state format or 2932 * invalid iReg). 2933 * @param pExtCtx The extended CPU context. 2934 * @param iReg The register to set. 2935 * @param pValue The new register value. 2936 */ 2937 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetXmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT128U pValue)); 2938 2939 /** 2918 2940 * Gets the value of YMM register number @a iReg from @a pExtCtx. 2919 2941 * … … 2935 2957 * @param iReg The register to set. 2936 2958 * @param pValue The new register value. 2937 * @param f128Bit A little peculiarity grown from mixing SSE and AVX 2938 * tests: When set to true only the lower 128 bits of 2939 * the YMM register will be set. The upper bits are 2940 * untouched. When false, the whole 256-bits value 2941 * will be set. 2942 */ 2943 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, bool f128Bit)); 2959 * @param cbValue Number of bytes to take from @a pValue, either 16 or 2960 * 32. If 16, the high part will be zeroed when present 2961 * in the state. 2962 */ 2963 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetYmm,(PBS3EXTCTX pExtCtx, uint8_t iReg, PCRTUINT256U pValue, uint8_t cbValue)); 2944 2964 2945 2965
Note:
See TracChangeset
for help on using the changeset viewer.