mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-09 03:58:34 +00:00
hv: prepare for Sx(S3/S5) support in ACRN.
Couple of small changes merged in this change: - export main_entry, trampoline_spinlock and stop_cpus. - change vm_resume() name to resume_vm() - change resume_console_enable() name to resume_console() - extend reset_vcpu to reset more fields of vcpu Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
c2be7fdedb
commit
a2550b5d91
@ -278,6 +278,13 @@ void reset_vcpu(struct vcpu *vcpu)
|
|||||||
vcpu->ioreq_pending = 0;
|
vcpu->ioreq_pending = 0;
|
||||||
vcpu->arch_vcpu.nr_sipi = 0;
|
vcpu->arch_vcpu.nr_sipi = 0;
|
||||||
vcpu->pending_pre_work = 0;
|
vcpu->pending_pre_work = 0;
|
||||||
|
|
||||||
|
vcpu->arch_vcpu.exception_info.exception = VECTOR_INVALID;
|
||||||
|
vcpu->arch_vcpu.cur_context = NORMAL_WORLD;
|
||||||
|
vcpu->arch_vcpu.irq_window_enabled = 0;
|
||||||
|
vcpu->arch_vcpu.inject_event_pending = false;
|
||||||
|
memset(vcpu->arch_vcpu.vmcs, 0, CPU_PAGE_SIZE);
|
||||||
|
|
||||||
vlapic = vcpu->arch_vcpu.vlapic;
|
vlapic = vcpu->arch_vcpu.vlapic;
|
||||||
vlapic_reset(vlapic);
|
vlapic_reset(vlapic);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ void pause_vm(struct vm *vm)
|
|||||||
pause_vcpu(vcpu, VCPU_ZOMBIE);
|
pause_vcpu(vcpu, VCPU_ZOMBIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vm_resume(struct vm *vm)
|
void resume_vm(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct vcpu *vcpu = NULL;
|
struct vcpu *vcpu = NULL;
|
||||||
@ -283,8 +283,6 @@ int vm_resume(struct vm *vm)
|
|||||||
resume_vcpu(vcpu);
|
resume_vcpu(vcpu);
|
||||||
|
|
||||||
vm->state = VM_STARTED;
|
vm->state = VM_STARTED;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create vm/vcpu for vm0 */
|
/* Create vm/vcpu for vm0 */
|
||||||
|
@ -174,8 +174,12 @@ extern uint8_t trampoline_pdpt_addr[];
|
|||||||
extern uint8_t trampoline_gdt_ptr[];
|
extern uint8_t trampoline_gdt_ptr[];
|
||||||
extern uint8_t trampoline_start64_fixup[];
|
extern uint8_t trampoline_start64_fixup[];
|
||||||
|
|
||||||
|
/* In trampoline range, hold the jump target which trampline will jump to */
|
||||||
|
extern uint64_t main_entry[1];
|
||||||
|
|
||||||
extern uint64_t trampoline_start16_paddr;
|
extern uint64_t trampoline_start16_paddr;
|
||||||
extern int ibrs_type;
|
extern int ibrs_type;
|
||||||
|
extern spinlock_t trampoline_spinlock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To support per_cpu access, we use a special struct "per_cpu_region" to hold
|
* To support per_cpu access, we use a special struct "per_cpu_region" to hold
|
||||||
@ -260,6 +264,7 @@ bool is_vapic_virt_reg_supported(void);
|
|||||||
bool cpu_has_cap(uint32_t bit);
|
bool cpu_has_cap(uint32_t bit);
|
||||||
void load_cpu_state_data(void);
|
void load_cpu_state_data(void);
|
||||||
void start_cpus();
|
void start_cpus();
|
||||||
|
void stop_cpus();
|
||||||
|
|
||||||
/* Read control register */
|
/* Read control register */
|
||||||
#define CPU_CR_READ(cr, result_ptr) \
|
#define CPU_CR_READ(cr, result_ptr) \
|
||||||
|
@ -171,6 +171,7 @@ struct vm_description {
|
|||||||
|
|
||||||
int shutdown_vm(struct vm *vm);
|
int shutdown_vm(struct vm *vm);
|
||||||
void pause_vm(struct vm *vm);
|
void pause_vm(struct vm *vm);
|
||||||
|
void resume_vm(struct vm *vm);
|
||||||
int start_vm(struct vm *vm);
|
int start_vm(struct vm *vm);
|
||||||
int create_vm(struct vm_description *vm_desc, struct vm **vm);
|
int create_vm(struct vm_description *vm_desc, struct vm **vm);
|
||||||
int prepare_vm0(void);
|
int prepare_vm0(void);
|
||||||
|
@ -70,7 +70,7 @@ static inline void suspend_console(void)
|
|||||||
del_timer(&console_timer);
|
del_timer(&console_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void resume_console_enable(void)
|
static inline void resume_console(void)
|
||||||
{
|
{
|
||||||
console_setup_timer();
|
console_setup_timer();
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ static inline void console_setup_timer(void) {}
|
|||||||
static inline uint32_t get_serial_handle(void) { return 0; }
|
static inline uint32_t get_serial_handle(void) { return 0; }
|
||||||
|
|
||||||
static inline void suspend_console(void) {}
|
static inline void suspend_console(void) {}
|
||||||
static inline void resume_console_enable(void) {}
|
static inline void resume_console(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONSOLE_H */
|
#endif /* CONSOLE_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user