Commit Graph

56 Commits

Author SHA1 Message Date
gaofeix.sun@intel.com 97f6984453 misc: life_mngr: Fix Linux and rtvm not restarting acrn in life_mngr
1. using sockets_req_system_shutdown_user_vm_handler and sockets_req_system_reboot_user_vm_handler
   wrapping function req_user_vm_shutdown_reboot
2. Modify the variable names SHUTDOWN_REQ to SYS_REBOOT_REQ
3. Add a handler for "ACK_REQ_SYS_REBOOT"

Tracked-On: #8431
Signed-off-by: Gaofei Sun <gaofeix.sun@intel.com>
Reviewed-by: Li Fei <fei1.li@intel.com>
2023-09-05 12:12:41 +08:00
Gaofei Sun d2fae30b23 misc: life_mngr: Fix Linux and rtvm not restarting acrn in life_mngr
Only Windows virtual machines can restart ACRN through life_mngr.
Added Linux and rtvm to restart acrn in life_mngr.

Tracked-On: #8431
Signed-off-by: Gaofei Sun <gaofeix.sun@intel.com>
Reviewed-by: Li Fei <fei1.li@intel.com>
2023-09-05 12:12:41 +08:00
Jiaqing Zhao 1b2b20b07d misc: life_mngr: skip windows build if LDFLAGS contains -z option
Linker option "-z,relro" will be automatically added to LDFLAGS when
building debian packages. Since x86_64-w64-mingw32-ld does not support
"-z" option, it causes failure in building the life_mngr windows exe.
And compared with ld, only "-z" option is not supported. This patch
fixes it by skipping the windows build of life_mngr if LDFLAGS contains
any "-z" option.

Tracked-On: #8399
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-05-19 16:33:19 +08:00
Jiaqing Zhao d4fa35ad5b misc: life_mngr: fix use-after-free in uart channel
LIST_FOREACH() doesn't allow var to be removed or freed within the
loop, but c_dev is freed inside the loop here. gcc 12 also reports
error on it. This patch uses list_foreach_safe() macro instead for
freeing var within the loop safely.

Tracked-On: #8382
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-04-21 23:30:57 +08:00
Fei Li c76f26bdad life_mngr: permit life_mngr in windows to assign VM name
Permit life_mngr in windows to assign the VM name which configure
in scenario XML.

Tracked-On: #8051
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-10-25 16:01:21 +08:00
Reyes, Amy f0eddc6a4c doc: Update acrnctrl readme
- Update broken link and minor editorial changes

Tracked-On: #8172

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-20 09:09:47 -07:00
zhangrouyu 8d0131e7fb improve the document of acrnd
Tracked-On:#8148
Signed-off-by: zhangrouyu <rouyu.zhang@intel.com>
2022-09-19 12:10:59 +08:00
zhangrouyu 34776484df GSG document revision 2022-09-16 13:28:14 -07:00
zhangrouyu ef41f87171 improve the document of acrnd 2022-09-16 13:28:14 -07:00
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00
Fei Li ce34ca658e misc: life_mngr: generate system_reboot_trigger_win.py script when build life_mngr
generate system_reboot_trigger_win.py script when build life_mngr for Waag.

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-06-29 13:53:42 +08:00
Fei Li 2c7fbecc89 misc: life_mngr: fix a bug about receiving message
On some extreme circumstances, the client can't send the whole message out
in a short time. In this case, the server can't receive the whole message
because now server didn't check the integrity of the message.

This patch add this by checking the terminal character of the message.

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-06-29 13:53:42 +08:00
Fei Li d625ce0677 misc: acrnd: fix a minor build Werror
The comparison ((argv + 1)) will always evaluate as 'true' for the pointer
operand in 'argv + 8' must not be NULL.

Tracked-On: #7453
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-05-13 12:57:32 +08:00
Helmut Buchsbaum a22d0497d7 life_mngr: Makefile: Fix permission of life_mngr.conf
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum bea9c8d165 life_mngr: Makefile: Fix install path creation of CONF_DIR
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Helmut Buchsbaum 5dbf09daef life_mngr: Makefile: Use sysconfdir
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
2022-05-10 09:20:14 +08:00
Fei Li 59e27ce49e mise: life_mngr: fix some minor bugs
1. enlarge receive Service VM message time to 10s. Now in some extreme
environments, Service VM will takes more than 1s to ACK the User VM's
requirements.
2. fix a bug to calculate string pointer size.

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-04-06 18:15:06 +08:00
Geoffroy Van Cutsem 8b16be9185 Remove "All rights reserved" string headers
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).

Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-04-06 13:21:02 +08:00
Fei Li e17acec539 misc: life_mngr: add a separate config to allow trigger sysreboot
Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 16:49:07 +08:00
Fei Li 187e19da2f misc: minor fix
Some minor comments refine and fix some typo

Tracked-On: #7215
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 16:49:07 +08:00
Fei Li 25d5f2452e Misc: life_mngr: system reboot support
Now reuse allow_trigger_s5 in life_mngr_config to allow WAAG to trigger
system reboot.

Tracked-On: #7215
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Fei Li 6ea861affc Misc: life_mngr: a new common function to handle socket
Add a new common function to handle socket request, this will make
it is easy to add more socket request in windows lifecycle manager.

Tracked-On: #7215

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Fei Li b555bdc8ae Misc: acrnd: acrnd servie should start after life_mngr.service
acrnd servie should start after life_mngr.service, otherwise,
lifecycle manager in service VM will start after lifecycle
manager in User VM.

Tracked-On: #6994

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
2022-03-30 10:04:00 +08:00
Xiangyang Wu ecf99c45a3 Misc: life_mngr: support user VM reboot
Add user VM reboot command and related command handler in
lifecycle manager to support user VM reboot.

Libvirt will send user VM reboot command to lifecycle manager
of service VM through socket, this command is forwarded to the
specified user VM, user VM will execute reboot command to start
reboot itself.

v1-->v2:
	Update some interfaces name to make it reable:
        (1) enable_uart_channel_dev_resend -->
	start_uart_channel_dev_resend
	(2) enable_all_uart_channel_dev_resend -->
	start_all_uart_channel_dev_resend
	(3) disable_uart_channel_dev_resend -->
	stop_uart_channel_dev_resend
	(4) get_reboot_flag --> get_user_vm_reboot_flag

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-03-03 14:40:04 +08:00
Xiangyang Wu 1adbf3293b Misc: acrnd: fix acrnd start failure
Currently, if user starts acrnd service, acrnd service will fail to
find the folder "/sys/kernel/gvt" in Service VM, fail to start.

Root cause is GVT-g is not supported in current ACRN, the folder
"/sys/kernel/gvt" will not be created in Service VM.

This patch updates acrnd service to remove this condition check.

v1-->v2:
	Weston service is optional for ACRN, acrnd should not depend
	on it, so remove weston service dependency in acrnd service.

Tracked-On: #6994
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 18:47:32 +08:00
Xiangyang Wu 44f6804ad0 Misc: acrnctl: update acrnctl readme
User should make sure acrnd service has been started
before running acrnctl.
This patch add note about this.

v2-->v3:
	Update document about acrnd service enabling.

Tracked-On: #6991
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 10:58:16 +08:00
Xiangyang Wu 4aeee0bebf Misc: acrnctl: hot fix acrnctl bug
Currently, while there is no running post-launched User VM and
user executes acrnctl command, he or she will get failure and
error message is "/run/acrn/mngr doesn't exist".

Root cause of this failure is acrnctl only check whether the folder
"/run/acrn/mngr" exist or not, if this folder doesn't exist, will
report failure.
acrnd service will create the folder "/run/acrn/mngr", user should
make sure acrnd service is started before using acrnctl

This patch will update log message while the folder "/run/acrn/mngr"
doesn't exist.

v1-->v2:
	Update log message to make it clearer.

Tracked-On: #6991

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-01-04 10:58:16 +08:00
Xiangyang Wu 4f034c99a2 doc: remove suspend and resume command from acrnctl
Currently, the command "acrnctl suspend" and "acrnctl resume"
is not used by user. This patch removes related code.

Tracked-On: #5921
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-14 09:52:31 +08:00
Xiangyang Wu 982d1565d5 Misc: acrnctl: remove suspend and resume command from acrnctl
Currently, the command "acrnctl suspend" and "acrnctl resume"
is not used by user. This patch removes related code.

v1-->v2:
	Remove vm_suspend.

Tracked-On: #5921
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2021-12-14 09:52:31 +08:00
Xiangyang Wu deec4b24ef HV: life_mngr: add sync delay for WaaG lifecycle manager
The lifecycle manager in Service VM checks sync message every
5 seconds, so need add 5 seconds to sync delay for WaaG
lifecycle manager to avoid unnecessary sync resending.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-24 20:29:43 +08:00
Xiangyang Wu 93d0ad543e HV: life_mngr: refine platform shutdown when User VM fails to shutdown
Currently, the lifecycle manager in Service VM will issue poweroff
command to shutdown service VM when User VM fails to shutdown. The
post-launched RTVM with virtio device may hang after Service VM
shutdown.

In this patch, the lifecycle manager in Service VM will stop to
shut down service VM when User VM fails to shutdown. Users have
chance to fix User VM shutdown failure (such as forcelly shutdown
User VM or execute poweroff command in User VM), after the failure
is fixed, user can trigger S5 in service VM to shutdown platform
gracefully.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-24 20:29:43 +08:00
Mingqiang Chi 4233409c06 misc: use MAX_VM_NAME_LEN
replace MAX_VMNAME_LEN with MAX_VM_NAME_LEN
to keep sync with HV and devicemodel

Tracked-On: #6685
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2021-11-16 14:42:59 +08:00
Xiangyang Wu c0b02e802f misc: life_mngr: fix some typo issues
Change macro name:
SCECOND_TO_US --> SECOND_TO_US

Use macro CONF_DIR in Makefile

Tracked-On: #6652
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-12 11:04:23 +08:00
Xiangyang Wu e7ed68afc8 misc: life_mngr: add script to do user VM shutdown
COM2 in user VM is used by acrnctl to do user VM
shutdown.
In this patch series, COM2 in user VM is used as uart
channel device for new lifecycle manager. So acrnctl
can't be used to do user VM shutdown.

This patch provides a script to user to do guest
shutdown in service VM. Lifecycle manager in service
VM will send user VM shutdown command to user VM directly.

TODO: When user VM shutdown is supported in libvirt, this
script will be removed.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu d1cb1aafa0 misc: life_mngr: update Makefile for lifecycle manager
The old lifecycle manager will not be used and remove it,
update Makefile to build and install new lifecycle manager.

v1-->v2:
	Copy s5_trigger_win.py into build directory;
	Add compiler parameter (-lwsock32) to build
	life_mngr_win.c.
v3-->v4:
	Update Makefile for s5_trigger_linux.py
v4-->v5:
	Inlcude paths.make at the top-level folder.
	Generate life_mngr.service according to bindir
	variable.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu e297839fc3 misc: life_mngr: refine lifecycle manager for windows VM
Refine lifecycle manager for windows VM since new commands
are introduced in the lifecycle manager.

v1-->v2:
	Implement socket service to receive system shutdown
	request command through local host socket.
	Add one python script to trigger system shutdown
	request in windows VM.
v2-->v3:
	Update log message.
v3-->v4:
	Support guest shutdown.
v4-->v5:
	Update command name.
v5-->v7:
	Add resend message logic.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 7a5146c2ed misc: life_mngr: refine script to trigger system shutdown request
Provide a script to user to trigger system shutdown request
in service VM or user VM.
System shutdown logic have been integrated in the lifecycle
manager, only need to send system shutdown request command
through unix domain socket in this script.

v3-->v4:
	Rewirte system shutdown trigger script using python
	since phython script have better portability.
v4-->v5:
	Update command name and copyright header.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 0d85463abe misc: life_mngr: add monitor module
In the monitor module, the following functions are implemented:
-Implement main function of lifecycle manager, it will initialize
other module through invoking related interfaces, wait threads in
the uart module exit.

Todo:
	Will refine the name of
	init_socket_server_and_shutdown_commands,
	init_uart_channel_devs_and_shutdown_commands.

v1-->v2:
	Add comments in c file.
v2-->v3:
	Update some log message.
v3-->v6:
	Update monitior module for modulization.
v6-->v7:
	Regiester command handler for ACK receiving timeout case
	in user VM.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 7fa42ff484 misc: life_mngr: add log module
In the log module, the following functions are implemented:
- open_log
Provide one interface to open log file;

-close_log
Provide one interface to close log file;

- LOG_PRINTF LOG_WRITE
Provide interfaces to write log message to log file.

v1-->v3:
	Add timestamp in the log message.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 4e8adc7b14 misc: life_mngr: add config module
In the config module, the following functions are implemented:
- load_config
Provide one interface to load lifecycle manager configuration
from config file (life_mngr.conf), in the config file, user
can specify the VM type of VM which lifecycle manager will run
in, the VM name, the communication device name, and
the device name in service VM which is used to communicate with
the VM which is allowed to send system shutdown request.
- check_dir
Check folder exist or not, if not, create the folder
- get_allow_s5_config
Get the name of the device which is allowed to trigger
system shutdown.

v1-->v2:
	Add comments in head file.
v2-->v3:
	Update some log message.
v3-->v6:
	Simply configuration item parsing logic.
	Add get_allow_s5_config interface.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu b1d2f8d931 misc: life_mngr: add command handler module
In this module, the following functions are implemented:
For uart channel of service VM, implement handlers for sync command,
system shutdown request command, acked  poweroff command, vm poweroff
timeout command.
The uart channel commands of service VM and related actions are
described below:
Command			Actions
---------------------------------------------------------------
sync			Send acked sync
			command to uart in user VM
----------------------------------------------------------------
system shutdown		If this request is valid, send
request			poweroff command to each
			connected user VM through uart,
			Enable message reseding.
----------------------------------------------------------------
acked poweroff		Remove uart of user VM from
command			connection list, stop message polling,
			if connection list is empty, will
			wait for user VM status through check
			ACRN DM process instance, if all user
			VMs are	shutdown, then shutdown
			service VM
---------------------------------------------------------
ACK timeout		If it is timeout of receiving poweroff ACK,
			the action is similar to acked poweroff.
			Ohterwise, just disable message reseding.
---------------------------------------------------------

For uart channel of user VM, implement handlers for acked sync
command, poweroff command, acked system shutdown request command,
ACK timeout command.
The uart channel commands of user VM and related actions are
described below:
Command			Actions
--------------------------------------------------------
acked sync		Print log message
--------------------------------------------------------
poweroff		Disconnect uart channel,
			exit message polling, close
			unix domain socket, shutdown user VM
--------------------------------------------------------
user VM shutdown	Exit message polling, close
			unix domain socket, shutdown user VM
--------------------------------------------------------
acked system		Print log message
shutdown request
-------------------------------------------------------
ACK timeout		Disconnect uart channel,
			exit message polling, close
			unix domain socket
---------------------------------------------------------

For socket server in each VM, implement handler for system
shutdown request.
In user VM, forward this command to service VM through uart.
In service VM, send poweroff command to each connected user VM
through uart.

Implement handler for user VM shutdown request in socket server of
service VM, send user VM shutdown command to user VM which is
specified in the user VM shutdown request message.

v1-->v2:
	Add comments in c file and head file.
v2-->v3:
	Update commit message about allow s5 command and update
	some log message.
v3-->v4:
	Guest shutdown support.
v4-->v5:
	Update command name.
v5-->v6:
	Move uart channel operations into uart channel module.
v6-->v7:
	Set resend requirement for some commands.
	Add ACK receiving timeout handler for user VM.
v7-->v8:
	Update message reseding enable, this interface will be
	called before sending message.
v8-->v9:
	Use strlen to calculate the length of string, this will be
	the parameter of send_message_by_uart.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 7158f95bac misc: life_mngr: add command module
In the command module, the following functions are implemented:
- register_command_handler
Provide one interface to register command handler, other module
can use this interface to register multiple handler for one command.

- find_command
Provide one interface to find a command instance by name;

- dispatch_command_handlers
Provide one interface to dispatch the command and invoke registered
handler.

v1-->v2:
	Add comments in head file.
v2-->v3:
	Update interface name since "dm" prefix is useless.
	Update some log message.
v3-->v4:
	Support guest shutdown.
v4-->v5:
	Refine command name and add parameter check for interface.
v5-->v6:
	Remove allow s5 command.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu e195a23f73 misc: life_mngr: add socket moudle
This module is to implement unix domain socket server, operator
can connect this server to send system shutdown request, or
guest shutdown command.
In the socket module, the following functions are implemented:
- open_socket
Provide one interface to open one unix domain socket server,
in this interface, initialize a socket, create one thread to
listen to client, another thread to poll message from client;
- close_socket
Provide one interface to close one unix domain socket server;
- write_socket_char
Provide one interface to send message to client.
- find_socket_client
Find socket client instance according to fd
- init_socket
Initialize a socket
- deinit_socket
Deinit a socket

v1-->v3:
	Update interface name, only unix domain socket
	server is implemented in this module.
v3-->v4:
	Add socket client name to support guest shutdown
v4-->v6:
	Add find_socket_client, init_socket, deinit_socket

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu baf7982547 misc: life_mngr: add uart channel module
In the uart module, the following functions are implemented:
- init_uart_channel
Initialize each field of uart channel instance.
- create_uart_channel_dev
Create one channel device instance to store information about
one uart channel device which will be opened.
- wait_uart_channel_devs_threads
Wait uart channel devices threads to exit
- destroy_uart_channel
Destroy uart channel and release channel device instance
- listen_uart_channel_dev
Wait to connect device in uart channel
- connect_uart_channel_dev
Send sync message every 5 second
- poll_and_dispatch_uart_channel_events
Poll and dispatch message received from uart channel
- find_uart_channel_dev
Find uart channel device instance according to fd
- find_uart_channel_dev_by_name
Find uart channel device instance according to device name
- disconnect_uart_channel_dev
Disconnect uart channel device instance
- stop_listen_uart_channel_dev
Stop to listen uart channel device
- enable_uart_channel_dev_resend
Set the uart channel device resending buffer and
resending time
- enable_all_uart_channel_dev_resend
Enable resend for all connected uart channel devices
- disable_uart_channel_dev_resend
Clear the uart channel device resending buffer and
resending time
- notify_all_connected_uart_channel_dev
Send message to each connected uart channel device
- check_uart_channel_connection_list_empty
Check whether uart channel connection list is empty or not

TODO:
	Will refine resending logic in the
	poll_and_dispatch_uart_channel_events, and add
	SYNC command resending.

v3-->v4:
	Initialize each field of uart channel instance.
	Add one flag indicating master channel device.
	Update interface names.
v4-->v5:
	Refine interface name.
v5-->v6:
	Move uart channel operations from command handler module
v6-->v7:
	Add enable_uart_channel_dev_resend and
	disable_uart_channel_dev_resend;
	Fix bugs about receiving message timeout.
v7-->v8:
	Add enable_all_uart_channel_dev_resend interface.
v8-->v9:
	Update error handling.
	Use strlen to calculate the length of string, this will be
	the parameter of send_message_by_uart.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Xiangyang Wu 591998e956 misc: life_mngr: add uart module
In the uart module, the following functions are implemented:
- init_uart_dev
Allocate UART device instance and initialize UART device
according to device name.
- deinit_uart_dev
Close UART devcie and free UART device instance.
- send_message_by_uart
Set handler to handle received message.
- receive_message_by_uart
Receive message and retry RETRY_RECV_TIMES time to
avoid miss message in some cases.
- get_uart_dev_fd
Get the file descriptor of a UART device
- get_uart_dev_path
Get the name of a UART device

v1-->v2:
	Update sync logic between uart in service VM and uart in
	user VM, lifecycle manager will not depend on VM boot order.
	Add code comments.
v2-->v3:
	This module only includes UART device operations, move other
	logic into uart channel module.
v3-->v4:
	Add parameters check for interface and refine some names.
v4-->v5:
	Refine interface parameter type, error value.
v5-->v6:
	Update condition check format of deinit_uart_dev.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Reviewed-by: fei1.li@intel.com
2021-11-12 11:04:23 +08:00
Liu Long 3f4ea38158 ACRN: misc: Unify terminology for service vm/user vm
Rename SOS_VM type to SERVICE_VM
rename UOS to User VM in XML description
rename uos_thread_pid to user_vm_thread_pid
rename devname_uos to devname_user_vm
rename uosid to user_vmid
rename UOS_ACK to USER_VM_ACK
rename SOS_VM_CONFIG_CPU_AFFINITY to SERVICE_VM_CONFIG_CPU_AFFINITY
rename SOS_COM to SERVICE_VM_COM
rename SOS_UART1_VALID_NUM" to SERVICE_VM_UART1_VALID_NUM
rename SOS_BOOTARGS_DIFF to SERVICE_VM_BOOTARGS_DIFF
rename uos to user_vm in launch script and xml

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Liu Long 14c6e21efa ACRN: misc: Unify terminology for sos/uos rin macro
Rename SOS_VM_NUM to SERVICE_VM_NUM.
rename SOS_SOCKET_PORT to SERVICE_VM_SOCKET_PORT.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename PCI_DEV_TYPE_SOSEMUL to PCI_DEV_TYPE_SERVICE_VM_EMUL.
rename SHUTDOWN_REQ_FROM_SOS to SHUTDOWN_REQ_FROM_SERVICE_VM.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename SHUTDOWN_REQ_FROM_UOS to SHUTDOWN_REQ_FROM_USER_VM.
rename UOS_SOCKET_PORT to USER_VM_SOCKET_PORT.
rename SOS_CONSOLE to SERVICE_VM_OS_CONSOLE.
rename SOS_LCS_SOCK to SERVICE_VM_LCS_SOCK.
rename SOS_VM_BOOTARGS to SERVICE_VM_OS_BOOTARGS.
rename SOS_ROOTFS to SERVICE_VM_ROOTFS.
rename SOS_IDLE to SERVICE_VM_IDLE.
rename SEVERITY_SOS to SEVERITY_SERVICE_VM.
rename SOS_VM_UUID to SERVICE_VM_UUID.
rename SOS_REQ to SERVICE_VM_REQ.
rename RTCT_NATIVE_FILE_PATH_IN_SOS to RTCT_NATIVE_FILE_PATH_IN_SERVICE_VM.
rename CBC_REQ_T_UOS_ACTIVE to CBC_REQ_T_USER_VM_ACTIVE.
rename CBC_REQ_T_UOS_INACTIVE to CBC_REQ_T_USER_VM_INACTIV.
rename uos_active to user_vm_active.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-02 10:00:55 +08:00
Shuo A Liu 1bccfab3b6 config_tools: Use new HSM driver device node
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 82fa2d6355 dm: Rename vhm_ioctl_defs.h to hsm_ioctl_defs.h
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2021-07-15 11:53:54 +08:00
Shuo A Liu 42989f753e dm: Remove header vmm.h
vmm.h has some unused definitions.

Keep the useful definitions and delete vmm.h

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2021-07-15 11:53:54 +08:00