| | 397 | |
|---|
| | 398 | /* Mask away invalid parts of the cpu context. */ |
|---|
| | 399 | if (CPUMGetGuestMode(pVM) != CPUMMODE_LONG) |
|---|
| | 400 | { |
|---|
| | 401 | uint64_t u64Mask = UINT64_C(0xffffffff); |
|---|
| | 402 | |
|---|
| | 403 | pCtxCoreDst->rip &= u64Mask; |
|---|
| | 404 | pCtxCoreDst->rax &= u64Mask; |
|---|
| | 405 | pCtxCoreDst->rbx &= u64Mask; |
|---|
| | 406 | pCtxCoreDst->rcx &= u64Mask; |
|---|
| | 407 | pCtxCoreDst->rdx &= u64Mask; |
|---|
| | 408 | pCtxCoreDst->rsi &= u64Mask; |
|---|
| | 409 | pCtxCoreDst->rdi &= u64Mask; |
|---|
| | 410 | pCtxCoreDst->rbp &= u64Mask; |
|---|
| | 411 | pCtxCoreDst->rsp &= u64Mask; |
|---|
| | 412 | pCtxCoreDst->rflags.u &= u64Mask; |
|---|
| | 413 | |
|---|
| | 414 | pCtxCoreDst->r8 = 0; |
|---|
| | 415 | pCtxCoreDst->r9 = 0; |
|---|
| | 416 | pCtxCoreDst->r10 = 0; |
|---|
| | 417 | pCtxCoreDst->r11 = 0; |
|---|
| | 418 | pCtxCoreDst->r12 = 0; |
|---|
| | 419 | pCtxCoreDst->r13 = 0; |
|---|
| | 420 | pCtxCoreDst->r14 = 0; |
|---|
| | 421 | pCtxCoreDst->r15 = 0; |
|---|
| | 422 | } |
|---|