mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
hv: bugfix for sbuf reset
The sbuf is allocated for each pcpu by hypercall from SOS. Before launch Guest OS, the script will offline cpus, which will trigger vcpu reset and then reset sbuf pointer. But sbuf only initiate once by SOS, so these cpus for Guest OS has no sbuf to use. Thus, when run 'acrntrace' on SOS, there is no trace data for Guest OS. To fix the issue, only reset the sbuf for SOS. Tracked-On: #3335 Signed-off-by: Conghui Chen <conghui.chen@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Reviewed-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
@@ -579,8 +579,6 @@ void reset_vcpu(struct acrn_vcpu *vcpu)
|
||||
vlapic = vcpu_vlapic(vcpu);
|
||||
vlapic_reset(vlapic);
|
||||
|
||||
sbuf_reset(vcpu->pcpu_id);
|
||||
|
||||
reset_vcpu_regs(vcpu);
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <vboot_info.h>
|
||||
#include <board.h>
|
||||
#include <sgx.h>
|
||||
#include <sbuf.h>
|
||||
|
||||
vm_sw_loader_t vm_sw_loader;
|
||||
|
||||
@@ -575,6 +576,10 @@ int32_t shutdown_vm(struct acrn_vm *vm)
|
||||
vm_config = get_vm_config(vm->vm_id);
|
||||
vm_config->guest_flags &= ~DM_OWNED_GUEST_FLAG_MASK;
|
||||
|
||||
if (is_sos_vm(vm)) {
|
||||
sbuf_reset();
|
||||
}
|
||||
|
||||
vpci_cleanup(vm);
|
||||
|
||||
vuart_deinit(vm);
|
||||
|
Reference in New Issue
Block a user