mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-12-08 21:22:43 +00:00
Rename get_sos_wakeup_reason to get_service_vm_wakeup_reason in acrn manager. rename set_sos_timer to set_service_vm_timer. rename sos_pci_devs to service_vm_pci_devs. rename gen_sos_vm to gen_service_vm. rename sos_used_bdf to service_vm_used_bdf. rename is-sos-vm to is-service-vm. rename sos_mmio_range to service_vm_mmio_range. rename sos_guest_flags to service_vm_guest_flags. rename get_sos_vmid to get_service_vmid. rename sos_cpu_affinity to service_vm_cpu_affinity. rename allocation_sos_vm_node to allocation_service_vm_node. rename cpus_for_sos to cpus_for_service_vm. rename sos_vm_cpus to service_vm_cpus. rename get_sos_vuart_settings to get_service_vm_vuart_settings. rename sos_extend_all_cpus to service_vm_extend_all_cpus. rename sos_vm_id to servier_vm_id. rename sos_vm_index to service_vm_index. rename sos_vm_num to service_vm_num. re-generate the board and scenario code by the new python and xml. delete tdf8532 kernel module in python and shell script. Tracked-On: #6744 Signed-off-by: Liu Long <long.liu@linux.intel.com>
37 lines
1.7 KiB
Python
37 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
#
|
|
# Copyright (C) 2021 Intel Corporation. All rights reserved.
|
|
#
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
#
|
|
|
|
import sys, os
|
|
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
|
|
import common, board_cfg_lib
|
|
|
|
def service_vm_cpu_affinity(etree):
|
|
if common.get_node("//vm[vm_type = 'SERVICE_VM']", etree) is None:
|
|
return None
|
|
|
|
if common.get_node("//vm[vm_type = 'SERVICE_VM' and count(cpu_affinity)]", etree) is not None:
|
|
return None
|
|
|
|
service_vm_extend_all_cpus = board_cfg_lib.get_processor_info()
|
|
pre_all_cpus = etree.xpath("//vm[vm_type = 'PRE_RT_VM' or vm_type = 'PRE_STD_VM' or vm_type = 'SAFETY_VM']/cpu_affinity/pcpu_id/text()")
|
|
|
|
cpus_for_service_vm = list(set(service_vm_extend_all_cpus) - set(pre_all_cpus))
|
|
return sorted(cpus_for_service_vm)
|
|
|
|
def fn(board_etree, scenario_etree, allocation_etree):
|
|
cpus_for_service_vm = service_vm_cpu_affinity(scenario_etree)
|
|
if cpus_for_service_vm:
|
|
if common.get_node("//vm[vm_type = 'SERVICE_VM']", scenario_etree) is not None:
|
|
vm_id = common.get_node("//vm[vm_type = 'SERVICE_VM']/@id", scenario_etree)
|
|
allocation_service_vm_node = common.get_node(f"/acrn-config/vm[@id='{vm_id}']", allocation_etree)
|
|
if allocation_service_vm_node is None:
|
|
allocation_service_vm_node = common.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id)
|
|
if common.get_node("./vm_type", allocation_service_vm_node) is None:
|
|
common.append_node("./vm_type", "SERVICE_VM", allocation_service_vm_node)
|
|
for pcpu_id in cpus_for_service_vm:
|
|
common.append_node("./cpu_affinity/pcpu_id", str(pcpu_id), allocation_service_vm_node)
|