mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-04 22:47:00 +00:00
config_tools: Use new HSM driver device node
Tracked-On: #6282 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
parent
b218544872
commit
1bccfab3b6
@ -5,7 +5,7 @@ After=weston.service
|
|||||||
After=systemd-resolved.service
|
After=systemd-resolved.service
|
||||||
|
|
||||||
ConditionPathExists=/sys/kernel/gvt
|
ConditionPathExists=/sys/kernel/gvt
|
||||||
ConditionPathExists=/dev/acrn_vhm
|
ConditionPathExists=/dev/acrn_hsm
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
@ -2,13 +2,6 @@
|
|||||||
# Copyright (C) 2019 Intel Corporation.
|
# Copyright (C) 2019 Intel Corporation.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
offline_path="/sys/class/vhm/acrn_vhm"
|
|
||||||
|
|
||||||
# Check the device file of /dev/acrn_hsm to determine the offline_path
|
|
||||||
if [ -e "/dev/acrn_hsm" ]; then
|
|
||||||
offline_path="/sys/class/acrn/acrn_hsm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
kernel_version=$(uname -r)
|
kernel_version=$(uname -r)
|
||||||
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
|
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
|
||||||
ipu_passthrough=0
|
ipu_passthrough=0
|
||||||
@ -572,7 +565,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > ${offline_path}/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -2,13 +2,6 @@
|
|||||||
# Copyright (C) 2019 Intel Corporation.
|
# Copyright (C) 2019 Intel Corporation.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
offline_path="/sys/class/vhm/acrn_vhm"
|
|
||||||
|
|
||||||
# Check the device file of /dev/acrn_hsm to determine the offline_path
|
|
||||||
if [ -e "/dev/acrn_hsm" ]; then
|
|
||||||
offline_path="/sys/class/acrn/acrn_hsm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
kernel_version=$(uname -r | awk -F. '{ printf("%d.%d", $1,$2) }')
|
kernel_version=$(uname -r | awk -F. '{ printf("%d.%d", $1,$2) }')
|
||||||
|
|
||||||
ipu_passthrough=0
|
ipu_passthrough=0
|
||||||
@ -459,7 +452,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > ${offline_path}/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo cpu$idx online=$online
|
echo cpu$idx online=$online
|
||||||
if [ "$online" = "1" ]; then
|
if [ "$online" = "1" ]; then
|
||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -2,14 +2,6 @@
|
|||||||
# Copyright (C) 2019 Intel Corporation.
|
# Copyright (C) 2019 Intel Corporation.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
offline_path="/sys/class/vhm/acrn_vhm"
|
|
||||||
|
|
||||||
# Check the device file of /dev/acrn_hsm to determine the offline_path
|
|
||||||
if [ -e "/dev/acrn_hsm" ]; then
|
|
||||||
offline_path="/sys/class/acrn/acrn_hsm"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
function run_container()
|
function run_container()
|
||||||
{
|
{
|
||||||
vm_name=vm1
|
vm_name=vm1
|
||||||
@ -134,7 +126,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > ${offline_path}/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo cpu$idx online=$online
|
echo cpu$idx online=$online
|
||||||
if [ "$online" = "1" ]; then
|
if [ "$online" = "1" ]; then
|
||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
|
|||||||
echo 0 > $i/online
|
echo 0 > $i/online
|
||||||
online=`cat $i/online`
|
online=`cat $i/online`
|
||||||
done
|
done
|
||||||
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
|
echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -89,14 +89,6 @@ def off_line_cpus(args, vmid, uos_type, config):
|
|||||||
key = "scenario config error"
|
key = "scenario config error"
|
||||||
launch_cfg_lib.ERR_LIST[key] = "No available cpu to offline and pass it to vm {}".format(vmid)
|
launch_cfg_lib.ERR_LIST[key] = "No available cpu to offline and pass it to vm {}".format(vmid)
|
||||||
|
|
||||||
print('offline_path="/sys/class/vhm/acrn_vhm"', file=config)
|
|
||||||
print("", file=config)
|
|
||||||
|
|
||||||
print("# Check the device file of /dev/acrn_hsm to determine the offline_path", file=config)
|
|
||||||
print('if [ -e "/dev/acrn_hsm" ]; then', file=config)
|
|
||||||
print('offline_path="/sys/class/acrn/acrn_hsm"', file=config)
|
|
||||||
print('fi', file=config)
|
|
||||||
print("", file=config)
|
|
||||||
print("# offline pinned vCPUs from SOS before launch UOS", file=config)
|
print("# offline pinned vCPUs from SOS before launch UOS", file=config)
|
||||||
print('cpu_path="/sys/devices/system/cpu"', file=config)
|
print('cpu_path="/sys/devices/system/cpu"', file=config)
|
||||||
print("for i in `ls ${cpu_path}`; do", file=config)
|
print("for i in `ls ${cpu_path}`; do", file=config)
|
||||||
@ -114,7 +106,7 @@ def off_line_cpus(args, vmid, uos_type, config):
|
|||||||
print(" echo 0 > ${cpu_path}/$i/online", file=config)
|
print(" echo 0 > ${cpu_path}/$i/online", file=config)
|
||||||
print(" online=`cat ${cpu_path}/$i/online`", file=config)
|
print(" online=`cat ${cpu_path}/$i/online`", file=config)
|
||||||
print(" done", file=config)
|
print(" done", file=config)
|
||||||
print(" echo $idx > ${offline_path}/offline_cpu", file=config)
|
print(" echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu", file=config)
|
||||||
print(" fi", file=config)
|
print(" fi", file=config)
|
||||||
print(" fi", file=config)
|
print(" fi", file=config)
|
||||||
print(" done", file=config)
|
print(" done", file=config)
|
||||||
|
@ -3,7 +3,7 @@ Description=ACRN manager deamon
|
|||||||
After=weston.service
|
After=weston.service
|
||||||
After=systemd-resolved.service
|
After=systemd-resolved.service
|
||||||
ConditionPathExists=/sys/kernel/gvt
|
ConditionPathExists=/sys/kernel/gvt
|
||||||
ConditionPathExists=/dev/acrn_vhm
|
ConditionPathExists=/dev/acrn_hsm
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
Loading…
Reference in New Issue
Block a user