mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
hv: use int32_t replace int
Since it's typedef in "include/lib/types.h" Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -70,7 +70,8 @@
|
||||
#define LDTR_AR (0x0082U) /* LDT, type must be 2, refer to SDM Vol3 26.3.1.2 */
|
||||
#define TR_AR (0x008bU) /* TSS (busy), refer to SDM Vol3 26.3.1.2 */
|
||||
|
||||
int prepare_vm0_memmap(struct acrn_vm *vm);
|
||||
int32_t prepare_vm0_memmap(struct acrn_vm *vm);
|
||||
|
||||
/* Definition for a mem map lookup */
|
||||
struct vm_lu_mem_map {
|
||||
struct list_head list; /* EPT mem map lookup list*/
|
||||
@@ -93,22 +94,22 @@ enum vm_paging_mode {
|
||||
*/
|
||||
uint64_t vcpumask2pcpumask(struct acrn_vm *vm, uint64_t vdmask);
|
||||
|
||||
int gva2gpa(struct acrn_vcpu *vcpu, uint64_t gva, uint64_t *gpa, uint32_t *err_code);
|
||||
int32_t gva2gpa(struct acrn_vcpu *vcpu, uint64_t gva, uint64_t *gpa, uint32_t *err_code);
|
||||
|
||||
enum vm_paging_mode get_vcpu_paging_mode(struct acrn_vcpu *vcpu);
|
||||
|
||||
int rdmsr_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int wrmsr_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t rdmsr_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t wrmsr_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
void init_msr_emulation(struct acrn_vcpu *vcpu);
|
||||
|
||||
uint32_t vmsr_get_guest_msr_index(uint32_t msr);
|
||||
|
||||
struct run_context;
|
||||
int vmx_vmrun(struct run_context *context, int ops, int ibrs);
|
||||
int32_t vmx_vmrun(struct run_context *context, int32_t ops, int32_t ibrs);
|
||||
|
||||
int general_sw_loader(struct acrn_vm *vm);
|
||||
int32_t general_sw_loader(struct acrn_vm *vm);
|
||||
|
||||
typedef int (*vm_sw_loader_t)(struct acrn_vm *vm);
|
||||
typedef int32_t (*vm_sw_loader_t)(struct acrn_vm *vm);
|
||||
extern vm_sw_loader_t vm_sw_loader;
|
||||
/**
|
||||
* @brief Data transfering between hypervisor and VM
|
||||
@@ -134,7 +135,7 @@ extern vm_sw_loader_t vm_sw_loader;
|
||||
* continuous
|
||||
* @pre Pointer vm is non-NULL
|
||||
*/
|
||||
int copy_from_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
int32_t copy_from_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
/**
|
||||
* @brief Copy data from HV address space to VM GPA space
|
||||
*
|
||||
@@ -153,7 +154,7 @@ int copy_from_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
* continuous
|
||||
* @pre Pointer vm is non-NULL
|
||||
*/
|
||||
int copy_to_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
int32_t copy_to_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
/**
|
||||
* @brief Copy data from VM GVA space to HV address space
|
||||
*
|
||||
@@ -167,7 +168,7 @@ int copy_to_gpa(struct acrn_vm *vm, void *h_ptr, uint64_t gpa, uint32_t size);
|
||||
* @param[out] err_code The page fault flags
|
||||
* @param[out] fault_addr The GVA address that causes a page fault
|
||||
*/
|
||||
int copy_from_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
int32_t copy_from_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
uint32_t size, uint32_t *err_code, uint64_t *fault_addr);
|
||||
/**
|
||||
* @brief Copy data from HV address space to VM GVA space
|
||||
@@ -182,7 +183,7 @@ int copy_from_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
* @param[out] err_code The page fault flags
|
||||
* @param[out] fault_addr The GVA address that causes a page fault
|
||||
*/
|
||||
int copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
int32_t copy_to_gva(struct acrn_vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
uint32_t size, uint32_t *err_code, uint64_t *fault_addr);
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#define GUEST_PM_H
|
||||
|
||||
void vm_setup_cpu_state(struct acrn_vm *vm);
|
||||
int vm_load_pm_s_state(struct acrn_vm *vm);
|
||||
int validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl);
|
||||
int32_t vm_load_pm_s_state(struct acrn_vm *vm);
|
||||
int32_t validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl);
|
||||
void register_pm1ab_handler(struct acrn_vm *vm);
|
||||
|
||||
#endif /* PM_H */
|
||||
|
||||
@@ -26,6 +26,6 @@ struct mptable_info;
|
||||
extern struct mptable_info mptable_vm1;
|
||||
extern struct mptable_info mptable_vm2;
|
||||
|
||||
int mptable_build(struct acrn_vm *vm);
|
||||
int32_t mptable_build(struct acrn_vm *vm);
|
||||
|
||||
#endif /* MPTABLE_H */
|
||||
|
||||
@@ -204,7 +204,7 @@ struct acrn_vcpu_arch {
|
||||
uint8_t vmcs[PAGE_SIZE];
|
||||
/* per vcpu lapic */
|
||||
struct acrn_vlapic vlapic;
|
||||
int cur_context;
|
||||
int32_t cur_context;
|
||||
struct cpu_context contexts[NR_WORLD];
|
||||
|
||||
/* common MSRs, world_msrs[] is a subset of it */
|
||||
@@ -551,7 +551,7 @@ struct acrn_vcpu* get_ever_run_vcpu(uint16_t pcpu_id);
|
||||
*
|
||||
* @retval 0 vcpu created successfully, other values failed.
|
||||
*/
|
||||
int create_vcpu(uint16_t pcpu_id, struct acrn_vm *vm, struct acrn_vcpu **rtn_vcpu_handle);
|
||||
int32_t create_vcpu(uint16_t pcpu_id, struct acrn_vm *vm, struct acrn_vcpu **rtn_vcpu_handle);
|
||||
|
||||
/**
|
||||
* @brief run into non-root mode based on vcpu setting
|
||||
@@ -564,9 +564,9 @@ int create_vcpu(uint16_t pcpu_id, struct acrn_vm *vm, struct acrn_vcpu **rtn_vcp
|
||||
*
|
||||
* @retval 0 vcpu run successfully, other values failed.
|
||||
*/
|
||||
int run_vcpu(struct acrn_vcpu *vcpu);
|
||||
int32_t run_vcpu(struct acrn_vcpu *vcpu);
|
||||
|
||||
int shutdown_vcpu(struct acrn_vcpu *vcpu);
|
||||
int32_t shutdown_vcpu(struct acrn_vcpu *vcpu);
|
||||
|
||||
/**
|
||||
* @brief unmap the vcpu with pcpu and free its vlapic
|
||||
@@ -623,7 +623,7 @@ void schedule_vcpu(struct acrn_vcpu *vcpu);
|
||||
* @param[inout] vm pointer to vm data structure
|
||||
* @param[in] pcpu_id which the vcpu will be mapped
|
||||
*/
|
||||
int prepare_vcpu(struct acrn_vm *vm, uint16_t pcpu_id);
|
||||
int32_t prepare_vcpu(struct acrn_vm *vm, uint16_t pcpu_id);
|
||||
|
||||
void request_vcpu_pre_work(struct acrn_vcpu *vcpu, uint16_t pre_work_id);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ void vioapic_update_tmr(struct acrn_vcpu *vcpu);
|
||||
uint32_t vioapic_pincount(const struct acrn_vm *vm);
|
||||
void vioapic_process_eoi(struct acrn_vm *vm, uint32_t vector);
|
||||
void vioapic_get_rte(struct acrn_vm *vm, uint32_t pin, union ioapic_rte *rte);
|
||||
int vioapic_mmio_access_handler(struct io_request *io_req, void *handler_private_data);
|
||||
int32_t vioapic_mmio_access_handler(struct io_request *io_req, void *handler_private_data);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -75,7 +75,7 @@ struct acrn_vlapic {
|
||||
struct acrn_vcpu *vcpu;
|
||||
|
||||
uint32_t esr_pending;
|
||||
int esr_firing;
|
||||
int32_t esr_firing;
|
||||
|
||||
struct vlapic_timer vtimer;
|
||||
|
||||
@@ -134,7 +134,7 @@ uint64_t vlapic_get_cr8(const struct acrn_vlapic *vlapic);
|
||||
* @remark The vector does not automatically transition to the ISR as a
|
||||
* result of calling this function.
|
||||
*/
|
||||
int vlapic_pending_intr(const struct acrn_vlapic *vlapic, uint32_t *vecptr);
|
||||
int32_t vlapic_pending_intr(const struct acrn_vlapic *vlapic, uint32_t *vecptr);
|
||||
|
||||
/**
|
||||
* @brief Accept virtual interrupt.
|
||||
@@ -181,8 +181,8 @@ void vlapic_post_intr(uint16_t dest_pcpu_id);
|
||||
*/
|
||||
uint64_t apicv_get_pir_desc_paddr(struct acrn_vcpu *vcpu);
|
||||
|
||||
int vlapic_rdmsr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t *rval);
|
||||
int vlapic_wrmsr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t wval);
|
||||
int32_t vlapic_rdmsr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t *rval);
|
||||
int32_t vlapic_wrmsr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t wval);
|
||||
|
||||
/*
|
||||
* Signals to the LAPIC that an interrupt at 'vector' needs to be generated
|
||||
@@ -265,7 +265,7 @@ void vlapic_set_tmr_one_vec(struct acrn_vlapic *vlapic, uint32_t delmode,
|
||||
|
||||
void vlapic_apicv_batch_set_tmr(struct acrn_vlapic *vlapic);
|
||||
uint32_t vlapic_get_apicid(struct acrn_vlapic *vlapic);
|
||||
int vlapic_create(struct acrn_vcpu *vcpu);
|
||||
int32_t vlapic_create(struct acrn_vcpu *vcpu);
|
||||
/*
|
||||
* @pre vcpu != NULL
|
||||
*/
|
||||
@@ -277,10 +277,10 @@ bool vlapic_enabled(const struct acrn_vlapic *vlapic);
|
||||
uint64_t vlapic_apicv_get_apic_access_addr(void);
|
||||
uint64_t vlapic_apicv_get_apic_page_addr(struct acrn_vlapic *vlapic);
|
||||
void vlapic_apicv_inject_pir(struct acrn_vlapic *vlapic);
|
||||
int apic_access_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int apic_write_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int veoi_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int tpr_below_threshold_vmexit_handler(__unused struct acrn_vcpu *vcpu);
|
||||
int32_t apic_access_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t apic_write_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t veoi_vmexit_handler(struct acrn_vcpu *vcpu);
|
||||
int32_t tpr_below_threshold_vmexit_handler(__unused struct acrn_vcpu *vcpu);
|
||||
void calcvdest(struct acrn_vm *vm, uint64_t *dmask, uint32_t dest, bool phys);
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ struct sw_kernel_info {
|
||||
};
|
||||
|
||||
struct vm_sw_info {
|
||||
int kernel_type; /* Guest kernel type */
|
||||
int32_t kernel_type; /* Guest kernel type */
|
||||
/* Kernel information (common for all guest types) */
|
||||
struct sw_kernel_info kernel_info;
|
||||
/* Additional information specific to Linux guests */
|
||||
@@ -164,7 +164,7 @@ struct acrn_vm {
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
struct vpci_vdev_array {
|
||||
int num_pci_vdev;
|
||||
int32_t num_pci_vdev;
|
||||
struct pci_vdev vpci_vdev_list[];
|
||||
};
|
||||
#endif
|
||||
@@ -257,14 +257,14 @@ vm_ioapic(struct acrn_vm *vm)
|
||||
return (struct acrn_vioapic *)&(vm->arch_vm.vioapic);
|
||||
}
|
||||
|
||||
int shutdown_vm(struct acrn_vm *vm);
|
||||
int32_t shutdown_vm(struct acrn_vm *vm);
|
||||
void pause_vm(struct acrn_vm *vm);
|
||||
void resume_vm(struct acrn_vm *vm);
|
||||
void resume_vm_from_s3(struct acrn_vm *vm, uint32_t wakeup_vec);
|
||||
int start_vm(struct acrn_vm *vm);
|
||||
int reset_vm(struct acrn_vm *vm);
|
||||
int create_vm(struct vm_description *vm_desc, struct acrn_vm **rtn_vm);
|
||||
int prepare_vm(uint16_t pcpu_id);
|
||||
int32_t start_vm(struct acrn_vm *vm);
|
||||
int32_t reset_vm(struct acrn_vm *vm);
|
||||
int32_t create_vm(struct vm_description *vm_desc, struct acrn_vm **rtn_vm);
|
||||
int32_t prepare_vm(uint16_t pcpu_id);
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
const struct vm_description_array *get_vm_desc_base(void);
|
||||
@@ -274,7 +274,7 @@ struct acrn_vm *get_vm_from_vmid(uint16_t vm_id);
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
struct vm_description_array {
|
||||
int num_vm_desc;
|
||||
int32_t num_vm_desc;
|
||||
struct vm_description vm_desc_array[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user