mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
dm: refine logic to build ACPI table of Post-launched VM
- GET_PLATFORM_INFO will not be supported in ACRN. - This patch removes the dependency on this interface to build virtual ACPI table of post-launched VM: Instead of calling 'vm_get_config()' to get local APIC IDs, virtual ACPI builder calls new wrapper API 'lapcid_from_pcpuid()'. Tracked-On: #6724 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
parent
146059c4d1
commit
f3e8d4e019
@ -276,30 +276,15 @@ static int
|
||||
basl_fwrite_madt(FILE *fp, struct vmctx *ctx)
|
||||
{
|
||||
int i;
|
||||
struct acrn_vm_config_header vm_cfg;
|
||||
struct acrn_platform_info plat_info;
|
||||
uint64_t dm_cpu_bitmask, hv_cpu_bitmask, guest_pcpu_bitmask;
|
||||
|
||||
if (vm_get_config(ctx, &vm_cfg, &plat_info)) {
|
||||
pr_err("%s, get VM configuration fail.\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
hv_cpu_bitmask = vm_cfg.cpu_affinity;
|
||||
dm_cpu_bitmask = vm_get_cpu_affinity_dm();
|
||||
if ((dm_cpu_bitmask != 0) && ((dm_cpu_bitmask & ~hv_cpu_bitmask) == 0)) {
|
||||
guest_pcpu_bitmask = dm_cpu_bitmask;
|
||||
} else {
|
||||
guest_pcpu_bitmask = hv_cpu_bitmask;
|
||||
}
|
||||
uint64_t guest_pcpu_bitmask;
|
||||
|
||||
guest_pcpu_bitmask = vm_get_cpu_affinity_dm();
|
||||
if (guest_pcpu_bitmask == 0) {
|
||||
pr_err("%s,Err: Invalid guest_pcpu_bitmask.\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pr_info("%s, dm_cpu_bitmask:0x%x, hv_cpu_bitmask:0x%x, guest_cpu_bitmask: 0x%x\n",
|
||||
__func__, dm_cpu_bitmask, hv_cpu_bitmask, guest_pcpu_bitmask);
|
||||
pr_info("%s, guest_cpu_bitmask: 0x%x\n", __func__, guest_pcpu_bitmask);
|
||||
|
||||
EFPRINTF(fp, "/*\n");
|
||||
EFPRINTF(fp, " * dm MADT template\n");
|
||||
|
Loading…
Reference in New Issue
Block a user