From 8578125fed9e3ca0e32aea8ba76689808ebe1ece Mon Sep 17 00:00:00 2001 From: Minggui Cao Date: Mon, 9 Sep 2019 12:02:32 +0800 Subject: [PATCH] DM: add power off by vuart setting to launch script 1. for post-launch general VM, like LaaG, the vUART is emulated in DM, so the power off control channel is: acrn-dm:pty[master <-> salve] <--> acrn-dm:vUART <--> UOS:vUART 2. for RTVM, like RT-Linux, the vUART is emulated in hypervisor layer, so the control channel is: acrn-dm <--> SOS:/dev/ttyS1 <--> Hypervisor <--> UOS:vUART. So the settings in launch script are different. Tracked-On: #3564 Signed-off-by: Minggui Cao Reviewed-by: Binbin Wu --- devicemodel/samples/nuc/launch_hard_rt_vm.sh | 6 ++++++ devicemodel/samples/nuc/launch_uos.sh | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/devicemodel/samples/nuc/launch_hard_rt_vm.sh b/devicemodel/samples/nuc/launch_hard_rt_vm.sh index 06bdb59d2..aab5e2cf5 100755 --- a/devicemodel/samples/nuc/launch_hard_rt_vm.sh +++ b/devicemodel/samples/nuc/launch_hard_rt_vm.sh @@ -30,6 +30,11 @@ echo ${passthru_vpid["sata"]} > /sys/bus/pci/drivers/pci-stub/new_id echo ${passthru_bdf["sata"]} > /sys/bus/pci/devices/${passthru_bdf["sata"]}/driver/unbind echo ${passthru_bdf["sata"]} > /sys/bus/pci/drivers/pci-stub/bind +# for pm setting +pm_channel="--pm_notify_channel uart " +pm_by_vuart="--pm_by_vuart tty,/dev/ttyS1" + + /usr/bin/acrn-dm -A -m $mem_size -c $1 -s 0:0,hostbridge \ -k /usr/lib/kernel/default-iot-lts2018-preempt-rt \ --lapic_pt \ @@ -37,6 +42,7 @@ echo ${passthru_bdf["sata"]} > /sys/bus/pci/drivers/pci-stub/bind --virtio_poll 1000000 \ -s 2,passthru,0/17/0 \ -s 3,virtio-console,@stdio:stdio_port \ + $pm_channel $pm_by_vuart \ -B "root=/dev/sda3 rw rootwait maxcpus=$1 nohpet console=hvc0 \ no_timer_check ignore_loglevel log_buf_len=16M \ consoleblank=0 tsc=reliable x2apic_phys" hard_rtvm diff --git a/devicemodel/samples/nuc/launch_uos.sh b/devicemodel/samples/nuc/launch_uos.sh index 648cdb359..475ec4f4e 100755 --- a/devicemodel/samples/nuc/launch_uos.sh +++ b/devicemodel/samples/nuc/launch_uos.sh @@ -92,6 +92,11 @@ fi #logger_setting, format: logger_name,level; like following logger_setting="--logger_setting console,level=4;kmsg,level=3;disk,level=5" +#for pm by vuart setting +pm_channel="--pm_notify_channel uart " +pm_by_vuart="--pm_by_vuart pty,/run/acrn/life_mngr_"$vm_name +pm_vuart_node=" -s 1:0,lpc -l com2,/run/acrn/life_mngr_"$vm_name + #for memsize setting mem_size=2048M @@ -103,7 +108,7 @@ acrn-dm -A -m $mem_size -c $2 -s 0:0,hostbridge \ -s 4,virtio-net,tap0 \ -s 7,virtio-rnd \ --ovmf ./OVMF.fd \ - --pm_notify_channel power_button \ + $pm_channel $pm_by_vuart $pm_vuart_node \ $logger_setting \ --mac_seed $mac_seed \ $vm_name