mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-12-07 12:42:36 +00:00
HV:treewide:Add exec_vmread32 and exec_vmwrite32 functions
In the hypervisor, VMCS fields include 16-bit fields,
32-bit fields, 64-bit fields and natural-width fields.
In the current implement, no exec_vmread32/exec_vmwrite32
is for accessing 32-bit fields. So there are many type
casting for the return value and parameters vmread/vmwrite
operations.
Create exec_vmread32 and exec_vmwrite32 functions to
access 32-bit fields in VMCS;
Update related variables type for vmread/vmwrite operations;
Update related caller according to VMCS fields size.
V1--V2:
This is new part of this patch serial to only
update 32 bit vmread/vmread opertions and related
caller.
V2-->V3:
Update related variables type in data structure
for exec_vmread32/exec_vmwrite32.
Rename temp variable 'low' into 'value' for
exec_vmread32;
V3-->V4:
Remove useless type conversion.
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -113,10 +113,10 @@ struct cpu_regs {
|
||||
};
|
||||
|
||||
struct segment {
|
||||
uint64_t selector;
|
||||
uint16_t selector;
|
||||
uint64_t base;
|
||||
uint64_t limit;
|
||||
uint64_t attr;
|
||||
uint32_t limit;
|
||||
uint32_t attr;
|
||||
};
|
||||
|
||||
struct run_context {
|
||||
@@ -159,7 +159,7 @@ struct run_context {
|
||||
uint64_t ia32_pat;
|
||||
uint64_t vmx_ia32_pat;
|
||||
uint64_t ia32_efer;
|
||||
uint64_t ia32_sysenter_cs;
|
||||
uint32_t ia32_sysenter_cs;
|
||||
uint64_t ia32_sysenter_esp;
|
||||
uint64_t ia32_sysenter_eip;
|
||||
uint64_t ia32_debugctl;
|
||||
|
||||
@@ -415,9 +415,11 @@ int exec_vmxon_instr(uint16_t pcpu_id);
|
||||
uint64_t exec_vmread(uint32_t field);
|
||||
|
||||
uint16_t exec_vmread16(uint32_t field);
|
||||
uint32_t exec_vmread32(uint32_t field);
|
||||
uint64_t exec_vmread64(uint32_t field_full);
|
||||
void exec_vmwrite(uint32_t field, uint64_t value);
|
||||
void exec_vmwrite16(uint32_t field, uint16_t value);
|
||||
void exec_vmwrite32(uint32_t field, uint32_t value);
|
||||
void exec_vmwrite64(uint32_t field_full, uint64_t value);
|
||||
int init_vmcs(struct vcpu *vcpu);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user