Changeset 79203 in vbox
- Timestamp:
- Jun 18, 2019 9:14:02 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r79196 r79203 194 194 uint16_t const g_aoffVmcsMap[16][VMX_V_VMCS_MAX_INDEX + 1] = 195 195 { 196 /* VMX_VMCS _ENC_WIDTH_16BIT | VMX_VMCS_ENC_TYPE_CONTROL: */196 /* VMX_VMCSFIELD_WIDTH_16BIT | VMX_VMCSFIELD_TYPE_CONTROL: */ 197 197 { 198 198 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u16Vpid), … … 203 203 /* 19-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 204 204 }, 205 /* VMX_VMCS _ENC_WIDTH_16BIT | VMX_VMCS_ENC_TYPE_VMEXIT_INFO: */205 /* VMX_VMCSFIELD_WIDTH_16BIT | VMX_VMCSFIELD_TYPE_VMEXIT_INFO: */ 206 206 { 207 207 /* 0-7 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, … … 210 210 /* 24-25 */ UINT16_MAX, UINT16_MAX 211 211 }, 212 /* VMX_VMCS _ENC_WIDTH_16BIT | VMX_VMCS_ENC_TYPE_GUEST_STATE: */212 /* VMX_VMCSFIELD_WIDTH_16BIT | VMX_VMCSFIELD_TYPE_GUEST_STATE: */ 213 213 { 214 214 /* 0 */ RT_UOFFSETOF(VMXVVMCS, GuestEs), … … 225 225 /* 18-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 226 226 }, 227 /* VMX_VMCS _ENC_WIDTH_16BIT | VMX_VMCS_ENC_TYPE_HOST_STATE: */227 /* VMX_VMCSFIELD_WIDTH_16BIT | VMX_VMCSFIELD_TYPE_HOST_STATE: */ 228 228 { 229 229 /* 0 */ RT_UOFFSETOF(VMXVVMCS, HostEs), … … 238 238 /* 23-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX 239 239 }, 240 /* VMX_VMCS _ENC_WIDTH_64BIT | VMX_VMCS_ENC_TYPE_CONTROL: */240 /* VMX_VMCSFIELD_WIDTH_64BIT | VMX_VMCSFIELD_TYPE_CONTROL: */ 241 241 { 242 242 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64AddrIoBitmapA), … … 267 267 /* 25 */ RT_UOFFSETOF(VMXVVMCS, u64TscMultiplier) 268 268 }, 269 /* VMX_VMCS _ENC_WIDTH_64BIT | VMX_VMCS_ENC_TYPE_VMEXIT_INFO: */269 /* VMX_VMCSFIELD_WIDTH_64BIT | VMX_VMCSFIELD_TYPE_VMEXIT_INFO: */ 270 270 { 271 271 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64RoGuestPhysAddr), … … 275 275 /* 25 */ UINT16_MAX 276 276 }, 277 /* VMX_VMCS _ENC_WIDTH_64BIT | VMX_VMCS_ENC_TYPE_GUEST_STATE: */277 /* VMX_VMCSFIELD_WIDTH_64BIT | VMX_VMCSFIELD_TYPE_GUEST_STATE: */ 278 278 { 279 279 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64VmcsLinkPtr), … … 291 291 /* 19-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 292 292 }, 293 /* VMX_VMCS _ENC_WIDTH_64BIT | VMX_VMCS_ENC_TYPE_HOST_STATE: */293 /* VMX_VMCSFIELD_WIDTH_64BIT | VMX_VMCSFIELD_TYPE_HOST_STATE: */ 294 294 { 295 295 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64HostPatMsr), … … 300 300 /* 19-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 301 301 }, 302 /* VMX_VMCS _ENC_WIDTH_32BIT | VMX_VMCS_ENC_TYPE_CONTROL: */302 /* VMX_VMCSFIELD_WIDTH_32BIT | VMX_VMCSFIELD_TYPE_CONTROL: */ 303 303 { 304 304 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u32PinCtls), … … 322 322 /* 18-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 323 323 }, 324 /* VMX_VMCS _ENC_WIDTH_32BIT | VMX_VMCS_ENC_TYPE_VMEXIT_INFO: */324 /* VMX_VMCSFIELD_WIDTH_32BIT | VMX_VMCSFIELD_TYPE_VMEXIT_INFO: */ 325 325 { 326 326 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u32RoVmInstrError), … … 336 336 /* 24-25 */ UINT16_MAX, UINT16_MAX 337 337 }, 338 /* VMX_VMCS _ENC_WIDTH_32BIT | VMX_VMCS_ENC_TYPE_GUEST_STATE: */338 /* VMX_VMCSFIELD_WIDTH_32BIT | VMX_VMCSFIELD_TYPE_GUEST_STATE: */ 339 339 { 340 340 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u32GuestEsLimit), … … 363 363 /* 23-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX 364 364 }, 365 /* VMX_VMCS _ENC_WIDTH_32BIT | VMX_VMCS_ENC_TYPE_HOST_STATE: */365 /* VMX_VMCSFIELD_WIDTH_32BIT | VMX_VMCSFIELD_TYPE_HOST_STATE: */ 366 366 { 367 367 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u32HostSysenterCs), … … 371 371 /* 25 */ UINT16_MAX 372 372 }, 373 /* VMX_VMCS _ENC_WIDTH_NATURAL | VMX_VMCS_ENC_TYPE_CONTROL: */373 /* VMX_VMCSFIELD_WIDTH_NATURAL | VMX_VMCSFIELD_TYPE_CONTROL: */ 374 374 { 375 375 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64Cr0Mask), … … 385 385 /* 24-25 */ UINT16_MAX, UINT16_MAX 386 386 }, 387 /* VMX_VMCS _ENC_WIDTH_NATURAL | VMX_VMCS_ENC_TYPE_VMEXIT_INFO: */387 /* VMX_VMCSFIELD_WIDTH_NATURAL | VMX_VMCSFIELD_TYPE_VMEXIT_INFO: */ 388 388 { 389 389 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64RoExitQual), … … 397 397 /* 22-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 398 398 }, 399 /* VMX_VMCS _ENC_WIDTH_NATURAL | VMX_VMCS_ENC_TYPE_GUEST_STATE: */399 /* VMX_VMCSFIELD_WIDTH_NATURAL | VMX_VMCSFIELD_TYPE_GUEST_STATE: */ 400 400 { 401 401 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64GuestCr0), … … 421 421 /* 20-25 */ UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX 422 422 }, 423 /* VMX_VMCS _ENC_WIDTH_NATURAL | VMX_VMCS_ENC_TYPE_HOST_STATE: */423 /* VMX_VMCSFIELD_WIDTH_NATURAL | VMX_VMCSFIELD_TYPE_HOST_STATE: */ 424 424 { 425 425 /* 0 */ RT_UOFFSETOF(VMXVVMCS, u64HostCr0), … … 451 451 Assert(iSegReg < X86_SREG_COUNT); 452 452 RTSEL HostSel; 453 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_16BIT;454 uint8_t const uType = VMX_VMCS _ENC_TYPE_HOST_STATE;453 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_16BIT; 454 uint8_t const uType = VMX_VMCSFIELD_TYPE_HOST_STATE; 455 455 uint8_t const uWidthType = (uWidth << 2) | uType; 456 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_HOST_ES_SEL, VMX_BF_VMCS _ENC_INDEX);456 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_HOST_ES_SEL, VMX_BF_VMCSFIELD_INDEX); 457 457 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 458 458 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 478 478 /* Selector. */ 479 479 { 480 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_16BIT;481 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;480 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_16BIT; 481 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 482 482 uint8_t const uWidthType = (uWidth << 2) | uType; 483 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_GUEST_ES_SEL, VMX_BF_VMCS _ENC_INDEX);483 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_GUEST_ES_SEL, VMX_BF_VMCSFIELD_INDEX); 484 484 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 485 485 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 491 491 /* Limit. */ 492 492 { 493 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_32BIT;494 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;493 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_32BIT; 494 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 495 495 uint8_t const uWidthType = (uWidth << 2) | uType; 496 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_LIMIT, VMX_BF_VMCS _ENC_INDEX);496 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_LIMIT, VMX_BF_VMCSFIELD_INDEX); 497 497 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 498 498 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 504 504 /* Base. */ 505 505 { 506 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_NATURAL;507 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;506 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_NATURAL; 507 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 508 508 uint8_t const uWidthType = (uWidth << 2) | uType; 509 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS_GUEST_ES_BASE, VMX_BF_VMCS _ENC_INDEX);509 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS_GUEST_ES_BASE, VMX_BF_VMCSFIELD_INDEX); 510 510 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 511 511 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 520 520 | X86DESCATTR_AVL | X86DESCATTR_L | X86DESCATTR_D | X86DESCATTR_G 521 521 | X86DESCATTR_UNUSABLE; 522 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_32BIT;523 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;522 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_32BIT; 523 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 524 524 uint8_t const uWidthType = (uWidth << 2) | uType; 525 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS, VMX_BF_VMCS _ENC_INDEX);525 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS, VMX_BF_VMCSFIELD_INDEX); 526 526 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 527 527 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 553 553 uint16_t u16Sel; 554 554 { 555 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_16BIT;556 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;555 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_16BIT; 556 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 557 557 uint8_t const uWidthType = (uWidth << 2) | uType; 558 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_GUEST_ES_SEL, VMX_BF_VMCS _ENC_INDEX);558 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS16_GUEST_ES_SEL, VMX_BF_VMCSFIELD_INDEX); 559 559 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_3); 560 560 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 567 567 uint32_t u32Limit; 568 568 { 569 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_32BIT;570 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;569 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_32BIT; 570 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 571 571 uint8_t const uWidthType = (uWidth << 2) | uType; 572 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_LIMIT, VMX_BF_VMCS _ENC_INDEX);572 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_LIMIT, VMX_BF_VMCSFIELD_INDEX); 573 573 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_3); 574 574 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 581 581 uint64_t u64Base; 582 582 { 583 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_NATURAL;584 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;583 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_NATURAL; 584 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 585 585 uint8_t const uWidthType = (uWidth << 2) | uType; 586 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS_GUEST_ES_BASE, VMX_BF_VMCS _ENC_INDEX);586 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS_GUEST_ES_BASE, VMX_BF_VMCSFIELD_INDEX); 587 587 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_3); 588 588 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 596 596 uint32_t u32Attr; 597 597 { 598 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_32BIT;599 uint8_t const uType = VMX_VMCS _ENC_TYPE_GUEST_STATE;598 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_32BIT; 599 uint8_t const uType = VMX_VMCSFIELD_TYPE_GUEST_STATE; 600 600 uint8_t const uWidthType = (uWidth << 2) | uType; 601 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS, VMX_BF_VMCS _ENC_INDEX);601 uint8_t const uIndex = iSegReg + RT_BF_GET(VMX_VMCS32_GUEST_ES_ACCESS_RIGHTS, VMX_BF_VMCSFIELD_INDEX); 602 602 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_3); 603 603 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 628 628 { 629 629 Assert(idxCr3Target < VMX_V_CR3_TARGET_COUNT); 630 uint8_t const uWidth = VMX_VMCS _ENC_WIDTH_NATURAL;631 uint8_t const uType = VMX_VMCS _ENC_TYPE_CONTROL;630 uint8_t const uWidth = VMX_VMCSFIELD_WIDTH_NATURAL; 631 uint8_t const uType = VMX_VMCSFIELD_TYPE_CONTROL; 632 632 uint8_t const uWidthType = (uWidth << 2) | uType; 633 uint8_t const uIndex = idxCr3Target + RT_BF_GET(VMX_VMCS_CTRL_CR3_TARGET_VAL0, VMX_BF_VMCS _ENC_INDEX);633 uint8_t const uIndex = idxCr3Target + RT_BF_GET(VMX_VMCS_CTRL_CR3_TARGET_VAL0, VMX_BF_VMCSFIELD_INDEX); 634 634 Assert(uIndex <= VMX_V_VMCS_MAX_INDEX); 635 635 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 7597 7597 VMXVMCSFIELD VmcsField; 7598 7598 VmcsField.u = u64VmcsField; 7599 uint8_t const uWidth = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_WIDTH);7600 uint8_t const uType = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_TYPE);7599 uint8_t const uWidth = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_WIDTH); 7600 uint8_t const uType = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_TYPE); 7601 7601 uint8_t const uWidthType = (uWidth << 2) | uType; 7602 uint8_t const uIndex = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_INDEX);7602 uint8_t const uIndex = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_INDEX); 7603 7603 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_2); 7604 7604 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 7619 7619 switch (uEffWidth) 7620 7620 { 7621 case VMX_VMCS _ENC_WIDTH_64BIT:7622 case VMX_VMCS _ENC_WIDTH_NATURAL: *pu64Dst = *(uint64_t *)pbField; break;7623 case VMX_VMCS _ENC_WIDTH_32BIT: *pu64Dst = *(uint32_t *)pbField; break;7624 case VMX_VMCS _ENC_WIDTH_16BIT: *pu64Dst = *(uint16_t *)pbField; break;7621 case VMX_VMCSFIELD_WIDTH_64BIT: 7622 case VMX_VMCSFIELD_WIDTH_NATURAL: *pu64Dst = *(uint64_t *)pbField; break; 7623 case VMX_VMCSFIELD_WIDTH_32BIT: *pu64Dst = *(uint32_t *)pbField; break; 7624 case VMX_VMCSFIELD_WIDTH_16BIT: *pu64Dst = *(uint16_t *)pbField; break; 7625 7625 } 7626 7626 return VINF_SUCCESS; … … 7852 7852 VMXVMCSFIELD VmcsField; 7853 7853 VmcsField.u = u64VmcsField; 7854 uint8_t const uWidth = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_WIDTH);7855 uint8_t const uType = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_TYPE);7854 uint8_t const uWidth = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_WIDTH); 7855 uint8_t const uType = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_TYPE); 7856 7856 uint8_t const uWidthType = (uWidth << 2) | uType; 7857 uint8_t const uIndex = RT_BF_GET(VmcsField.u, VMX_BF_VMCS _ENC_INDEX);7857 uint8_t const uIndex = RT_BF_GET(VmcsField.u, VMX_BF_VMCSFIELD_INDEX); 7858 7858 AssertReturn(uIndex <= VMX_V_VMCS_MAX_INDEX, VERR_IEM_IPE_2); 7859 7859 uint16_t const offField = g_aoffVmcsMap[uWidthType][uIndex]; … … 7870 7870 switch (uEffWidth) 7871 7871 { 7872 case VMX_VMCS _ENC_WIDTH_64BIT:7873 case VMX_VMCS _ENC_WIDTH_NATURAL: *(uint64_t *)pbField = u64Val; break;7874 case VMX_VMCS _ENC_WIDTH_32BIT: *(uint32_t *)pbField = u64Val; break;7875 case VMX_VMCS _ENC_WIDTH_16BIT: *(uint16_t *)pbField = u64Val; break;7872 case VMX_VMCSFIELD_WIDTH_64BIT: 7873 case VMX_VMCSFIELD_WIDTH_NATURAL: *(uint64_t *)pbField = u64Val; break; 7874 case VMX_VMCSFIELD_WIDTH_32BIT: *(uint32_t *)pbField = u64Val; break; 7875 case VMX_VMCSFIELD_WIDTH_16BIT: *(uint16_t *)pbField = u64Val; break; 7876 7876 } 7877 7877
Note:
See TracChangeset
for help on using the changeset viewer.