mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 04:02:05 +00:00
HV:modified vm_description and vm_hw_info memebers' type
transfer num_vcpus,exp_num_vcpus to uint16_t. transfer vm_hw_num_cores to uint16_t. Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
39159ebe16
commit
0ccd74b947
@ -469,7 +469,7 @@ int ept_mmap(struct vm *vm, uint64_t hpa,
|
|||||||
uint64_t gpa, uint64_t size, uint32_t type, uint32_t prot)
|
uint64_t gpa, uint64_t size, uint32_t type, uint32_t prot)
|
||||||
{
|
{
|
||||||
struct map_params map_params;
|
struct map_params map_params;
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
/* Setup memory map parameters */
|
/* Setup memory map parameters */
|
||||||
@ -516,7 +516,7 @@ int ept_update_mt(struct vm *vm, uint64_t hpa,
|
|||||||
{
|
{
|
||||||
struct map_params map_params;
|
struct map_params map_params;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
int i;
|
uint16_t i;
|
||||||
|
|
||||||
/* Setup memory map parameters */
|
/* Setup memory map parameters */
|
||||||
map_params.page_table_type = PTT_EPT;
|
map_params.page_table_type = PTT_EPT;
|
||||||
|
@ -36,7 +36,7 @@ is_vm0(struct vm *vm)
|
|||||||
|
|
||||||
inline struct vcpu *vcpu_from_vid(struct vm *vm, uint16_t vcpu_id)
|
inline struct vcpu *vcpu_from_vid(struct vm *vm, uint16_t vcpu_id)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
@ -49,7 +49,7 @@ inline struct vcpu *vcpu_from_vid(struct vm *vm, uint16_t vcpu_id)
|
|||||||
|
|
||||||
inline struct vcpu *vcpu_from_pid(struct vm *vm, uint16_t pcpu_id)
|
inline struct vcpu *vcpu_from_pid(struct vm *vm, uint16_t pcpu_id)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
@ -62,7 +62,7 @@ inline struct vcpu *vcpu_from_pid(struct vm *vm, uint16_t pcpu_id)
|
|||||||
|
|
||||||
inline struct vcpu *get_primary_vcpu(struct vm *vm)
|
inline struct vcpu *get_primary_vcpu(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
@ -91,7 +91,7 @@ inline uint64_t vcpumask2pcpumask(struct vm *vm, uint64_t vdmask)
|
|||||||
|
|
||||||
inline bool vm_lapic_disabled(struct vm *vm)
|
inline bool vm_lapic_disabled(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
|
@ -373,7 +373,7 @@ vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
|
|||||||
* to update their vlapic trigger-mode registers.
|
* to update their vlapic trigger-mode registers.
|
||||||
*/
|
*/
|
||||||
if ((changed & ~(IOAPIC_RTE_INTMASK | IOAPIC_RTE_INTPOL)) != 0U) {
|
if ((changed & ~(IOAPIC_RTE_INTMASK | IOAPIC_RTE_INTPOL)) != 0U) {
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
dev_dbg(ACRN_DBG_IOAPIC,
|
dev_dbg(ACRN_DBG_IOAPIC,
|
||||||
|
@ -121,7 +121,7 @@ vm_lapic_from_pcpuid(struct vm *vm, uint16_t pcpu_id)
|
|||||||
|
|
||||||
static uint16_t vm_apicid2vcpu_id(struct vm *vm, uint8_t lapicid)
|
static uint16_t vm_apicid2vcpu_id(struct vm *vm, uint8_t lapicid)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
@ -138,7 +138,7 @@ static uint64_t
|
|||||||
vm_active_cpus(struct vm *vm)
|
vm_active_cpus(struct vm *vm)
|
||||||
{
|
{
|
||||||
uint64_t dmask = 0;
|
uint64_t dmask = 0;
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
|
@ -87,7 +87,7 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
|
|||||||
/* Init mmio list */
|
/* Init mmio list */
|
||||||
INIT_LIST_HEAD(&vm->mmio_list);
|
INIT_LIST_HEAD(&vm->mmio_list);
|
||||||
|
|
||||||
if (vm->hw.num_vcpus == 0)
|
if (vm->hw.num_vcpus == 0U)
|
||||||
vm->hw.num_vcpus = phys_cpu_num;
|
vm->hw.num_vcpus = phys_cpu_num;
|
||||||
|
|
||||||
vm->hw.vcpu_array =
|
vm->hw.vcpu_array =
|
||||||
@ -185,7 +185,8 @@ err1:
|
|||||||
|
|
||||||
int shutdown_vm(struct vm *vm)
|
int shutdown_vm(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i, status = 0;
|
int status = 0;
|
||||||
|
uint16_t i;
|
||||||
struct vcpu *vcpu = NULL;
|
struct vcpu *vcpu = NULL;
|
||||||
|
|
||||||
if (vm == NULL)
|
if (vm == NULL)
|
||||||
@ -262,7 +263,7 @@ int start_vm(struct vm *vm)
|
|||||||
*/
|
*/
|
||||||
void pause_vm(struct vm *vm)
|
void pause_vm(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu = NULL;
|
struct vcpu *vcpu = NULL;
|
||||||
|
|
||||||
if (vm->state == VM_PAUSED)
|
if (vm->state == VM_PAUSED)
|
||||||
@ -276,7 +277,7 @@ void pause_vm(struct vm *vm)
|
|||||||
|
|
||||||
void resume_vm(struct vm *vm)
|
void resume_vm(struct vm *vm)
|
||||||
{
|
{
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu = NULL;
|
struct vcpu *vcpu = NULL;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu)
|
foreach_vcpu(i, vm, vcpu)
|
||||||
@ -361,7 +362,7 @@ void vm_fixup(struct vm *vm)
|
|||||||
if (is_vm0(vm) && (vm->hw.exp_num_vcpus < vm->hw.num_vcpus)) {
|
if (is_vm0(vm) && (vm->hw.exp_num_vcpus < vm->hw.num_vcpus)) {
|
||||||
struct vm_description *vm_desc = &vm0_desc;
|
struct vm_description *vm_desc = &vm0_desc;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
int i;
|
uint16_t i;
|
||||||
|
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
if (!vcpu_in_vm_desc(vcpu, vm_desc)) {
|
if (!vcpu_in_vm_desc(vcpu, vm_desc)) {
|
||||||
|
@ -84,7 +84,7 @@ static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig,
|
|||||||
IA32E_EPT_X_BIT);
|
IA32E_EPT_X_BIT);
|
||||||
void *sub_table_addr = NULL, *pml4_base = NULL;
|
void *sub_table_addr = NULL, *pml4_base = NULL;
|
||||||
struct vm *vm0 = get_vm_from_vmid(0);
|
struct vm *vm0 = get_vm_from_vmid(0);
|
||||||
int i;
|
uint16_t i;
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
|
||||||
if (vm0 == NULL) {
|
if (vm0 == NULL) {
|
||||||
|
@ -503,7 +503,7 @@ int shell_list_vcpu(struct shell *p_shell,
|
|||||||
spinlock_obtain(&vm_list_lock);
|
spinlock_obtain(&vm_list_lock);
|
||||||
list_for_each(pos, &vm_list) {
|
list_for_each(pos, &vm_list) {
|
||||||
char state[32];
|
char state[32];
|
||||||
int i;
|
uint16_t i;
|
||||||
|
|
||||||
vm = list_entry(pos, struct vm, list);
|
vm = list_entry(pos, struct vm, list);
|
||||||
foreach_vcpu(i, vm, vcpu) {
|
foreach_vcpu(i, vm, vcpu) {
|
||||||
|
@ -21,8 +21,8 @@ struct vm_attr {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct vm_hw_info {
|
struct vm_hw_info {
|
||||||
int num_vcpus; /* Number of total virtual cores */
|
uint16_t num_vcpus; /* Number of total virtual cores */
|
||||||
int exp_num_vcpus; /* Number of real expected virtual cores */
|
uint16_t exp_num_vcpus; /* Number of real expected virtual cores */
|
||||||
int created_vcpus; /* Number of created vcpus */
|
int created_vcpus; /* Number of created vcpus */
|
||||||
struct vcpu **vcpu_array; /* vcpu array of this VM */
|
struct vcpu **vcpu_array; /* vcpu array of this VM */
|
||||||
uint64_t gpa_lowtop; /* top lowmem gpa of this VM */
|
uint64_t gpa_lowtop; /* top lowmem gpa of this VM */
|
||||||
@ -163,7 +163,7 @@ struct vm_description {
|
|||||||
*/
|
*/
|
||||||
int *vm_hw_logical_core_ids;
|
int *vm_hw_logical_core_ids;
|
||||||
unsigned char GUID[16]; /* GUID of the vm will be created */
|
unsigned char GUID[16]; /* GUID of the vm will be created */
|
||||||
int vm_hw_num_cores; /* Number of virtual cores */
|
uint16_t vm_hw_num_cores; /* Number of virtual cores */
|
||||||
/* Whether secure world is enabled for current VM. */
|
/* Whether secure world is enabled for current VM. */
|
||||||
bool sworld_enabled;
|
bool sworld_enabled;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user