Skip to content

Commit 948d58f

Browse files
Wei Liuwenlingz
authored andcommitted
acrn-dm: enable debug option for acrn-dm
enable acrn-dm debug option via RELEASE=0(by default) Tracked-On: #2939 Reviewed-by: Minggui Cao <minggui.cao@intel.com> Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent 2e5a6e2 commit 948d58f

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ sbl-hypervisor:
4343
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE)
4444

4545
devicemodel: tools
46-
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean
47-
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) DM_ASL_COMPILER=$(ASL_COMPILER)
46+
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) RELEASE=$(RELEASE) clean
47+
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) DM_ASL_COMPILER=$(ASL_COMPILER) RELEASE=$(RELEASE)
4848

4949
tools:
5050
mkdir -p $(TOOLS_OUT)

devicemodel/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DM_BUILD_VERSION ?=
99
DM_BUILD_TAG ?=
1010

1111
CC ?= gcc
12+
RELEASE ?= 0
1213

1314
CFLAGS := -g -O0 -std=gnu11
1415
CFLAGS += -D_GNU_SOURCE
@@ -47,6 +48,10 @@ endif
4748
endif
4849
endif
4950

51+
ifeq ($(RELEASE),0)
52+
CFLAGS += -DDM_DEBUG
53+
endif
54+
5055
LDFLAGS += -Wl,-z,noexecstack
5156
LDFLAGS += -Wl,-z,relro,-z,now
5257
LDFLAGS += -pie

devicemodel/core/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,14 @@ delete_cpu(struct vmctx *ctx, int vcpu)
322322
return CPU_EMPTY(&cpumask);
323323
}
324324

325+
#ifdef DM_DEBUG
325326
void
326327
notify_vmloop_thread(void)
327328
{
328329
pthread_kill(mt_vmm_info[0].mt_thr, SIGCONT);
329330
return;
330331
}
332+
#endif
331333

332334
static void
333335
vmexit_inout(struct vmctx *ctx, struct vhm_request *vhm_req, int *pvcpu)

devicemodel/hw/pci/wdt_i6300esb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,13 @@ wdt_expired_handler(void *arg, uint64_t nexp)
136136
wdt_timeout = 1;
137137

138138
/* watchdog timer out, set the uos to reboot */
139+
#ifdef DM_DEBUG
139140
vm_set_suspend_mode(VM_SUSPEND_SYSTEM_RESET);
140141
/* Notify vm thread to handle VM_SUSPEND_SYSTEM_RESET request */
141142
notify_vmloop_thread();
143+
#else
144+
vm_set_suspend_mode(VM_SUSPEND_FULL_RESET);
145+
#endif
142146
mevent_notify();
143147
} else {
144148
/* if not need reboot, just loop timer */

devicemodel/include/vmmapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ int vm_attach_ioreq_client(struct vmctx *ctx);
101101
int vm_notify_request_done(struct vmctx *ctx, int vcpu);
102102
void vm_clear_ioreq(struct vmctx *ctx);
103103
void vm_set_suspend_mode(enum vm_suspend_how how);
104+
#ifdef DM_DEBUG
104105
void notify_vmloop_thread(void);
106+
#endif
105107
int vm_get_suspend_mode(void);
106108
void vm_destroy(struct vmctx *ctx);
107109
int vm_parse_memsize(const char *optarg, size_t *memsize);

0 commit comments

Comments
 (0)