Skip to content

Commit

Permalink
hv: replace vlapic_init by vlapic_reset in vcpu_reset
Browse files Browse the repository at this point in the history
This change is to fix a guest vm hang issue at vm reset, especially easy to
be seen when it's a watchdog timeout reset.
vlapic_init create and init vlapic.vlapic_timer without deleting the
timer from cpu_times list, which breaks the list, results in a timer remains
with callback points to an invalid location.

Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Yan, Like <like.yan@intel.com>
  • Loading branch information
lyan3 authored and lijinxia committed Jun 14, 2018
1 parent 359b93f commit d8c8403
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/guest/vcpu.c
Expand Up @@ -281,7 +281,7 @@ void reset_vcpu(struct vcpu *vcpu)
vcpu->arch_vcpu.nr_sipi = 0;
vcpu->pending_pre_work = 0;
vlapic = vcpu->arch_vcpu.vlapic;
vlapic_init(vlapic);
vlapic_reset(vlapic);
}

void pause_vcpu(struct vcpu *vcpu, enum vcpu_state new_state)
Expand Down
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/guest/vlapic.c
Expand Up @@ -1437,7 +1437,7 @@ vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset,
return retval;
}

static void
void
vlapic_reset(struct vlapic *vlapic)
{
struct lapic *lapic;
Expand Down
1 change: 1 addition & 0 deletions hypervisor/include/arch/x86/guest/vlapic.h
Expand Up @@ -119,6 +119,7 @@ uint8_t vlapic_get_apicid(struct vlapic *vlapic);
int vlapic_create(struct vcpu *vcpu);
void vlapic_free(struct vcpu *vcpu);
void vlapic_init(struct vlapic *vlapic);
void vlapic_reset(struct vlapic *vlapic);
void vlapic_restore(struct vlapic *vlapic, struct lapic_regs *regs);
bool vlapic_enabled(struct vlapic *vlapic);
uint64_t apicv_get_apic_access_addr(struct vm *vm);
Expand Down

0 comments on commit d8c8403

Please sign in to comment.