Commit Graph

889 Commits

Author SHA1 Message Date
Mingqiang Chi 74acdcf6e1 misc: remove DM_OWNED_GUEST_FLAG_MASK
remove this MACRO since it has moved to vm_config.h

Tracked-On: #6366
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2021-11-28 14:35:25 +08:00
Kunhui-Li 07abcf9e77 config_tools: remove DM_OWNED_GUEST_FLAG_MASK
Because it is not configurable, config tool might not need to
define DM_OWNED_GUEST_FLAG_MASK. So we remove it in tool.

Tracked-On: #6366
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-28 14:35:25 +08:00
Kunhui-Li bded332620 config_tools: remove GUEST_FLAG_SECURITY_VM in DM_OWNED_GUEST_FLAG_MASK
GUEST_FLAG_SECURITY_VM only for pre-launch vm, should not be
programmed by device model, so we remove it in DM_OWNED_GUEST_FLAG_MASK.

Tracked-On: #6366
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-28 14:35:25 +08:00
Yang,Yu-chu 30951f7a83 hv: rename CONFIG_GPU_SBDF to CONFIG_IGD_SBDF
The name CONFIG_IGD_SBDF indicates the bdf of an integrated GPU on platform.

Tracked-On: #6855
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-28 14:23:29 +08:00
Yang,Yu-chu 68136b7f7a config-tools: get GPU_SBDF automatically
Get the integrated GPU bdf by looking for device from board.xml and extract the
BDF from device address.

Tracked-On: #6855
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-28 14:23:29 +08:00
Weiyi Feng 93d4e92273 config_tool: load default cpu affinity config by vm_name
1. load default cpu affinity config from scenario file by vm_name.

Tracked-On: #6724
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-26 16:48:05 +08:00
Oguzhan Ozturk 2d0b4d41be Fixed minor wording and typos 2021-11-25 13:56:21 +08:00
Kunhui-Li 711619f92e config_tools: remove CONFIG_MAX_IR_ENTRIES
remove CONFIG_MAX_IR_ENTRIES the related python code, schema and
all existing scenario XML files since PR #6809 have changed it.

Tracked-On: #6745
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-25 13:37:22 +08:00
Kunhui-Li 11230765c1 config_tools: remove LOW_RAM_SIZE
remove LOW_RAM_SIZE in the related python code, schema and
all existing scenario XMLs because PR #6791 have removed it.

Tracked-On: #6805
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-24 20:54:57 +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
Jie Deng c4d59c8f91 hv: tee: Support the concept of companion VM
Add a configuration to support companion VM.

Tracked-On: #6571
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-17 15:25:14 +08:00
Jie Deng 71ae0fdabf hv: tee: add VM flags for x86_tee support
Add two VM flags for x86_tee. GUEST_FLAG_TEE for TEE VM,
GUEST_FLAG_REE for normal rich VM.

Tracked-On: #6571
Signed-off-by: Jie Deng <jie.deng@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-17 15:25:14 +08:00
Kunhui-Li cf619333aa misc: remove HV_RAM_SIZE
remove HV_RAM_SIZE under misc directory because PR 6664 has
changed it in HV side.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-17 08:56:57 +08:00
Kunhui-Li 4ee4835d47 config_tools: update files under generic_code directory
update files under generic_code directory with the latest code.

Tracked-On: #6663
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-17 08:56:57 +08:00
Weiyi Feng aed2187773 config_tools: filled vm to MAX_VM_NUM in vm_configurations.c
filled vm to MAX_VM_NUM in vm_configurations.c

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng 809449d672 config_tool: add GUEST_FLAG_STATIC_VM define in vm_configurations.c.xsl
1. add GUEST_FLAG_STATIC_VM define in vm_configurations.c.xsl.
2. add GUEST_FLAG_STATIC_VM in guest_flags.

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng ae5cec9a98 config_tool: update scenario xml for MAX_VM_NUM field
update scenario xml for MAX_VM_NUM field

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng ed5d28a840 config_tool: update scenario and launch xml for vm_name support
update scenario and launch xml for vm_name support

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng c74ac12165 config_tool: reformat scenario and launch xml
reformat scenario and launch xml

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng 56a68d8106 config_tool: let common.MAX_VM_NUM controlled by scenario data
let common.MAX_VM_NUM controlled by scenario data

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Weiyi Feng 86f1477482 config_tool: add vm_name field for launch config
add vm_name field for launch config

Tracked-On: #6685
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-16 14:42:59 +08:00
Kunhui-Li 7bf25a9d0d config_tools: add assert to check if the scenario is valid
Add assert for below invalid scenario:

1. Two or more pre-launched RTVM
2. One pre-launched RTVM and one or more post-launched RTVM

Tracked-On: #6685
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-16 14:42:59 +08:00
Kunhui-Li ccbf6d4603 config_tools: remove KATA and replace UUID with vmname to identify a vm
1. remove CONFIG_KATA_VM, CONFIG_MAX_KATA_VM_NUM and KATA_VM
related code.
2. remove KATA_VM in scenario xml files.
3. remove KATA vm type in UI.
4. remove UUID DB.
5. remove uuid in the launch script generation logic.
6. use vmname to identify a vm. (eg: <name>ACRN_SOS_VM</name>)
add the check logic to ensure vm name is a must-set item, not duplicated,
and the string length is [1-15] and the whitespace is not allowed.
7. enlarge the max VM num to 32.

Tracked-On: #6685
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-16 14:42:59 +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
Mingqiang Chi 185e70ad78 misc:remove some check related with UUID
Remove UUID checks since have removed UUID

Tracked-On: #6685
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
2021-11-16 14:42:59 +08:00
Yang,Yu-chu ba9f339f2e config-tools: refine acrn:get-common-clos-max
Rename function name to get-common-clos-count and refine the
calculation. Some platforms have odd clos counts. Using "floor" to get
integer numbers for macros.

Tracked-On: #6755
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-15 13:40:19 +08:00
Weiyi-Feng acc1c7fa0a config_tool: Update CPU affinity error message
Update CPU affinity error message

Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-15 09:07:58 +08:00
Weiyi-Feng 9dfd14e6ad config_tool: Update CPU affinity error message
Update CPU affinity error message

Co-authored-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2021-11-15 09:07:58 +08:00
Weiyi Feng 1bbfbcc8b3 config_tool: add cpu affinity check
1. ensure cpu affinity in launch xml is subset of its scenario settings.
2. cpu_affinity is a must have parameter for acrn_dm, if the user did not provide cpu affinity in launch xml, load it from scenario settings.

Tracked-On: #6724
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
2021-11-15 09:07:58 +08:00
Kunhui-Li c3c8679afe config_tools: fix the duplicate PT_SLOT value issue in UI
when we add two or more virtio block devices and rename them for a VM
in launch xml files, then generate launch scripts through the UI.
After ensuring the devices names are different, we repeat these operations
continuously. Finally we will get the duplicate PT_SLOT value for
different virtio block devices in a launch script. This is wrong.

After user click the "Generate Launch Script" button to generate the
launch scripts every time, we will reset PT_SLOT variate to fix the issue.

Tracked-On: #6767

Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2021-11-15 09:02:55 +08:00
Chenli Wei 022df1fb2e hv: align the MAX_IR_ENTRIES to MAX_PT_IRQ_ENTRIES
The CONFIG_MAX_IR_ENTRIES and CONFIG_MAX_PT_IRQ_ENTRIES are separate
configuration items, and they can be configured through configuration tool

When the number of PT irq entries are more than IR entries, then some
passthrough devices' irqs may failed to be protected by interrupt
remapping or automatically injected by post-interrupt mechanism.
And it waste memory if the CONFIG_MAX_IR_ENTRIES is larger.

This patch replace the CONFIG_MAX_IR_ENTRIES to MAX_IR_ENTRIES and
enforce it align to CONFIG_PT_IRQ_ENTRIES and round up to > 2^n as the
IRTA_REG spec.This way can enforce all PT irqs works with IR or PI
mechanism.

Tracked-On: #6745
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-15 09:00:27 +08:00
jackwhich 279f129f2d doc: Update nuc11 partitioned document and Scenario xml
Rename logical_partition to partitioned;
Use acrn hypervisor commit instead of tag v2.6;
Add partitioned.xml ramdisk parameter.

Tracked-On: #6709
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2021-11-12 16:25:21 +08:00
Yang,Yu-chu ccdbf49927 config-tools: enable hv features by default
Set hv features L1D_VMENTRY_ENABLED, MCE_ON_PSC_DISABLED and PTM
default value to 'y' in schema.

Tracked-On: #6793
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2021-11-12 14:59:53 +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
Xiangyang Wu 511fd7b469 misc: config_tools: generate serial configuration file
Generate serial configuration file for service VM according
to scenario file and vUART ports base address allocated by
config tool.
Currently, some non-standard serial ports are emulated in
hypervisor and will be used to do communication between service
VM and user VM, so need to generate serial configuration file
to configure these serial ports for service VM.

v1-->v2:
	Fix some type issues
	Refine script code format

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-08 13:15:38 +08:00
Zhou, Wu 48adda150c config-tools: move the pre RTVM's SSRAM base GPA
The pre-rtvm uses the RTCT tab to determine it's SSRAM address.
It was origionally duplicated from the host, and keeped its address
and layout.

To move the SSRAM area in ve820, we have to modify the guest's RTCT
tab first.

This patch uses the board_inspector's RTCT module to parse the host's
RTCT tab, and calculate the offset, then modifies the SSRAM/bin enties,
and saves it to the new RTCT bin file.

Tracked-On: #6674

Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2021-11-08 13:13:14 +08:00
Victor Sun f8bb2064a4 config_tools: remove config of MAX_EFI_MMAP_ENTRIES
The config of MAX_EFI_MMAP_ENTRIES has been removed in hypervisor, so remove
this config in config_tools;

Tracked-On: #6442

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-11-08 09:49:24 +08:00