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>
This commit is contained in:
Wei Liu 2019-04-16 13:22:35 +08:00 committed by wenlingz
parent 8f32193d99
commit 57ac00a61f
5 changed files with 16 additions and 2 deletions

View File

@ -58,8 +58,8 @@ sbl-hypervisor:
make -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE)
devicemodel: tools
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG)
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) RELEASE=$(RELEASE) clean
make -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) RELEASE=$(RELEASE)
tools:
mkdir -p $(TOOLS_OUT)

View File

@ -9,6 +9,7 @@ DM_BUILD_VERSION ?=
DM_BUILD_TAG ?=
CC ?= gcc
RELEASE ?= 0
CFLAGS := -g -O0 -std=gnu11
CFLAGS += -D_GNU_SOURCE
@ -43,6 +44,10 @@ endif
endif
endif
ifeq ($(RELEASE),0)
CFLAGS += -DDM_DEBUG
endif
LDFLAGS += -Wl,-z,noexecstack
LDFLAGS += -Wl,-z,relro,-z,now
LDFLAGS += -pie

View File

@ -312,12 +312,14 @@ delete_cpu(struct vmctx *ctx, int vcpu)
return CPU_EMPTY(&cpumask);
}
#ifdef DM_DEBUG
void
notify_vmloop_thread(void)
{
pthread_kill(mt_vmm_info[0].mt_thr, SIGCONT);
return;
}
#endif
static void
vmexit_inout(struct vmctx *ctx, struct vhm_request *vhm_req, int *pvcpu)

View File

@ -136,8 +136,13 @@ wdt_expired_handler(void *arg)
wdt_timeout = 1;
/* watchdog timer out, set the uos to reboot */
#ifdef DM_DEBUG
vm_set_suspend_mode(VM_SUSPEND_SYSTEM_RESET);
/* Notify vm thread to handle VM_SUSPEND_SYSTEM_RESET request */
notify_vmloop_thread();
#else
vm_set_suspend_mode(VM_SUSPEND_FULL_RESET);
#endif
mevent_notify();
} else {
/* if not need reboot, just loop timer */

View File

@ -100,7 +100,9 @@ int vm_attach_ioreq_client(struct vmctx *ctx);
int vm_notify_request_done(struct vmctx *ctx, int vcpu);
void vm_clear_ioreq(struct vmctx *ctx);
void vm_set_suspend_mode(enum vm_suspend_how how);
#ifdef DM_DEBUG
void notify_vmloop_thread(void);
#endif
int vm_get_suspend_mode(void);
void vm_destroy(struct vmctx *ctx);
int vm_parse_memsize(const char *optarg, size_t *memsize);