Commit Graph

7053 Commits

Author SHA1 Message Date
hangliu1 5e6341ee89 doc: remove guest_flag and NVMX_ENABLE
Global parameter NVMX_ENABLE is removed from user interface,
and remove guest_flag

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-03-02 15:50:23 +08:00
hangliu1 c2695f290d config tool: remove guest flag for scenario xml
remove guest flags and add lapic_passthrough field

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-03-02 15:50:23 +08:00
hangliu1 0068d4e826 config tool: remove guest_flags in user interface
The concept of guest_flags is hard to understand for users.
So turn guest_flags into several parameters in config tool
user interface, list as below:

GUEST_FLAG_LAPIC_PASSTHROUGH ---> lapic_passthrough
GUEST_FLAG_IO_COMPLETION_POLLING ---> io_completion_polling
GUEST_FLAG_VCAT_ENABLED ---> virtual_cat_support
GUEST_FLAG_SECURE_WORLD_ENABLED ---> secure_world_support
GUEST_FLAG_HIDE_MTRR ---> hide_mtrr_support
GUEST_FLAG_NVMX_ENABLED ---> nested_virtualization_support
GUEST_FLAG_SECURITY_VM ---> security_vm
GUEST_FLAG_RT ---> vm_type(RTVM)
GUEST_FLAG_TEE ---> vm_type(TEE_VM)
GUEST_FLAG_REE ---> vm_type(REE_VM)

In addition, HV global parameter NVMX_ENABLE is removed
from user interface, when config tool detects more than
one VM with nested_virtualization_support, NVMX_ENABLE is
assigned as 'y' automatically.

v1->v2:
*Rebase on the latest xml schema checking change
*Remove "all rights reserved" from the license header in guest_flags.py

v2->v3:
*Change the name of the new config items to CAPITAL_CASE style
*Combine guest flag policy to an XPATH in guest_flags.py
*Use count() to directly deduce NVMX_ENABLED in config_common.xsl and
update `boolean-by-key-value` to process 'true'

v3->v4:
*Change the name of the new config items to lower_case style
*Change guest_flag_node to allocation_vm_node in guest_flags.py
*Separate value case and key case for boolean-by-key-value

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-02 15:50:23 +08:00
Kunhui-Li 1034443796 config_tools: fix the issue that fail to get apic_id node
Update the XPATH of apic_id to tolerate the variance of reported
intermediate levels.

Tracked-On: #7159
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-03-02 11:31:28 +08:00
dongshen ce7b38ee04 dm: fixed a bug where mptable failed to wake up CPU1# when adding acpi=off into User VM cmdline
Previous commit introduced the "use physical APIC IDs as vLAPIC IDs for VMs" change,
but it didn't update the apic_id in mptable. Changed the mptable code to also
set apic_id to physical APIC ID to fix the bug

Tracked-On: #7146
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
2022-03-02 11:22:31 +08:00
David B. Kinder 723f86a578 doc: remove build problem in release notes
when an XML option was removed, it will break documentation links to
that option information.  We'll remove the link in the old release notes
to fix this problem.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-03-01 18:11:24 -08:00
David B. Kinder eed4ef3ab8 doc: add header notice on latest documentation from master
The master branch is considered unstable and under development. We need
to remind developers of this and refer them to the available stable release
documentation.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-03-01 14:25:32 -08:00
Reyes, Amy 5c52f6fc2c doc: Style cleanup in timer hld
- Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-28 12:17:00 -08:00
David B. Kinder 0283202193 doc: fix docs with missing newline at EOF
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-02-28 12:16:18 -08:00
Reyes, Amy a98f623a35 doc: Style cleanup in ivshmem hld
- Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-28 10:46:06 -08:00
Kunhui-Li cbce5c7775 config_tools: fix the board inspector exit issue
Fix the issue that board inspector exit after showing warning message.

Tracked-On: #6689
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-28 11:23:38 +08:00
Geoffroy Van Cutsem af8b51a63f Makefile: remove default BOARD and SCENARIO values
Remove the fact that a default BOARD and SCENARIO are used in case there was
none provided by the user, nor any available from a previous build. Up until
now, if that was the case, a build was triggered using a default set of BOARD
and SCENARIO values. The 'make' command will now error out asking the user to
specify those parameters.

Tracked-On: #7112
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-02-28 10:04:15 +08:00
Reyes, Amy 49e234129f doc: Tarball installation
- New document about building tarball files for ACRN installation.
- Steps are from GSG.

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-27 13:39:21 -08:00
Reyes, Amy 0d280ced2f doc: Style cleanup in guides
- Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-27 13:34:32 -08:00
Reyes, Amy 72a9b7bae3 doc: Style cleanup in usercrash, trusty, vuart docs
- Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-27 13:33:21 -08:00
Reyes, Amy 85fe6d7d1a doc: Style cleanup in dm, gpio, interrupt hld
Minor style changes per Acrolinx recommendations and for consistency

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-27 13:29:48 -08:00
Yang,Yu-chu eb78f1bb7c config-tools: add console=ttyS0 to bootargs
Add missing console=ttyS0 to service-VM's bootargs.

Tracked-On: #7127
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2022-02-25 09:31:17 +08:00
Yang,Yu-chu 2dd5bbd959 config-tools: remove SERIAL_CONSOLE extracion for bootargs of SOS
Remove the logic to parse SERIAL_CONSOLE and append to bootargs. Specify the console in bootargs directly.

Tracked-On: #7127
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-02-25 09:31:17 +08:00
jackwhich dad8834e23 doc: remove obsolete content in document
remove obsolete content in Document

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-02-22 21:06:43 -08:00
David B. Kinder d1b2b58b19 doc: limit search engines scan on older content
Update robots.txt to exclude older documentation versions: 0.? 1.? and 2.0 through 2.4

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-02-22 11:30:14 -08:00
Reyes, Amy 7c304539b4 doc: Update terms in vUART tutorial
- Update scenario names

Tracked-On: #6701
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-22 09:50:39 -08:00
jackwhich bd02de15b0 doc: Remove modprobe msr in gsg
modprobe msr has been added to board_parse.py in PR #6692.

Remove modprobe msr in gsg and board_inspector docs

Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
2022-02-22 09:45:29 -08:00
Chenli Wei b41ff11a9c doc: add UID parameter for acpidev_pt
Now the acpidev_pt module only use the hid to check the device,it can't
work well if there are more then one instance.

So this patch add UID to identify same type device to fix these issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-02-22 09:44:02 -08:00
hangliu1 9f8231e7ba config tool: xml change for vm_type and load_order
change vm_type and add load_order in all scenario xml

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
2022-02-22 16:25:27 +08:00
hangliu1 816a88f7f7 config tool: add load_order and redefine vm_type
This patch includes:
1.add load_order(PRE_LAUNCHED_VM/SERVICE_VM/POST_LAUNCHED_VM) parameter
2.change vm_type parameter to values as RTVM, STANDARD_VM, TEE, REE
  TEE and REE are hide in UI.
3.deduce vm severity in vm_configuration from vm_type and load_order

This patch not includes:
change for scenario_config and functions called by scenario_config about checking

v2->v3:
*Refine template load_order

v1->v2:
*Change variable name from vm_type to load_order
*Change LoadOptionType to LoadOrderType
*Change VMOptionsType to VMType
*Add TEE_VM/REE_VM description
*Refine acrn:is-pre-launched-vm

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 16:25:27 +08:00
Geoffroy Van Cutsem bb9db70c97 Makefile: detect if 'dpkg' is available
The 'dpkg' utility is required in order to build Debian packages. If it is not
installed and available on the build system, the 'make' instructions will fail
with a Python traceback. Fix this by detecting its availability and doing a
graceful exit if not (or simply skip the step).

Tracked-On: #7109
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Co-authored-by: David Kinder <david.b.kinder@intel.com>
2022-02-22 16:23:46 +08:00
Kunhui-Li 55ced4e79f config_tools: remove PLATFORM_RAM_SIZE
Since PR #7113 has landed, we also remove PLATFORM_RAM_SIZE in the related
Python code, schema and all existing scenario XML files.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
2022-02-22 08:36:11 +08:00
Junjie Mao 5b9c45da17 config-tools: remove obsolete files of launch configuration
With the launch script generation script rewritten, some other files under
launch_config are no longer used. This patch removes these obsoleted files.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 08:33:16 +08:00
Junjie Mao 2450b4c77f config-tools: rewrite the generator of launch scripts
The launch script generator today (and the scripts that it generates) is
fundamentally built on the concept of PCI device classes, with the
restriction that at most one PCI function per class can be passed through
to a post-launched VM. This has put inproper constraint on the scenarios
users can set up, especially on server platforms or those with SR-IOV
capable devices.

As it is too tedious to change such deep-rooted concept, this patch
rewrites the launch script generator and refines the structure of the
generated scripts so that PCI functions are identified only by their
BDF.

This change serves as a mandatory step to align the way how passthrough
devices are configured for pre-launched and post-launched VMs, which
eventually allows us to present a unified view in the configurator for
assigning passthrough device.

v2 -> v3:
 * Rename sos_id to service_vm_id and user_vmid to user_vm_id.
 * Refine a couple of info messages in the launch script template.

v1 -> v2:
 * Fix wording issues identified during review.
 * Exit when the out_dir is an existing regular file.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-02-22 08:33:16 +08:00
Zhao Yakui eb9a58c70e ACRN:DM: Set the desired state to inject PCI legacy intx
When the virtio-XXX pci devices fall back to legacy PCI intx,
the pci_irq_assert is called to inject the interrupt and then
the pci_irq_deassert is used to mark the completion of PCI interrupt.
Currently the HV vIOAPIC uses the pin_state for the interrupt injection
of legacy PCI intx. In such case it will fail to inject the PCI legacy
intx and the guest system fails to be booted when adding the boot option
of "pci=nomsi".

PCI legacy INTx usually use active low level trigger mode as it is Open-Drain
state and allows multitple interrupt signals to share a single line.
https://wiki.osdev.org/PCI_Local_Bus_Signals
In such case DM needs to set the correct state for the PCI device so that the
HV vIOAPIC can help to inject the PCI legacy intx.

BTW: When the MSI/MSIX is used for PCI device, it uses another mechanism
to inject the interrupt. It is harmless to configure the initial state.

Tracked-On: #7124
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-21 15:34:01 +08:00
Yonghua Huang b4386566ef dm: fix mevent mutex deadlock issue
'mevent_lmutex' is initialized as default type,
 while attempting to recursively lock on this
 kind of mutext results in undefined behaviour.

 Recursively lock on 'mevent_lmutex' can be detected
 in mevent thread when user tries to trigger system
 reset from user VM, in this case, user VM reboot hang.

 The backtrace for this issue:
  #1 in mevent_qlock () at core/mevent.c:93
  #2 in mevent_delete_even at core/mevent.c:357
    ===>Recursively LOCK
  #3 in mevent_delete_close at core/mevent.c:387
  #4 in acrn_timer_deinit at core/timer.c:106
  #5 in virtio_reset_dev at hw/pci/virtio/virtio.c:171
  #6 in virtio_console_reset at
     hw/pci/virtio/virtio_console.c:196
  #7 in virtio_console_destroy at
    hw/pci/virtio/virtio_console.c:1015
  #8 in virtio_console_teardown_backend at
    hw/pci/virtio/virtio_console.c:1042
  #9 in mevent_drain_del_list () at
    core/mevent.c:348 ===> 1st LOCK
  #10 in mevent_dispatch () at core/mevent.c:472
  #11 in main at core/main.c:1110

  So the root cause is:
  mevent_mutex lock is recursively locked by mevent thread
  itself (#9 for this first lock and #2 for recursively lock),
  which is not allowed for mutex with default attribute.

  This patch changes the mutex type of 'mevent_lmutex'
  from default to "PTHREAD_MUTEX_RECURSIVE", because
  recrusively lock shall be allowed as user of mevent
  may call mevent functions (where mutex lock maybe required)
  in teardown callbacks.

Tracked-On: #7133
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2022-02-21 14:23:03 +08:00
Wen Qian e2f1990548 hv: change error code of undefined hypercall
This patch adds ENOTTY and ENOSYS to indicate undefined and obsoleted
request hyercall respectively, and uses ENOTTY as error code for undefined
hypercall instead of EINVAL to consistent with the ACRN kernel's return
value.

Tracked-On: #7029
Signed-off-by: Wen Qian <qian.wen@intel.com>
Signed-off-by: Li Fei <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-21 09:25:50 +08:00
Wen Qian a5a005f129 dm: add checks of ioctl return value for ACRN userspace
The current code does not always check the return value of function
ioctl called in ACRN userspace, and lack of error message printing
to help debug.

This code fixes it by checking the return value of ioctl, and adding
function errormsg to return a string describing of the error code.

Tracked-On: #7029
Signed-off-by: Wen Qian <qian.wen@intel.com>
Signed-off-by: Li Fei <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-21 09:25:50 +08:00
Reyes, Amy dc207b3fa3 doc: Style cleanup in doc guides
- Minor style changes per Acrolinx recommendations

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-02-18 20:58:10 -08:00
David B. Kinder 97855c54c2 doc: quick doc fix to remove build error from IVSHMEM changes
PR #7115 removed ``IVSHMEM_ENABLED`` and ``IVSHMEM_REGION`` from
``types.xsd``.  We'll need to update the documentation to reflect this
change, but for now we need to remove the doc build error.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-02-18 17:04:33 -08:00
Yuanyuan Zhao 34037b88e0 config tool: modify ivshmem config for scenario.xml
Rewrite the configuration of ivshmem in scenario.xml according to
the format of new UI design.

Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-18 18:42:00 +08:00
Yuanyuan Zhao 9670caabf0 config tool: ivshmem: new design for ivshmem
According to the new design of DX, implement ivshmem configuration
and generate hv related files.

Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-02-18 18:42:00 +08:00
Mingqiang Chi 3d5c3c4754 hv:fix violations of coding guideline C-ST-04
The coding guideline rule C-ST-04 requires that
a 'if' statement followed by one or more 'else if'
statement shall be terminated by an 'else' statement
which contains either appropriate action or a comment.

Tracked-On: #6776
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
2022-02-18 18:41:07 +08:00
Chenli Wei b7a99f4530 hv: replace the CONFIG_PLATFORM_RAM_SIZE with get_e820_ram_size for vept
Now the vept table was allocate dynamically, but the table size of vept
was calculated by the CONFIG_PLATFORM_RAM_SIZE which was predefined by
config tool.

It's not complete change and can't support single binary for different
boards/platforms.

So this patch will replace the CONFIG_PLATFORM_RAM_SIZE and get the
top ram size from hv_E820 interface for vept.

Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-02-18 18:39:43 +08:00
Chenli Wei 5432b52b12 hv: replace the CONFIG_PLATFORM_RAM_SIZE with get_e820_ram_size for ept
Now the EPT module use predefined parameter "CONFIG_PLATFORM_RAM_SIZE"
to calculate the ept table size.

After change the EPT table to dynamic allocate to support single binary
for different boards/platforms, the ept table size should dynamic
calculate too.

So this patch replace CONFIG_PLATFORM_RAM_SIZE by the hv_e820_ram_size
to get the RAM info on run time.

Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-02-18 18:39:43 +08:00
Chenli Wei 148a3d334c hv: replace the CONFIG_PLATFORM_RAM_SIZE with get_e820_ram_size for mmu
CONFIG_PLATFORM_RAM_SIZE is predefined by config tool and mmu use it to
calculate the table size and predefine the ppt table.

This patch will change the ppt to allocate dynamically and get the table
size by the hv_e820_ram_size interface which could get the RAM
info on run time and replace the CONFIG_PLATFORM_RAM_SIZE.

Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-02-18 18:39:43 +08:00
Chenli Wei 22e08d541f hv: calculate hv_e820_ram_size dynamically
The e820 module could get the RAM info on run time, but the RAM size
and MAX address was limited by CONFIG_PLATFORM_RAM_SIZE which was
predefined by config tool.

Current solution can't support single binary for different boards or
platforms and the CONFIG_PLATFORM_RAM_SIZE can't matching the RAM size
if user have not update config tools setting after the device changed.

So this patch remove the CONFIG_PLATFORM_RAM_SIZE and calculate ram
size on run time.

Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
2022-02-18 18:39:43 +08:00
Geoffroy Van Cutsem 8a5f25e835 Makefile: put 'serial.conf' in final location
The 'serial.conf' file need to be put in /etc/, but it is currently being
installed in $(libdir)/acrn/. We therefore ask the user to manually copy that
file over to the /etc/ folder. This patch fixes that by installing
'serial.conf' directly there.

Tracked-On: #7107
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-02-18 18:38:45 +08:00
wenlingz 28148dd3a2 Add codeowner
Tracked-On:#5581
Signed-off-by: wenlingz <wenling.zhang@intel.com>
2022-02-18 18:34:29 +08:00
Xiangyang Wu 53dd2954d2 doc: add libcjson-dev installation in GSG
Libcjson package is needed to build command monitor of DM,
so this should be installed in the user's development machine.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2022-02-18 18:33:52 +08:00
Xiangyang Wu 515bb22e06 Deb: install libcjson package in service VM automatically
Libcjson package is needed by command monitor of DM, so this
should be installed in the target platform.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2022-02-18 18:33:52 +08:00
Xiangyang Wu cc2efdc049 DM: add DM parameter for command monitor
Libvirt or kata container needs to send some commands
(such as VM destory command) to the DM instance of User VM
through command monitor socket, they will specify the socket
path and pass this path name to DM instance through DM parameter.

In this patch, add new DM parameter (cmd_monitor) to get socket
path from libvirt or kata container. If cmd_monitor is specified,
it initialize and deinitialize command monitor in DM main loop.

v2-->v3:
	Include command monitor initialization and deinitialization.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-18 18:33:52 +08:00
Xiangyang Wu 02e94b1537 DM: add new monitor module
This monitor module is to initialize socket intance, register
handlers to handle command from socket message, close socket,
free socket instance:
init_cmd_monitor: initialize socket intance and register handlers
to handle command.
deinit_cmd_monitor: close socket and free socket instance.

In this patch DM makefile is updated to build command monitor.

v1--v2:
	Update socket path and update log message format.
	Parse JSON format command message using libcjson lib APIs.
v2-->v3:
	Use socket path length MACRO.
	Update JSON format command message to {"command": "xxx"}.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-18 18:33:52 +08:00
Xiangyang Wu b448567784 DM: add command handler for command monitor
The command handler is to implement handlers for each command,
currently, two handler is implemented for command monitor:
user_vm_destroy_handler: the handler is for user VM destroy command,
which shuts down to standard post-launched user VM forcefully.
user_vm_blkrescan_handler: the handler is for user VM blkrescan
command, which rescan virtio-blk device to revalidate and update
the backend file for user VM.

v1--v2:
	Update log message format.
	Generate JSON format ack message using libcjson lib APIs.
v2-->v3:
	Update ACK message to {"ack": 0} or {"ack": -1}

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-18 18:33:52 +08:00
Xiangyang Wu a31bd7bb0d DM: add command module for command monitor
The command module provides interfaces to find a command
intance, register handler for specified command, dispatch
command and invoke related handler.
find_command: find a command instance by name.
register_command_handler: register the handler for one
command instance.
dispatch_command_handlers: dispatch the command and invoke
registered handler.

v1-->v2:
	Only support single handler for one command instance.
v2-->v3:
	Remove command id.
	Add error check to avoid regiter handler to command
	instance which has handler.
	Update the second parameter type of register_command_handler
	to avoid unnecessary type conversion.

Tracked-On: #5921

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-02-18 18:33:52 +08:00