diff --git a/hypervisor/arch/x86/guest/instr_emul.c b/hypervisor/arch/x86/guest/instr_emul.c index 072ae80e8..2a73ae08f 100644 --- a/hypervisor/arch/x86/guest/instr_emul.c +++ b/hypervisor/arch/x86/guest/instr_emul.c @@ -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) diff --git a/hypervisor/arch/x86/guest/vlapic.c b/hypervisor/arch/x86/guest/vlapic.c index 9da2fcc8e..c934bc15e 100644 --- a/hypervisor/arch/x86/guest/vlapic.c +++ b/hypervisor/arch/x86/guest/vlapic.c @@ -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; } diff --git a/hypervisor/arch/x86/ioapic.c b/hypervisor/arch/x86/ioapic.c index 9cd1caf7a..cde81b7bd 100644 --- a/hypervisor/arch/x86/ioapic.c +++ b/hypervisor/arch/x86/ioapic.c @@ -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); } diff --git a/hypervisor/include/arch/x86/guest/guest.h b/hypervisor/include/arch/x86/guest/guest.h index 314efdfa5..9ea1430c0 100644 --- a/hypervisor/include/arch/x86/guest/guest.h +++ b/hypervisor/include/arch/x86/guest/guest.h @@ -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); diff --git a/hypervisor/include/arch/x86/timer.h b/hypervisor/include/arch/x86/timer.h index 9e3733a8b..e2688c793 100644 --- a/hypervisor/include/arch/x86/timer.h +++ b/hypervisor/include/arch/x86/timer.h @@ -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 */ diff --git a/hypervisor/include/arch/x86/vmexit.h b/hypervisor/include/arch/x86/vmexit.h index 3ae3873a4..48baf7a8a 100644 --- a/hypervisor/include/arch/x86/vmexit.h +++ b/hypervisor/include/arch/x86/vmexit.h @@ -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) { diff --git a/hypervisor/include/debug/npk_log.h b/hypervisor/include/debug/npk_log.h index 80e693795..09e2cab05 100644 --- a/hypervisor/include/debug/npk_log.h +++ b/hypervisor/include/debug/npk_log.h @@ -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;