Skip to content

Commit 936c254

Browse files
lifeixjren1
authored andcommitted
Don't use HV_DEBUG outside debug directory
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
1 parent 3f83ea3 commit 936c254

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ static void set_fs_base(void)
254254

255255
void bsp_boot_init(void)
256256
{
257-
#ifdef HV_DEBUG
258257
uint64_t start_tsc = rdtsc();
259-
#endif
260258

261259
/* Clear BSS */
262260
memset(_ld_bss_start, 0, _ld_bss_end - _ld_bss_start);
@@ -346,8 +344,6 @@ void bsp_boot_init(void)
346344
init_logmsg(LOG_BUF_SIZE,
347345
LOG_DESTINATION);
348346

349-
#ifdef HV_DEBUG
350-
/* Log first messages */
351347
if (HV_RC_VERSION)
352348
printf("HV version %d.%d-rc%d-%s-%s build by %s, start time %lluus\r\n",
353349
HV_MAJOR_VERSION, HV_MINOR_VERSION, HV_RC_VERSION,
@@ -361,7 +357,7 @@ void bsp_boot_init(void)
361357

362358
printf("API version %d.%d\r\n",
363359
HV_API_MAJOR_VERSION, HV_API_MINOR_VERSION);
364-
#endif
360+
365361
pr_dbg("Core %d is up", CPU_BOOT_ID);
366362

367363
/* Warn for security feature not ready */

hypervisor/common/hypercall.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ hcall_reset_ptdev_intr_info(struct vm *vm, uint64_t vmid, uint64_t param)
632632
return ret;
633633
}
634634

635-
#ifdef HV_DEBUG
636635
int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param)
637636
{
638637
struct sbuf_setup_param ssp;
@@ -652,13 +651,6 @@ int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param)
652651

653652
return sbuf_share_setup(ssp.pcpu_id, ssp.sbuf_id, hva);
654653
}
655-
#else /* HV_DEBUG */
656-
int64_t hcall_setup_sbuf(__unused struct vm *vm,
657-
__unused uint64_t param)
658-
{
659-
return -1;
660-
}
661-
#endif /* HV_DEBUG */
662654

663655
static void fire_vhm_interrupt(void)
664656
{
@@ -678,7 +670,6 @@ static void fire_vhm_interrupt(void)
678670
vlapic_intr_edge(vcpu, VECTOR_VIRT_IRQ_VHM);
679671
}
680672

681-
#ifdef HV_DEBUG
682673
static void acrn_print_request(int vcpu_id, struct vhm_request *req)
683674
{
684675
switch (req->type) {
@@ -708,12 +699,6 @@ static void acrn_print_request(int vcpu_id, struct vhm_request *req)
708699
break;
709700
}
710701
}
711-
#else
712-
static void acrn_print_request(__unused int vcpu_id,
713-
__unused struct vhm_request *req)
714-
{
715-
}
716-
#endif
717702

718703
int acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req)
719704
{

hypervisor/include/debug/sbuf.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ static inline int sbuf_put(
150150
return 0;
151151
}
152152

153+
static inline int sbuf_share_setup(
154+
__unused uint32_t pcpu_id,
155+
__unused uint32_t sbuf_id,
156+
__unused uint64_t *hva)
157+
{
158+
return -1;
159+
}
153160
#endif /* HV_DEBUG */
154161

155162
#endif /* SHARED_BUFFER_H */

0 commit comments

Comments
 (0)