Changeset 83318 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- Mar 18, 2020 4:59:45 PM (5 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-fpustate-1-template.c
r82968 r83318 102 102 103 103 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_FNStEnv)(void BS3_FAR *pvMmioReg); 104 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovDQU_Read)(void BS3_FAR *pvMmioReg );104 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovDQU_Read)(void BS3_FAR *pvMmioReg, void BS3_FAR *pvResult); 105 105 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovDQU_Write)(void BS3_FAR *pvMmioReg); 106 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_FMul)(void BS3_FAR *pvMmioReg); 106 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovUPS_Read)(void BS3_FAR *pvMmioReg, void BS3_FAR *pvResult); 107 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovUPS_Write)(void BS3_FAR *pvMmioReg); 108 BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_FMul)(void BS3_FAR *pvMmioReg, void BS3_FAR *pvNoResult); 107 109 108 110 … … 129 131 bool fMmioReadback; 130 132 bool fReadBackError = false; 133 bool fReadError = false; 131 134 BS3PTRUNION MmioReg; 132 135 … … 255 258 256 259 # undef CHECK_READBACK_READ_RUN 257 # 260 #define CHECK_READBACK_READ_RUN(a_Instr, a_Worker, a_Type) \ 258 261 do { \ 259 262 off = (unsigned)(iLoop & (VMMDEV_TESTING_READBACK_SIZE / 2 - 1)); \ 260 263 if (off + sizeof(a_Type) > VMMDEV_TESTING_READBACK_SIZE) \ 261 264 off = VMMDEV_TESTING_READBACK_SIZE - sizeof(a_Type); \ 262 a_Worker((a_Type *)&MmioReg.pb[off] ); \265 a_Worker((a_Type *)&MmioReg.pb[off], (a_Type *)&abReadback[0]); \ 263 266 TMPL_NM(bs3FpuState1_Save)(pChecking); \ 264 267 } while (0) 265 268 # undef CHECK_READBACK_READ 266 269 # define CHECK_READBACK_READ(a_Instr, a_Worker, a_Type) \ 267 CHECK_READBACK_READ_RUN(a_Instr, a_Worker, a_Type); \ 268 CHECK_STATE(a_Instr) 269 270 do { \ 271 Bs3MemSet(&abReadback[0], 0xcc, sizeof(abReadback)); \ 272 CHECK_READBACK_READ_RUN(a_Instr, a_Worker, a_Type); \ 273 CHECK_STATE(a_Instr); \ 274 if (!fReadError || iLoop == 0) \ 275 { \ 276 Bs3MemZero(&abCompare[0], sizeof(abCompare)); \ 277 Bs3MemCpy(&abCompare[0], &MmioReg.pb[off], sizeof(a_Type)); \ 278 if (Bs3MemCmp(abReadback, abCompare, sizeof(a_Type)) != 0) \ 279 { \ 280 Bs3TestFailedF("Read result check for " #a_Instr " in loop #%RU32:\n%.*Rhxs expected:\n%.*Rhxs\n", \ 281 iLoop, sizeof(a_Type), abReadback, sizeof(a_Type), abCompare); \ 282 fReadError = true; \ 283 } \ 284 } \ 285 } while (0) 270 286 271 287 /* The tests. */ … … 274 290 CHECK_READBACK_WRITE( MOVDQU, TMPL_NM(bs3FpuState1_MovDQU_Write), X86XMMREG); 275 291 CHECK_READBACK_READ( MOVDQU, TMPL_NM(bs3FpuState1_MovDQU_Read), X86XMMREG); 292 CHECK_READBACK_WRITE( MOVUPS, TMPL_NM(bs3FpuState1_MovUPS_Write), X86XMMREG); 293 CHECK_READBACK_READ( MOVUPS, TMPL_NM(bs3FpuState1_MovUPS_Read), X86XMMREG); 276 294 277 295 /* Using the FPU is a little complicated, but we really need to check these things. */ 278 296 CHECK_READBACK_READ_RUN(FMUL, TMPL_NM(bs3FpuState1_FMul), uint64_t); 279 pExpected->FOP = 0x7dc; 297 if (1) 298 # if BS3_MODE_IS_16BIT_CODE(TMPL_MODE) 299 pExpected->FOP = 0x40f; // skylake 6700k 300 # else 301 pExpected->FOP = 0x40b; // skylake 6700k 302 # endif 303 else 304 pExpected->FOP = 0x7dc; // dunno where we got this. 280 305 # if ARCH_BITS == 64 281 306 pExpected->FPUDP = (uint32_t) (uintptr_t)&MmioReg.pb[off]; -
trunk/src/VBox/ValidationKit/bootsectors/bs3-fpustate-1-template.mac
r82968 r83318 84 84 movdqu xmm1, [TMPL_DATA16_WRT(g_r32_Two)] 85 85 movdqu xmm2, [TMPL_DATA16_WRT(g_r32_ThirtyTwo)] 86 movdqu xmm3, [TMPL_DATA16_WRT(g_r32_ ThirtyTwo)]87 movdqu xmm4, [TMPL_DATA16_WRT(g_r 32_SNaN)]86 movdqu xmm3, [TMPL_DATA16_WRT(g_r32_SNaN)] 87 movdqu xmm4, [TMPL_DATA16_WRT(g_r80_ThirtyTwo)] 88 88 movdqu xmm5, [TMPL_DATA16_WRT(g_r32_NegQNaN)] 89 89 movdqu xmm6, [TMPL_DATA16_WRT(g_r64_Zero)] … … 211 211 212 212 ; Do read. 213 movdqu [xBX], xmm 3213 movdqu [xBX], xmm0 214 214 215 215 TONLY16 pop ds … … 227 227 ; 228 228 BS3_PROC_BEGIN_MODE bs3FpuState1_MovDQU_Read, BS3_PBC_NEAR 229 BS3_CALL_CONV_PROLOG 1229 BS3_CALL_CONV_PROLOG 2 230 230 push xBP 231 231 mov xBP, xSP … … 247 247 movdqu xmm2, [xBX] 248 248 249 ; Save the result. 250 mov xBX, [xBP + xCB + cbCurRetAddr + sCB] 251 TONLY16 mov ds, [xBP + xCB + cbCurRetAddr + sCB + 2] 252 movups [xBX], xmm2 253 249 254 %if TMPL_BITS == 16 250 255 movdqu xmm2, [xBP - xCB - xCB - 2 - 18h] … … 257 262 mov xSP, xBP 258 263 pop xBP 264 BS3_CALL_CONV_EPILOG 2 265 BS3_HYBRID_RET 266 BS3_PROC_END_MODE bs3FpuState1_MovDQU_Read 267 268 269 ;; 270 ; Performs a MOVUPS write on the specified memory. 271 ; 272 ; BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovUPS_Write)(void *pvMmioReg); 273 ; 274 BS3_PROC_BEGIN_MODE bs3FpuState1_MovUPS_Write, BS3_PBC_NEAR 275 BS3_CALL_CONV_PROLOG 1 276 push xBP 277 mov xBP, xSP 278 push xBX 279 TONLY16 push ds 280 281 ; Load the register pointer. 282 mov xBX, [xBP + xCB + cbCurRetAddr] 283 TONLY16 mov ds, [xBP + xCB + cbCurRetAddr + 2] 284 285 ; Do read. 286 movups [xBX], xmm3 287 288 TONLY16 pop ds 289 pop xBX 290 leave 259 291 BS3_CALL_CONV_EPILOG 1 260 292 BS3_HYBRID_RET 261 BS3_PROC_END_MODE bs3FpuState1_MovDQU_Read 293 BS3_PROC_END_MODE bs3FpuState1_MovUPS_Write 294 295 296 ;; 297 ; Performs a MOVUPS write to the specified memory. 298 ; 299 ; BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_MovUPS_Read)(void *pvMmioReg, void *pvResult); 300 ; 301 BS3_PROC_BEGIN_MODE bs3FpuState1_MovUPS_Read, BS3_PBC_NEAR 302 BS3_CALL_CONV_PROLOG 2 303 push xBP 304 mov xBP, xSP 305 push xBX 306 TONLY16 push ds 307 sub xSP, 20h 308 %if TMPL_BITS == 16 309 movups [xBP - xCB - xCB - 2 - 18h], xmm1 310 %else 311 movups [xSP], xmm1 312 %endif 313 314 ; Load the register pointer. 315 mov xBX, [xBP + xCB + cbCurRetAddr] 316 TONLY16 mov ds, [xBP + xCB + cbCurRetAddr + 2] 317 318 319 ; Do read. 320 movups xmm1, [xBX] 321 322 ; Save the result. 323 mov xBX, [xBP + xCB + cbCurRetAddr + sCB] 324 TONLY16 mov ds, [xBP + xCB + cbCurRetAddr + sCB + 2] 325 movups [xBX], xmm1 326 327 %if TMPL_BITS == 16 328 movups xmm1, [xBP - xCB - xCB - 2 - 18h] 329 %else 330 movups xmm1, [xSP] 331 %endif 332 add xSP, 20h 333 TONLY16 pop ds 334 pop xBX 335 mov xSP, xBP 336 pop xBP 337 BS3_CALL_CONV_EPILOG 2 338 BS3_HYBRID_RET 339 BS3_PROC_END_MODE bs3FpuState1_MovUPS_Read 262 340 263 341 … … 293 371 ; Performs a FMUL on the specified memory, after writing a 64-bit value to it first. 294 372 ; 295 ; BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_FMul)(void *pvMmioReg );373 ; BS3_DECL_NEAR(void) TMPL_NM(bs3FpuState1_FMul)(void *pvMmioReg, void *pvResultIgnored); 296 374 ; 297 375 BS3_PROC_BEGIN_MODE bs3FpuState1_FMul, BS3_PBC_NEAR 298 BS3_CALL_CONV_PROLOG 1376 BS3_CALL_CONV_PROLOG 2 299 377 push xBP 300 378 mov xBP, xSP … … 319 397 mov xSP, xBP 320 398 pop xBP 321 BS3_CALL_CONV_EPILOG 1399 BS3_CALL_CONV_EPILOG 2 322 400 BS3_HYBRID_RET 323 401 .do_it:
Note:
See TracChangeset
for help on using the changeset viewer.