Commit Graph

6789 Commits

Author SHA1 Message Date
Victor Sun 960238cdcb HV: fix build issue on RELEASE version
The HV will be built failed with below compiler message:

  common/efi_mmap.c: In function ‘init_efi_mmap_entries’:
  common/efi_mmap.c:41:11: error: unused variable ‘efi_memdesc_nr’
			[-Werror=unused-variable]
  uint32_t efi_memdesc_nr = uefi_info->memmap_size / uefi_info->memdesc_size;
  ^~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

The root cause is ASSERT() api is for DEBUG only so efi_memdesc_nr is not used
in RELEASE code.

The patch fix this issue by removing efi_memdesc_nr declaration;

Tracked-On: #6834

Signed-off-by: Victor Sun <victor.sun@intel.com>
2021-11-16 19:01:44 +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
Chenli Wei 05f7cbefea devicemodel: remove MAX_KATA_VM_NUM and CONFIG_KATA_VM
Since the UUID is not a *must* set parameter for the standard post-launched
VM which doesn't depend on any static VM configuration. We can remove
the KATA related code from hypervisor as it belongs to such VM type.

v2-->v3:
    separate the struce acrn_platform_info change of devicemodel

v1-->v2:
    update the subject and commit msg

Tracked-On:#6685
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
2021-11-16 14:42:59 +08:00
Chenli Wei 1cfaee396a hv: remove MAX_KATA_VM_NUM and CONFIG_KATA_VM
Since the UUID is not a *must* set parameter for the standard post-launched
VM which doesn't depend on any static VM configuration. We can remove
the KATA related code from hypervisor as it belongs to such VM type.

v2-->v3:
    separate the struce acrn_platform_info change of devicemodel

v1-->v2:
    update the subject and commit msg

Tracked-On:#6685
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@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
Yuanyuan Zhao da0d24326e dm: replace UUID with vmname.
The UUID has several usages before:
1, For HV to identify the static VM configuration of post-launched VM.
2, Seed virtualization.
3, Slightly prevent launching malicous VM from SOS as lack of secure
boot.

The UUID is confused to user, user don't understand what it is. And user
don't know where to get/apply the UUID. The worst experience is user
can't launch any VMs w/o re-compile the hv. Everything needs to be
static decided in building phase.

Now we decide to remove UUID and split each usage. For 1st usage, use
vmname as the identifier of static VM configuration. For 2nd one, we
will use --vseed as the new parameter. For 3rd one, will pretect by
SOS's dm-verity.

This patch will remove the UUID parameter and support 1st&3rd usages
from DM part. For 2nd usage, another patch will be submitted later.

Tracked-On: #6685
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@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
Mingqiang Chi bb0327e700 hv: remove UUID
With current arch design the UUID is used to identify ACRN VMs,
all VM configurations must be deployed with given UUIDs at build time.
For post-launched VMs, end user must use UUID as acrn-dm parameter
to launch specified user VM. This is not friendly for end users
that they have to look up the pre-configured UUID before launching VM,
and then can only launch the VM which its UUID in the pre-configured UUID
list,otherwise the launch will fail.Another side, VM name is much straight
forward for end user to identify VMs, whereas the VM name defined
in launch script has not been passed to hypervisor VM configuration
so it is not consistent with the VM name when user list VM
in hypervisor shell, this would confuse user a lot.

This patch will resolve these issues by removing UUID as VM identifier
and use VM name instead:
1. Hypervisor will check the VM name duplication during VM creation time
   to make sure the VM name is unique.
2. If the VM name passed from acrn-dm matches one of pre-configured
   VM configurations, the corresponding VM will be launched,
   we call it static configured VM.
   If there is no matching found, hypervisor will try to allocate one
   unused VM configuration slot for this VM with given VM name and get it
   run if VM number does not reach CONFIG_MAX_VM_NUM,
   we will call it dynamic configured VM.
3. For dynamic configured VMs, we need a guest flag to identify them
   because the VM configuration need to be destroyed
   when it is shutdown or creation failed.

v7->v8:
    -- rename is_static_vm_configured to is_static_configured_vm
    -- only set DM owned guest_flags in hcall_create_vm
    -- add check dynamic flag in get_unused_vmid

v6->v7:
    -- refine get_vmid_by_name, return the first matching vm_id
    -- the GUEST_FLAG_STATIC_VM is added to identify the static or
       dynamic VM, the offline tool will set this flag for
       all the pre-defined VMs.
    -- only clear name field for dynamic VM instead of clear entire
       vm_config

Tracked-On: #6685
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Victor Sun<victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@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
Amy Reyes 58e27983b4 doc: terminology cleanup in partition mode
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-12 15:22:51 -08:00
Amy Reyes 6c5035f9c1 doc: terminology cleanup in design guidelines
- Replace SOS or Service OS with Service VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-12 15:08:57 -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
Xiangyang Wu 44ab3a8336 deb-pkg: update deb configuration to install serial.conf
When some communication vuarts are configured in hypervisor
scenario files, serial.conf will be generated and should be
installed in the etc folder of service VM.

In this patch, update deb configuration file to install
serial.conf into etc folder of service VM.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2021-11-12 16:12:38 +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
Yuanyuan Zhao c111dd2e2c hv : encapsulate page align in e820_alloc_memory
e820_alloc_memory requires 4k alignment, so conversion to size is
encapsulated in the function. And then the pre-condition of
`size_arg` is removed.

Tracked-On: #6805
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-12 11:56:03 +08:00
Yuanyuan Zhao 4f6aa38ea5 hv: remove CONFIG_LOW_RAM_SIZE
The CONFIG_LOW_RAM_SIZE is used to describe the size of trampoline code
that is never changed. And it totally confused user to configure it.

This patch hard code it to 1MB and remove the macro for configuration.
In the trampoline related code, use ld_trampoline_end and
ld_trampoline_start symbol to calculate the real size.

Tracked-On: #6805
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-12 11:56:03 +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
Shiqing Gao 7bbd17ce80 hv: initialize and save/restore IA32_TSC_AUX MSR for guest
Commit cbf3825 "hv: Pass-through IA32_TSC_AUX MSR to L1 guest"
lets guest own the physical MSR IA32_TSC_AUX and does not handle this MSR
in the hypervisor.
If multiple vCPUs share the same pCPU, when one vCPU reads MSR IA32_TSC_AUX,
it may get the value set by other vCPUs.

To fix this issue, this patch does:
 - initialize the MSR content to 0 for the given vCPU, which is consistent with
   the value specified in SDM Vol3 "Table 9-1. IA-32 and Intel 64 Processor
   States Following Power-up, Reset, or INIT"
 - save/restore the MSR content for the given vCPU during context switch

v1 -> v2:
 * According to Table 9-1, the content of IA32_TSC_AUX MSR is unchanged
   following INIT, v2 updates the initialization logic so that the content for
   vCPU is consistent with SDM.

Tracked-On: #6799
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-12 09:30:12 +08:00
Amy Reyes 6023388e79 doc: terminology cleanup in IOC virt
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-11 15:29:34 -08:00
Amy Reyes 33a205c913 doc: terminology cleanup in trusty doc
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-10 13:09:07 -08:00
Amy Reyes e66d65152c doc: terminology cleanup in What Is ACRN, HLD intro
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-09 14:01:17 -08:00
Amy Reyes 6695080182 doc: terminology cleanup in DM params
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-09 10:19:07 -08:00
Amy Reyes a68d9266a7 doc: terminology cleanup in nvmx tutorial
- Replace SOS or Service OS with Service VM
- Replace UOS or User OS with User VM
- Clean up some of the grammar

Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-09 10:17:55 -08:00
David B. Kinder 6ae241d398 doc: fix git clone and misspelling
It's recommended we always use the .git extension when referring to the
git repo when cloning.  Fix that in the GSG.

Also, fix a misspelling in the hld-power-management doc.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2021-11-09 09:55:59 -08:00
Amy Reyes 2ae8a468f9 Update AGL and TME links per feedback
Signed-off-by: Amy Reyes <amy.reyes@intel.com>
2021-11-08 15:31:41 -08:00