HV:fix type related violations

1.Function return type inconsistent
2.cast on a constant value

V1->V2 add () to return type
V2->V3 keep the sbuf_get and sbuf_put return code

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Huihuang Shi 2018-10-09 15:21:06 +08:00 committed by wenlingz
parent 723c22fc7f
commit c5f4c5109c
7 changed files with 14 additions and 16 deletions

View File

@ -2338,7 +2338,7 @@ int decode_instruction(struct vcpu *vcpu)
instr_check_gva(vcpu, emul_ctxt, cpu_mode);
}
return emul_ctxt->vie.opsize;
return (int)(emul_ctxt->vie.opsize);
}
int emulate_instruction(struct vcpu *vcpu)

View File

@ -289,7 +289,7 @@ static void vlapic_reset_timer(struct acrn_vlapic *vlapic)
timer = &vlapic->vtimer.timer;
del_timer(timer);
timer->mode = 0;
timer->mode = TICK_MODE_ONESHOT;
timer->fire_tsc = 0UL;
timer->period_in_cycle = 0UL;
}

View File

@ -98,9 +98,9 @@ ioapic_read_reg32(const void *ioapic_base, const uint32_t offset)
spinlock_irqsave_obtain(&ioapic_lock, &rflags);
/* Write IOREGSEL */
mmio_write32(offset, (void *)ioapic_base + IOAPIC_REGSEL);
mmio_write32(offset, ioapic_base + IOAPIC_REGSEL);
/* Read IOWIN */
v = mmio_read32((void *)ioapic_base + IOAPIC_WINDOW);
v = mmio_read32(ioapic_base + IOAPIC_WINDOW);
spinlock_irqrestore_release(&ioapic_lock, rflags);
return v;
@ -115,9 +115,9 @@ ioapic_write_reg32(const void *ioapic_base,
spinlock_irqsave_obtain(&ioapic_lock, &rflags);
/* Write IOREGSEL */
mmio_write32(offset, (void *)ioapic_base + IOAPIC_REGSEL);
mmio_write32(offset, ioapic_base + IOAPIC_REGSEL);
/* Write IOWIN */
mmio_write32(value, (void *)ioapic_base + IOAPIC_WINDOW);
mmio_write32(value, ioapic_base + IOAPIC_WINDOW);
spinlock_irqrestore_release(&ioapic_lock, rflags);
}

View File

@ -132,7 +132,6 @@ int rdmsr_vmexit_handler(struct vcpu *vcpu);
int wrmsr_vmexit_handler(struct vcpu *vcpu);
void init_msr_emulation(struct vcpu *vcpu);
extern const char vm_exit;
struct run_context;
int vmx_vmrun(struct run_context *context, int ops, int ibrs);

View File

@ -20,7 +20,7 @@ struct per_cpu_timers {
struct hv_timer {
struct list_head node; /* link all timers */
int mode; /* timer mode: one-shot or periodic */
enum tick_mode mode; /* timer mode: one-shot or periodic */
uint64_t fire_tsc; /* tsc deadline to interrupt */
uint64_t period_in_cycle; /* period of the periodic timer in unit of TSC cycles */
timer_handle_t func; /* callback if time reached */

View File

@ -16,7 +16,7 @@ int vmexit_handler(struct vcpu *vcpu);
int vmcall_vmexit_handler(struct vcpu *vcpu);
int cpuid_vmexit_handler(struct vcpu *vcpu);
int cr_access_vmexit_handler(struct vcpu *vcpu);
extern void vm_exit(void);
static inline uint64_t
vm_exit_qualification_bit_mask(uint64_t exit_qual, uint32_t msb, uint32_t lsb)
{

View File

@ -20,13 +20,12 @@ enum {
HV_NPK_LOG_CMD_QUERY,
};
enum {
HV_NPK_LOG_RES_INVALID,
HV_NPK_LOG_RES_OK,
HV_NPK_LOG_RES_KO,
HV_NPK_LOG_RES_ENABLED,
HV_NPK_LOG_RES_DISABLED,
};
#define HV_NPK_LOG_RES_INVALID 0x1U
#define HV_NPK_LOG_RES_OK 0x2U
#define HV_NPK_LOG_RES_KO 0x3U
#define HV_NPK_LOG_RES_ENABLED 0x4U
#define HV_NPK_LOG_RES_DISABLED 0x5U
struct hv_npk_log_param;