hv: vcpu: Move vcpu_set_state to common scope

Movement only.

Tracked-On: #8830
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This commit is contained in:
Yifan Liu
2025-10-30 07:44:31 +00:00
committed by acrnsi-robot
parent 223ccc5711
commit 70bcf024da
4 changed files with 23 additions and 23 deletions

View File

@@ -990,19 +990,6 @@ void vcpu_handle_pi_notification(uint32_t vcpu_index)
} }
} }
/*
* @brief Update the state of vCPU and state of vlapic
*
* The vlapic state of VM shall be updated for some vCPU
* state update cases, such as from VCPU_INIT to VCPU_RUNNING.
* @pre (vcpu != NULL)
*/
void vcpu_set_state(struct acrn_vcpu *vcpu, enum vcpu_state new_state)
{
vcpu->state = new_state;
}
/* TODO: Our goal is to have a vcpu_thread that is common. /* TODO: Our goal is to have a vcpu_thread that is common.
* Leave this to future optimization. * Leave this to future optimization.
*/ */

View File

@@ -33,6 +33,19 @@ static void init_vcpu_thread(struct acrn_vcpu *vcpu, uint16_t pcpu_id)
init_thread_data(&vcpu->thread_obj, &get_vm_config(vm->vm_id)->sched_params); init_thread_data(&vcpu->thread_obj, &get_vm_config(vm->vm_id)->sched_params);
} }
/*
* @brief Update the state of vCPU and state of vlapic
*
* The vlapic state of VM shall be updated for some vCPU
* state update cases, such as from VCPU_INIT to VCPU_RUNNING.
* @pre (vcpu != NULL)
*/
void vcpu_set_state(struct acrn_vcpu *vcpu, enum vcpu_state new_state)
{
vcpu->state = new_state;
}
/** /**
* @brief create a vcpu for the target vm * @brief create a vcpu for the target vm
* *

View File

@@ -649,16 +649,6 @@ bool is_lapic_pt_enabled(struct acrn_vcpu *vcpu);
*/ */
void vcpu_handle_pi_notification(uint32_t vcpu_index); void vcpu_handle_pi_notification(uint32_t vcpu_index);
/*
* @brief Update the state of vCPU and state of vlapic
*
* The vlapic state of VM shall be updated for some vCPU
* state update cases, such as from VCPU_INIT to VCPU_RUNNING.
* @pre (vcpu != NULL)
*/
void vcpu_set_state(struct acrn_vcpu *vcpu, enum vcpu_state new_state);
/** /**
* @} * @}
*/ */

View File

@@ -87,6 +87,16 @@ struct guest_mem_dump {
uint64_t len; uint64_t len;
}; };
/*
* @brief Update the state of vCPU and state of vlapic
*
* The vlapic state of VM shall be updated for some vCPU
* state update cases, such as from VCPU_INIT to VCPU_RUNNING.
* @pre (vcpu != NULL)
*/
void vcpu_set_state(struct acrn_vcpu *vcpu, enum vcpu_state new_state);
uint16_t pcpuid_from_vcpu(const struct acrn_vcpu *vcpu); uint16_t pcpuid_from_vcpu(const struct acrn_vcpu *vcpu);
int32_t arch_init_vcpu(struct acrn_vcpu *vcpu); int32_t arch_init_vcpu(struct acrn_vcpu *vcpu);