//\r
// Any state other than unencrypted is an error, issue a #GP.\r
//\r
+ DEBUG ((DEBUG_ERROR,\r
+ "MMIO using encrypted memory: %lx\n",\r
+ (UINT64) MemoryAddress));\r
GpEvent.Uint64 = 0;\r
GpEvent.Elements.Vector = GP_EXCEPTION;\r
GpEvent.Elements.Type = GHCB_EVENT_INJECTION_TYPE_EXCEPTION;\r
// fall through\r
//\r
case 0xB7:\r
+ DecodeModRm (Regs, InstructionData);\r
Bytes = (Bytes != 0) ? Bytes : 2;\r
\r
Status = ValidateMmioMemory (Ghcb, InstructionData->Ext.RmData, Bytes);\r
}\r
\r
Register = GetRegisterPointer (Regs, InstructionData->Ext.ModRm.Reg);\r
- SetMem (Register, InstructionData->DataSize, 0);\r
+ SetMem (Register, (UINTN) (1 << InstructionData->DataSize), 0);\r
CopyMem (Register, Ghcb->SharedBuffer, Bytes);\r
break;\r
\r
// fall through\r
//\r
case 0xBF:\r
+ DecodeModRm (Regs, InstructionData);\r
Bytes = (Bytes != 0) ? Bytes : 2;\r
\r
Status = ValidateMmioMemory (Ghcb, InstructionData->Ext.RmData, Bytes);\r
}\r
\r
Register = GetRegisterPointer (Regs, InstructionData->Ext.ModRm.Reg);\r
- SetMem (Register, InstructionData->DataSize, SignByte);\r
+ SetMem (Register, (UINTN) (1 << InstructionData->DataSize), SignByte);\r
CopyMem (Register, Ghcb->SharedBuffer, Bytes);\r
break;\r
\r