mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 15:02:13 +00:00
dm: add log for debuging pci while vm reset
Print some log to dmesg when init/deinit vdev. Tracked-On: #2419 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
parent
68a2aa5086
commit
928dfefc62
@ -41,6 +41,7 @@
|
|||||||
#include "mevent.h"
|
#include "mevent.h"
|
||||||
#include "irq.h"
|
#include "irq.h"
|
||||||
#include "lpc.h"
|
#include "lpc.h"
|
||||||
|
#include "dm.h"
|
||||||
|
|
||||||
static pthread_mutex_t pm_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t pm_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static struct mevent *power_button;
|
static struct mevent *power_button;
|
||||||
@ -68,12 +69,14 @@ reset_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
|
|||||||
|
|
||||||
if (*eax & 0x8) {
|
if (*eax & 0x8) {
|
||||||
fprintf(stderr, "full reset\r\n");
|
fprintf(stderr, "full reset\r\n");
|
||||||
|
write_kmsg("full reset\n");
|
||||||
error = vm_suspend(ctx, VM_SUSPEND_FULL_RESET);
|
error = vm_suspend(ctx, VM_SUSPEND_FULL_RESET);
|
||||||
assert(error ==0 || errno == EALREADY);
|
assert(error ==0 || errno == EALREADY);
|
||||||
mevent_notify();
|
mevent_notify();
|
||||||
reset_control = 0;
|
reset_control = 0;
|
||||||
} else if (*eax & 0x4) {
|
} else if (*eax & 0x4) {
|
||||||
fprintf(stderr, "system reset\r\n");
|
fprintf(stderr, "system reset\r\n");
|
||||||
|
write_kmsg("system reset\n");
|
||||||
error = vm_suspend(ctx, VM_SUSPEND_SYSTEM_RESET);
|
error = vm_suspend(ctx, VM_SUSPEND_SYSTEM_RESET);
|
||||||
assert(error ==0 || errno == EALREADY);
|
assert(error ==0 || errno == EALREADY);
|
||||||
mevent_notify();
|
mevent_notify();
|
||||||
|
@ -409,6 +409,7 @@ vm_get_suspend_mode(void)
|
|||||||
int
|
int
|
||||||
vm_suspend(struct vmctx *ctx, enum vm_suspend_how how)
|
vm_suspend(struct vmctx *ctx, enum vm_suspend_how how)
|
||||||
{
|
{
|
||||||
|
write_kmsg("vm_suspend mode to: %d\n", how);
|
||||||
vm_set_suspend_mode(how);
|
vm_set_suspend_mode(how);
|
||||||
mevent_notify();
|
mevent_notify();
|
||||||
|
|
||||||
|
@ -1273,10 +1273,15 @@ init_pci(struct vmctx *ctx)
|
|||||||
continue;
|
continue;
|
||||||
ops = pci_emul_finddev(fi->fi_name);
|
ops = pci_emul_finddev(fi->fi_name);
|
||||||
assert(ops != NULL);
|
assert(ops != NULL);
|
||||||
|
write_kmsg("%s before init ---\n", fi->fi_name);
|
||||||
error = pci_emul_init(ctx, ops, bus, slot,
|
error = pci_emul_init(ctx, ops, bus, slot,
|
||||||
func, fi);
|
func, fi);
|
||||||
if (error)
|
if (error) {
|
||||||
|
write_kmsg("%s after init failure ---\n", fi->fi_name);
|
||||||
goto pci_emul_init_fail;
|
goto pci_emul_init_fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
write_kmsg("%s after init ---\n", fi->fi_name);
|
||||||
success_cnt++;
|
success_cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1430,8 +1435,9 @@ deinit_pci(struct vmctx *ctx)
|
|||||||
continue;
|
continue;
|
||||||
ops = pci_emul_finddev(fi->fi_name);
|
ops = pci_emul_finddev(fi->fi_name);
|
||||||
assert(ops != NULL);
|
assert(ops != NULL);
|
||||||
pci_emul_deinit(ctx, ops, bus, slot,
|
write_kmsg("%s before deinit ---\n", fi->fi_name);
|
||||||
func, fi);
|
pci_emul_deinit(ctx, ops, bus, slot, func, fi);
|
||||||
|
write_kmsg("%s after deinit ---\n", fi->fi_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user