diff --git a/hypervisor/common/io_request.c b/hypervisor/common/io_request.c index 970bc2dbb..4b9eaeb0c 100644 --- a/hypervisor/common/io_request.c +++ b/hypervisor/common/io_request.c @@ -100,105 +100,3 @@ acrn_insert_request_wait(struct vcpu *vcpu, struct io_request *io_req) return 0; } - -#ifdef HV_DEBUG -static void local_get_req_info_(struct vhm_request *req, int *id, char *type, - char *state, char *dir, uint64_t *addr, uint64_t *val) -{ - (void)strcpy_s(dir, 16U, "NONE"); - *addr = 0UL; - *val = 0UL; - *id = req->client; - - switch (req->type) { - case REQ_PORTIO: - (void)strcpy_s(type, 16U, "PORTIO"); - if (req->reqs.pio.direction == REQUEST_READ) { - (void)strcpy_s(dir, 16U, "READ"); - } else { - (void)strcpy_s(dir, 16U, "WRITE"); - } - *addr = req->reqs.pio.address; - *val = req->reqs.pio.value; - break; - case REQ_MMIO: - case REQ_WP: - (void)strcpy_s(type, 16U, "MMIO/WP"); - if (req->reqs.mmio.direction == REQUEST_READ) { - (void)strcpy_s(dir, 16U, "READ"); - } else { - (void)strcpy_s(dir, 16U, "WRITE"); - } - *addr = req->reqs.mmio.address; - *val = req->reqs.mmio.value; - break; - break; - default: - (void)strcpy_s(type, 16U, "UNKNOWN"); - } - - switch (req->processed) { - case REQ_STATE_COMPLETE: - (void)strcpy_s(state, 16U, "COMPLETE"); - break; - case REQ_STATE_PENDING: - (void)strcpy_s(state, 16U, "PENDING"); - break; - case REQ_STATE_PROCESSING: - (void)strcpy_s(state, 16U, "PROCESS"); - break; - case REQ_STATE_FREE: - (void)strcpy_s(state, 16U, "FREE"); - break; - default: - (void)strcpy_s(state, 16U, "UNKNOWN"); - } -} - -void get_req_info(char *str_arg, int str_max) -{ - char *str = str_arg; - uint32_t i; - int32_t len, size = str_max, client_id; - union vhm_request_buffer *req_buf; - struct vhm_request *req; - char type[16], state[16], dir[16]; - uint64_t addr, val; - struct list_head *pos; - struct vm *vm; - - len = snprintf(str, size, - "\r\nVM\tVCPU\tCID\tTYPE\tSTATE\tDIR\tADDR\t\t\tVAL"); - size -= len; - str += len; - - spinlock_obtain(&vm_list_lock); - list_for_each(pos, &vm_list) { - vm = list_entry(pos, struct vm, list); - req_buf = (union vhm_request_buffer *)vm->sw.io_shared_page; - if (req_buf != NULL) { - for (i = 0U; i < VHM_REQUEST_MAX; i++) { - req = req_buf->req_queue + i; - if (req->valid != 0) { - local_get_req_info_(req, &client_id, type, - state, dir, &addr, &val); - len = snprintf(str, size, - "\r\n%d\t%d\t%d\t%s\t%s\t%s", - vm->vm_id, i, client_id, type, - state, dir); - size -= len; - str += len; - - len = snprintf(str, size, - "\t0x%016llx\t0x%016llx", - addr, val); - size -= len; - str += len; - } - } - } - } - spinlock_release(&vm_list_lock); - snprintf(str, size, "\r\n"); -} -#endif /* HV_DEBUG */ diff --git a/hypervisor/include/arch/x86/guest/guest.h b/hypervisor/include/arch/x86/guest/guest.h index 1c53d9f1f..f2d41f4bc 100644 --- a/hypervisor/include/arch/x86/guest/guest.h +++ b/hypervisor/include/arch/x86/guest/guest.h @@ -142,10 +142,6 @@ int copy_to_gva(struct vcpu *vcpu, void *h_ptr, uint64_t gva, uint64_t create_guest_init_gdt(struct vm *vm, uint32_t *limit); extern uint8_t vm0_boot_context; -#ifdef HV_DEBUG -void get_req_info(char *str_arg, int str_max); -#endif /* HV_DEBUG */ - #endif /* !ASSEMBLER */ #endif /* GUEST_H*/