launch_uos.sh: make sure cpu offline by retry

if acrnd or acrn_guest service enabled, launch_uos.sh will be called
early time during system boot up, while a pci driver module may be
insmod and disable cpu hotplug in short time, which could make
cpu offline fail, we need check it to make sure cpu offline real happen
before hypercall to disable vcpu.

Tracked-On: https://github.com/projectacrn/acrn-hypervisor/issues/1584
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ 2018-10-25 09:12:24 +08:00 committed by wenlingz
parent 241d5a684e
commit 19abb419c6
2 changed files with 13 additions and 0 deletions

View File

@ -407,6 +407,13 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
echo cpu$idx online=$online
if [ "$online" = "1" ]; then
echo 0 > $i/online
online=`cat $i/online`
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
while [ "$online" = "1" ]; do
sleep 1
echo 0 > $i/online
online=`cat $i/online`
done
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
fi
done

View File

@ -37,6 +37,12 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
echo cpu$idx online=$online
if [ "$online" = "1" ]; then
echo 0 > $i/online
# during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
while [ "$online" = "1" ]; do
sleep 1
echo 0 > $i/online
online=`cat $i/online`
done
echo $idx > /sys/class/vhm/acrn_vhm/offline_cpu
fi
done