Changeset 66450 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Timestamp:
- Apr 5, 2017 7:06:04 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxCopy.c
r66226 r66450 36 36 BS3_CMN_DEF(PBS3EXTCTX, Bs3ExtCtxCopy,(PBS3EXTCTX pDst, PCBS3EXTCTX pSrc)) 37 37 { 38 BS3_ASSERT(pDst->cb == pSrc->cb && pDst->enmMethod == pSrc->enmMethod && pDst->fXcr0 == pSrc->fXcr0);38 BS3_ASSERT(pDst->cb == pSrc->cb && pDst->enmMethod == pSrc->enmMethod && pDst->fXcr0Nominal == pSrc->fXcr0Nominal); 39 39 Bs3MemCpy(&pDst->Ctx, &pSrc->Ctx, pDst->cb - RT_OFFSETOF(BS3EXTCTX, Ctx)); 40 pDst->fXcr0Saved = pSrc->fXcr0Saved; 40 41 return pDst; 41 42 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxInit.c
r66226 r66450 54 54 pExtCtx->enmMethod = BS3EXTCTXMETHOD_ANCIENT; 55 55 } 56 pExtCtx->cb = cbExtCtx; 57 pExtCtx->u16Magic = BS3EXTCTX_MAGIC; 58 pExtCtx->fXcr0 = fFlags; 56 pExtCtx->cb = cbExtCtx; 57 pExtCtx->u16Magic = BS3EXTCTX_MAGIC; 58 pExtCtx->fXcr0Nominal = fFlags; 59 pExtCtx->fXcr0Saved = fFlags; 59 60 return pExtCtx; 60 61 } -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxRestore.asm
r66214 r66450 36 36 push xBP 37 37 mov xBP, xSP 38 push xAX 39 BONLY32 push xCX 38 push sAX 39 push sCX 40 push sDX 41 push xBX 40 42 BONLY16 push es 41 BONLY16 push bx42 43 43 44 %if ARCH_BITS == 16 … … 56 57 jmp .return 57 58 58 .do_16_ xsave:59 xrstor [es:bx + BS3EXTCTX.Ctx]59 .do_16_fxsave: 60 fxrstor [es:bx + BS3EXTCTX.Ctx] 60 61 jmp .return 61 62 62 .do_16_fxsave: 63 fxrstor [es:bx + BS3EXTCTX.Ctx] 63 .do_16_xsave: 64 xor ecx, ecx 65 mov eax, [es:bx + BS3EXTCTX.fXcr0Nominal] 66 mov edx, [es:bx + BS3EXTCTX.fXcr0Nominal + 4] 67 xsetbv 68 69 xrstor [es:bx + BS3EXTCTX.Ctx] 70 71 mov eax, [es:bx + BS3EXTCTX.fXcr0Saved] 72 mov edx, [es:bx + BS3EXTCTX.fXcr0Saved + 4] 73 xsetbv 64 74 ;jmp .return 65 75 66 76 %else 67 BONLY32 mov ecx, [xBP + xCB + cbCurRetAddr] 77 BONLY32 mov ebx, [xBP + xCB + cbCurRetAddr] 78 BONLY64 mov rbx, rcx 68 79 69 mov al, [x CX + BS3EXTCTX.enmMethod]80 mov al, [xBX + BS3EXTCTX.enmMethod] 70 81 cmp al, BS3EXTCTXMETHOD_XSAVE 71 82 je .do_xsave … … 77 88 78 89 .do_ancient: 79 frstor [xCX + BS3EXTCTX.Ctx] 90 frstor [xBX + BS3EXTCTX.Ctx] 91 jmp .return 92 93 .do_fxsave: 94 BONLY32 fxrstor [xBX + BS3EXTCTX.Ctx] 95 BONLY64 fxrstor64 [xBX + BS3EXTCTX.Ctx] 80 96 jmp .return 81 97 82 98 .do_xsave: 83 BONLY32 xrstor [xCX + BS3EXTCTX.Ctx] 84 BONLY64 xrstor64 [xCX + BS3EXTCTX.Ctx] 85 jmp .return 99 xor ecx, ecx 100 mov eax, [xBX + BS3EXTCTX.fXcr0Nominal] 101 mov edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4] 102 xsetbv 86 103 87 .do_fxsave: 88 BONLY32 fxrstor [xCX + BS3EXTCTX.Ctx] 89 BONLY64 fxrstor64 [xCX + BS3EXTCTX.Ctx] 104 BONLY32 xrstor [xBX + BS3EXTCTX.Ctx] 105 BONLY64 xrstor64 [xBX + BS3EXTCTX.Ctx] 106 107 mov eax, [xBX + BS3EXTCTX.fXcr0Saved] 108 mov edx, [xBX + BS3EXTCTX.fXcr0Saved + 4] 109 xsetbv 90 110 ;jmp .return 91 111 … … 93 113 94 114 .return: 95 BONLY16 pop bx96 115 BONLY16 pop es 97 BONLY32 pop xCX 98 pop xAX 116 pop xBX 117 pop sDX 118 pop sCX 119 pop sAX 99 120 mov xSP, xBP 100 121 pop xBP … … 102 123 BS3_PROC_END_CMN Bs3ExtCtxRestore 103 124 104 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSave.asm
r66214 r66450 36 36 push xBP 37 37 mov xBP, xSP 38 push xAX 39 BONLY32 push xCX 38 push sAX 39 push sCX 40 push sDX 41 push xBX 40 42 BONLY16 push es 41 BONLY16 push bx42 43 43 44 %if ARCH_BITS == 16 … … 56 57 jmp .return 57 58 58 .do_16_ xsave:59 xsave[es:bx + BS3EXTCTX.Ctx]59 .do_16_fxsave: 60 fxsave [es:bx + BS3EXTCTX.Ctx] 60 61 jmp .return 61 62 62 .do_16_fxsave: 63 fxsave [es:bx + BS3EXTCTX.Ctx] 63 .do_16_xsave: 64 xor ecx, ecx 65 xgetbv 66 mov [es:bx + BS3EXTCTX.fXcr0Saved], eax 67 mov [es:bx + BS3EXTCTX.fXcr0Saved + 4], edx 68 mov eax, [es:bx + BS3EXTCTX.fXcr0Nominal] 69 mov edx, [es:bx + BS3EXTCTX.fXcr0Nominal + 4] 70 xsetbv 71 72 xsave [es:bx + BS3EXTCTX.Ctx] 73 74 mov eax, [es:bx + BS3EXTCTX.fXcr0Saved] 75 mov edx, [es:bx + BS3EXTCTX.fXcr0Saved + 4] 76 xsetbv 64 77 ;jmp .return 65 78 66 79 %else 67 BONLY32 mov ecx, [xBP + xCB + cbCurRetAddr] 80 BONLY32 mov ebx, [xBP + xCB + cbCurRetAddr] 81 BONLY64 mov rbx, rcx 68 82 69 mov al, [x CX + BS3EXTCTX.enmMethod]83 mov al, [xBX + BS3EXTCTX.enmMethod] 70 84 cmp al, BS3EXTCTXMETHOD_XSAVE 71 85 je .do_xsave … … 77 91 78 92 .do_ancient: 79 fnsave [xCX + BS3EXTCTX.Ctx] 93 fnsave [xBX + BS3EXTCTX.Ctx] 94 jmp .return 95 96 .do_fxsave: 97 BONLY32 fxsave [xBX + BS3EXTCTX.Ctx] 98 BONLY64 fxsave64 [xBX + BS3EXTCTX.Ctx] 80 99 jmp .return 81 100 82 101 .do_xsave: 83 BONLY32 xsave [xCX + BS3EXTCTX.Ctx] 84 BONLY64 xsave64 [xCX + BS3EXTCTX.Ctx] 85 jmp .return 102 xor ecx, ecx 103 xgetbv 104 mov [xBX + BS3EXTCTX.fXcr0Saved], eax 105 mov [xBX + BS3EXTCTX.fXcr0Saved + 4], edx 106 mov eax, [xBX + BS3EXTCTX.fXcr0Nominal] 107 mov edx, [xBX + BS3EXTCTX.fXcr0Nominal + 4] 108 xsetbv 86 109 87 .do_fxsave: 88 BONLY32 fxsave [xCX + BS3EXTCTX.Ctx] 89 BONLY64 fxsave64 [xCX + BS3EXTCTX.Ctx] 110 BONLY32 xsave [xBX + BS3EXTCTX.Ctx] 111 BONLY64 xsave64 [xBX + BS3EXTCTX.Ctx] 112 113 mov eax, [xBX + BS3EXTCTX.fXcr0Saved] 114 mov edx, [xBX + BS3EXTCTX.fXcr0Saved + 4] 115 xsetbv 90 116 ;jmp .return 91 117 … … 93 119 94 120 .return: 95 BONLY16 pop bx96 121 BONLY16 pop es 97 BONLY32 pop xCX 98 pop xAX 122 pop xBX 123 pop sDX 124 pop sCX 125 pop sAX 99 126 mov xSP, xBP 100 127 pop xBP -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
r66446 r66450 2686 2686 uint8_t enmMethod; 2687 2687 uint8_t abPadding0[3]; 2688 /** XSAVE_C_XXX. */ 2689 uint64_t fXcr0; 2688 /** Nominal XSAVE_C_XXX. */ 2689 uint64_t fXcr0Nominal; 2690 /** The saved XCR0 mask (restored after xrstor). */ 2691 uint64_t fXcr0Saved; 2690 2692 2691 2693 /** Explicit alignment padding. */ 2692 uint8_t abPadding[64 - 2 - 2 - 1 - 3 - 8 ];2694 uint8_t abPadding[64 - 2 - 2 - 1 - 3 - 8 - 8]; 2693 2695 2694 2696 /** The context, variable size (see above). -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.mac
r66226 r66450 1422 1422 ; 1423 1423 struc BS3EXTCTX 1424 .u16Magic resw 1; uint16_t u16Magic;1425 .cb resw 1; uint16_t cb;1426 .enmMethod resb 1; uint8_t enmMethod;1424 .u16Magic resw 1 ; uint16_t u16Magic; 1425 .cb resw 1 ; uint16_t cb; 1426 .enmMethod resb 1 ; uint8_t enmMethod; 1427 1427 alignb 8 1428 .fXcr0 resq 1 1428 .fXcr0Nominal resq 1 ; uint64_t fXcr0Nominal; 1429 .fXcr0Saved resq 1 ; uint64_t fXcr0Saved; 1429 1430 alignb 64 1430 .Ctx resb 5121431 .Ctx resb 512 1431 1432 endstruc 1432 1433 %define BS3EXTCTXMETHOD_ANCIENT 1
Note:
See TracChangeset
for help on using the changeset viewer.