HV: instr_emul: make integer conversion explicit

This patch makes necessary integer narrowing and/or signedness conversion
explicit.

While some narrowing are expected behavior, the correctness of the others relies
on the specifications of some interfaces (e.g. the higher 32-bit of what
exec_vmread() returns is all 0s if the given field is 32-bit). Add a stub
for now to avoid missing them.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao
2018-07-04 23:32:05 +08:00
committed by lijinxia
parent 158242d507
commit ecce1e6ae4
3 changed files with 25 additions and 14 deletions

View File

@@ -402,7 +402,18 @@
/* External Interfaces */
int exec_vmxon_instr(uint16_t pcpu_id);
/**
* Read field from VMCS.
*
* Refer to Chapter 24, Vol. 3 in SDM for the width of VMCS fields.
*
* @return full contents in IA-32e mode for 64-bit fields.
* @return the lower 32-bit outside IA-32e mode for 64-bit fields.
* @return full contents for 32-bit fields, with higher 32-bit set to 0.
*/
uint64_t exec_vmread(uint32_t field);
uint64_t exec_vmread64(uint32_t field_full);
void exec_vmwrite(uint32_t field, uint64_t value);
void exec_vmwrite64(uint32_t field_full, uint64_t value);