mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv: refine virtualization flow for cr0 and cr4
- The current code to virtualize CR0/CR4 is not well designed, and hard to read. This patch reshuffle the logic to make it clear and classify those bits into PASSTHRU, TRAP_AND_PASSTHRU, TRAP_AND_EMULATE & reserved bits. Tracked-On: #5586 Signed-off-by: Eddie Dong <eddie.dong@intel.com> Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -366,8 +366,10 @@ int32_t hcall_set_vcpu_regs(struct acrn_vm *vm, struct acrn_vm *target_vm, __unu
|
||||
} else {
|
||||
vcpu = vcpu_from_vid(target_vm, vcpu_regs.vcpu_id);
|
||||
if (vcpu->state != VCPU_OFFLINE) {
|
||||
set_vcpu_regs(vcpu, &(vcpu_regs.vcpu_regs));
|
||||
ret = 0;
|
||||
if (is_valid_cr0_cr4(vcpu_regs.vcpu_regs.cr0, vcpu_regs.vcpu_regs.cr4)) {
|
||||
set_vcpu_regs(vcpu, &(vcpu_regs.vcpu_regs));
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user