From 304cab9acffede7240b0f7dcf60b432359e0dd2f Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Thu, 22 Mar 2018 00:23:01 +0800 Subject: [PATCH] Don't use HV_DEBUG outside debug directory Signed-off-by: Li, Fei1 --- arch/x86/cpu.c | 6 +----- common/hypercall.c | 15 --------------- include/debug/sbuf.h | 7 +++++++ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/x86/cpu.c b/arch/x86/cpu.c index 118f76932..4542d7f85 100644 --- a/arch/x86/cpu.c +++ b/arch/x86/cpu.c @@ -254,9 +254,7 @@ static void set_fs_base(void) void bsp_boot_init(void) { -#ifdef HV_DEBUG uint64_t start_tsc = rdtsc(); -#endif /* Clear BSS */ memset(_ld_bss_start, 0, _ld_bss_end - _ld_bss_start); @@ -346,8 +344,6 @@ void bsp_boot_init(void) init_logmsg(LOG_BUF_SIZE, LOG_DESTINATION); -#ifdef HV_DEBUG - /* Log first messages */ if (HV_RC_VERSION) printf("HV version %d.%d-rc%d-%s-%s build by %s, start time %lluus\r\n", HV_MAJOR_VERSION, HV_MINOR_VERSION, HV_RC_VERSION, @@ -361,7 +357,7 @@ void bsp_boot_init(void) printf("API version %d.%d\r\n", HV_API_MAJOR_VERSION, HV_API_MINOR_VERSION); -#endif + pr_dbg("Core %d is up", CPU_BOOT_ID); /* Warn for security feature not ready */ diff --git a/common/hypercall.c b/common/hypercall.c index 452f54958..022999eed 100644 --- a/common/hypercall.c +++ b/common/hypercall.c @@ -632,7 +632,6 @@ hcall_reset_ptdev_intr_info(struct vm *vm, uint64_t vmid, uint64_t param) return ret; } -#ifdef HV_DEBUG int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param) { struct sbuf_setup_param ssp; @@ -652,13 +651,6 @@ int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param) return sbuf_share_setup(ssp.pcpu_id, ssp.sbuf_id, hva); } -#else /* HV_DEBUG */ -int64_t hcall_setup_sbuf(__unused struct vm *vm, - __unused uint64_t param) -{ - return -1; -} -#endif /* HV_DEBUG */ static void fire_vhm_interrupt(void) { @@ -678,7 +670,6 @@ static void fire_vhm_interrupt(void) vlapic_intr_edge(vcpu, VECTOR_VIRT_IRQ_VHM); } -#ifdef HV_DEBUG static void acrn_print_request(int vcpu_id, struct vhm_request *req) { switch (req->type) { @@ -708,12 +699,6 @@ static void acrn_print_request(int vcpu_id, struct vhm_request *req) break; } } -#else -static void acrn_print_request(__unused int vcpu_id, - __unused struct vhm_request *req) -{ -} -#endif int acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req) { diff --git a/include/debug/sbuf.h b/include/debug/sbuf.h index 45f7ac097..80e49cc4d 100644 --- a/include/debug/sbuf.h +++ b/include/debug/sbuf.h @@ -150,6 +150,13 @@ static inline int sbuf_put( return 0; } +static inline int sbuf_share_setup( + __unused uint32_t pcpu_id, + __unused uint32_t sbuf_id, + __unused uint64_t *hva) +{ + return -1; +} #endif /* HV_DEBUG */ #endif /* SHARED_BUFFER_H */