mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 23:13:26 +00:00
hv:Delete the dead code
Delete the dead code get_irq_info(), local_get_irq_info() in io_request.c and definition in guest.h. v1->v2 *the dead code used pointers which not checked before use, therefore it causes "pointer not checked for null before use". To make it clearly, modify the subject to "delete the dead code" directly. *remove dead code local_get_irq_info() in io_request.c and definition in guest.h together. Tracked-On: #861 Signed-off-by: Junjun Shan <junjun.shan@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
c307e1b6eb
commit
83d1ddc6d8
@ -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 */
|
||||
|
@ -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*/
|
||||
|
Loading…
Reference in New Issue
Block a user