mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv: add new hypercall to fetch platform configurations
add new hypercall get platform information, such as physical CPU number. Tracked-On: #2538 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
Eddie Dong
parent
e216f3060c
commit
46480f6e23
@@ -102,6 +102,33 @@ int32_t hcall_get_api_version(struct acrn_vm *vm, uint64_t param)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get basic platform information.
|
||||
*
|
||||
* The function returns basic hardware or configuration information
|
||||
* for the current platform.
|
||||
*
|
||||
* @param vm Pointer to VM data structure.
|
||||
* @param param GPA pointer to struct hc_platform_info.
|
||||
*
|
||||
* @pre Pointer vm shall point to SOS_VM
|
||||
* @return 0 on success, -1 in case of error.
|
||||
*/
|
||||
int32_t hcall_get_platform_info(struct acrn_vm *vm, uint64_t param)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
struct hc_platform_info platform_info;
|
||||
|
||||
platform_info.cpu_num = get_pcpu_nums();
|
||||
platform_info.max_vcpus_per_vm = CONFIG_MAX_VCPUS_PER_VM;
|
||||
if (copy_to_gpa(vm, &platform_info, param, sizeof(platform_info)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief create virtual machine
|
||||
*
|
||||
|
Reference in New Issue
Block a user