Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #282 from intel/cpuid-fixing
Browse files Browse the repository at this point in the history
vcpu: Fix an issue of pointer checking
  • Loading branch information
wcwang authored Mar 27, 2020
2 parents 396bba3 + 8a0c1af commit e178418
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/vcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4503,7 +4503,11 @@ static void vcpu_init_cpuid(struct vcpu_t *vcpu)

if (vcpu->vcpu_id != 0) {
vcpu_0 = hax_get_vcpu(vcpu->vm->vm_id, 0, 0);
hax_assert(vcpu_0 != NULL);
if (vcpu_0 == NULL) {
hax_log(HAX_LOGE, "%s: initializing vCPU #%u with exception as "
"vCPU #0 is absent.\n", __func__, vcpu->vcpu_id);
return;
}
vcpu->guest_cpuid = vcpu_0->guest_cpuid;
hax_log(HAX_LOGI, "%s: referenced vcpu[%u].guest_cpuid to vcpu[%u].\n",
__func__, vcpu->vcpu_id, vcpu_0->vcpu_id);
Expand Down

0 comments on commit e178418

Please sign in to comment.