The socket module is to provide interfaces below, the unix domain
socket can be created by command monitor for the communication
between DM instance and libvirt daemon or kata container:
init_socket: allocate a new socket instance according to socket path
deinit_socket: free a socket instance
open_socket: open one unix domain socket server, initialize a
socket, create one thread to listen to client, another thread to
poll message from client.
close_socket: close one unix domain socket server
find_socket_client: find socket client instance according to fd
write_socket_char: send message through unix domain socket server
v1--v2:
Update some log message format and copyright format.
v2-->v3:
Update SOCKET_MAX_CLIENT to 1H since the socket instance of
command monitor only have one client (libvirt or kata container).
Tracked-On: #5921
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Since PR 7081 has updated the dm parameter`lapic_pt` usage,
according to the new design, we add the`--rtvm` parameter
for Hard RT in launch script generation logic.
Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Enable `lapic_pt` automatically for rtvm for better performance.
Reserve `--lapic_pt` for future use. If VM is not in realtime mode,
`--lapic_pt` will cause a warning.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
category based on different log levels:
1) If the board inspector show CRITICAL error messages, it means that the
board inspector tool exit instantly and generate no file.
2) If the board inspector show ERROR messages, it means that the board
inspector will generate the board XML file successfully, but several conditions
may result in ACRN build or boot failure cannot continue execution due to the error.
3) If the board inspector show WARNING messages, this means that the board inspector
generate the board XML file successfully, but this board XML file is lack of
some feature which could still boot ACRN but loss some features.
4) If the board inspector show INFO messages, this means that board inspector
printed out some normal information.
5) If the board inspector show DEBUG messages, this means that it is used to
debug board inspector workflow.
v1->v2
1. Keep the assertions or exceptions under the acpiparser, inspectorlib
and smbiosparser directory.
2. Exit after all check_deps() completes instead of any unsatisfied dep
is identified.
3. As Amy's advice, Replace the message "{board_xml} saved successfully" with
the message "SUCCESS: Board configuration file <file name> generated successfully
and saved to <path>."
To do:
Print all messages using the colored font.
Tracked-On: #6689
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Bring all the cores up in the beginning of the board_inspector.py
It is expected to run board_inspector in clean and native environment.
To resolve the issue that user may run other jobs which puts cores
offline, bringing up all cores online so tool can run cpuid to extract
all available cores information.
Tracked-On: #7119
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>
Clarify that ``cpu-checker`` is the package that you install to get the
``kvm-ok`` tool used in these instructions.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
For platforms which have apicv post-interrupt capability;
ACRN would use posted-interrupt to notify another vCPU which in non-root mode;
or sync interrupt for itself when it in root-mode.However,QEMU could not handle this properly.
So, remove the post-interrupt capability in qemu cmdline.
Signed-off-by: fuzhongl <fuzhong.liu@intel.com>
Reviewed-By: Li, Fei <fei1.Li@intel.com>
A shortcut to find the :ref:`labelname` value to link to an HTML page is
to view the source .rst file for that page. This patch tweaks the
conf.py to do just that.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
In function mk_dir(), handler 'dir' returned
by opendir() is not released before function
return and results in memory leakage.
Tracked-On: #7098
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
In function probe_disk_log_file(), handler 'dir'
returned by opendir() is not released before
function return and results in memory leakage.
Tracked-On: #7098
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
By default, pCPU is allowed to request software SRAM buffer
from given region in TCC buffer driver only if this pCPU is
set in the target region's CPU affinity configuration.
This check shall be disabled for software SRAM virtualization
usage in ACRN service VM, because software SRAM buffers are
requested by ACRN DM on behalf of user VM, but ACRN DM and
user VM may run on different CPUs while the target software
SRAM region may be configured only for pCPUs that user VM runs on.
This patch turns off such affinity check in TCC driver when
initializing vSSRAM for user VM.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
In 10-processors.py, level_types is an unordered dictionary from level type
encodings to human-readable terms, not a list. It is thus illegal to access the
highest level using the `[-1]` notation.
This patch fixes this by calculating the highest level in level_types and use
that level as the index instead.
Tracked-On: #6689
Fixes: b5b22bf98 ("board_inspector: avoid hard-coded topo level names")
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Sometimes the memory to be allocated is not at the end of an entry,
that means we have to break one enty into 2 smaller entries, there
are two ways to add the new entry to hv_e820, adds to the end or
insert it.
The initial e820 table is ordered, that's why the e820_alloc_memory
interface asssum all entries was sorted, but add new entry to the
end will break the orde of hv_e820.
So we use insert_e820_entry to replace the add_e820_entry, the new
interfeac will keep the orde and users do not need sort again after
alloc region
Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei<chenli.wei@linux.intel.com>
HC_GET_PLATFORM_INFO hypercall is not supported anymore,
hence to remove related function and data structure definition.
Tracked-On: #6690
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
The current mac detection logic only check whether there are parameters
after tap opt. Don't care whether the parameter is MAC or not, then
mac_provided will be set to 1, which will disable the mac_seed setting
when using sub parameters
This patch will check opt and fix the above issue.
Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Manually specifying MAX_IOAPIC_NUM and MAX_IOAPIC_LINES in a scenario XML
is still usable as a workaround on boards without IOAPIC (e.g. emulated
ones) or when the board inspector does not collect IOAPIC information
correctly.
This patch takes user-specified values of those items if
provided. Otherwise the automatically calculated values will be used
instead, as is done today.
Tracked-On: #6986
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Today the config.h/config.mk generators do not put a newline after an entry
without a value, which causes the generated files ill-formed.
This patch fixes the issue by putting a newline at the end of an entry
unconditionally.
Tracked-On: #6355
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
In XSL a string variable can be nul, the empty string or a non-empty
string. While `$var != ''` ensures that `var` is a non-empty string,
`$var = ''` is true only when `var` holds the empty string. In other words,
`$var = ''` and `$var != ''` can be both false if `var` evaluates to nul.
As a result, the config.h/config.mk generating scripts does not use the
given default value if the explicit value is nul.
This patch fixes the incorrect comparison in the XSL scripts that handles
default values, so that the default value behaves as expected.
Tracked-On: #6355
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
The board configuration generator assumes all PCI BARs are programmed when
the board inspector runs, which is sometimes not the case. Unprogrammed
BARs will be reported using plain texts wrapped by angle brackets in the
output of `lspci`.
This patch gracefully skips the unprogrammed BARs and continues when
parsing the output of `lspci`, in order to avoid build-time failures due to
unprogrammed BARs.
Tracked-On: #6355
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
While the terms to refer to CPU topology levels are originally borrowed
from MSR listings in SDMs (i.e. thread, core, die and package), we now
align the topology information with the CPUID topology enumeration
leaf (which does not have a "package" level) in the
implementation. However, some hard-coded level types are not updated
accordingly, leading to strangely organized nodes in the generated board
XML.
This patch refines the CPU extractor of the board inspector by removing
such hard code. Also the XPATH counting the total number of threads is
refined to tolerate the variance of reported intermediate levels.
Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Not all pci hostbridge has a device on it. Remove the logic which
assumes there is at least one device.
Tracked-On: #7077
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>
This API depends on GET_PLATFORM_INFO ioctl command,
which will not be supported from ACRN HSM anymore.
This patch removes the definition of it and
also cleans related data structure.
Tracked-On: #6690
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
GET_PLATFORM_INFO IOCTL syscall will not be supported
from ACRN HSM driver, while vm_get_config() API depends
on it hence shall be removed.
Without vm_get_config(), vm_get_cpu_affinity_dm() is used
to get guest CPU bitmask.
Tracked-On: #6690
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Update the usage of cpu affinity param in launch script generation logic,
use apic_id got from board XML file instead of pcpu id from scenario XML
file according to the refined usage '--cpu_affinity lapic_id'.
The generated script will look like this:
`--cpu_affinity 0,2 \`
Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Cpu affinty was set by pcpu id which can't be obtained
explictly by user. Use lapic id instead which can be easily
read from `/proc/cpuinfo` as `apicid`.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
The GET_PLATFORM_INFO will be removed from hypervisor. The acrn-dm can
only refer to Service VM's resources from now, all the resources out of
Service VM are not awared by acrn-dm. The original info got from
GET_PLATFORM_INFO needs to changed to Service VM's perspective like lapic id.
The pcpu_id is the index of lapic instance in MADT table. This patch
parses the Service VM's MADT table to convert the pcpu_id to lapic_id instead
of GET_PLATFORM_INFO.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
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
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
fix bug: if PTM-CAP device, like TSN in multi-hostbridge could cause
acrn-dm crash.
original PTM PCI code has not handled multi-hostbridge case, and just
handled hostbridge (00:00.0) case.
this patch calls PCI access API to handle PTM-CAP device/bridge
(root port) structure, to avoid scan PCI hierarchical.
Tracked-On: #7045
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
qemu build fail with the old board xml.
this should be re-generated by the latest board inspector tool
which include the changes in PR#7067
Tracked-On: #7058
Signed-off-by: zhongzhenx.liu <zhongzhenx.liu@intel.com>
As a parameter of acrn-dm,the mac_seed is only used for virtio-net.
So this patch change it to the sub-parameter of virtio-net.
Tracked-On: #6690
Acked-by: Yu1 Wang <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Remove device name requirement for “tap” and "vmnet", change the
parameter format like:
"-s 4,virtio-net,tap/vmnet=dev_name".
Tracked-On: #6690
Acked-by: Yu1 Wang <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
The interrupt pin descriptors in board XML follows the same notation as in
ACPI PRT (PCI Routing Table), i.e. either an integer or a pair of a device
object and an index.
However, the current static INTx allocator recognizes
integer-as-interrupt-line only, which will cause build-time failure if
the "device object + index" notation is used in physical DSDT to describe
PCI interrupt pin routing.
This patch refines the static allocator so that both notations can be
parsed properly. In case an interrupt line descriptor in the board XML
refers to an device object without an index, it is interpreted as the first
of the ACPI device object if it is an interrupt resource.
Tracked-On: #7058
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
INTx routing can be specified in ACPI PRT (PCI Routing Table) in two ways:
1. By an absolute interrupt line from the global interrupt pool.
2. By a device object and an index to its interrupt resource.
The board inspector today only encodes the source object of an interrupt
pin routing in XML device resource descriptors, which is incomplete if the
source is a device object (i.e. case 2 above).
This patch adds the index from PRT to device resource nodes as well.
Tracked-On: #7058
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Include the project's GitHub README that contains community support and
resource information into the ACRN Introduction documentation. Also fix
the ACRN misspelling.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Current mmu assum the high memory start from 4G,it's not true for some
platform.
The map logic use "high64_max_ram - 4G" to calculate the high ram size
without any check,it's an issue when the platform have no high memory.
So this patch add high64_min_ram variable to calculate the min address
of high memory and check the high64_min_ram to fix the previou issue.
Tracked-On: #6690
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Since PR #7035 has removed "pm_notify_channel" and "pm_by_vuart"
in the launch script generation logic, this patch also removes
the related elements("poweroff_channel" and "allow_trigger_s5")
in the documentation.
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Cpu affinty was set by pCPU ID which can't be obtained
explictly by user. Use lapic ID instead which can be easily
read from `/proc/cpuinfo` as `apicid`.
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Update the instructions on how to start the ACRN Configurator tool
('acrn_configurator.py'). It is no longer require to use 'python3 ...'
since we've added a shebang header to the file and made it executable.
Tracked-On: #7057
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Add the shebang header (for Python) and make the acrn_configurator.py
executable so it can more easily be run as in './acrn_configurator.py'
Tracked-On: #7057
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Today the XML validation logic is embedded in scenario_cfg_gen.py which is
highly entangled with the Python-internal representation of
configurations. Such representation is used by the current configurator,
but will soon be obsolete when the new configurator is introduced.
In order to avoid unnecessary work on this internal representation when we
refine the schema of scenario XML files, this patch separates the
validation logic into a new script which can either be used from the
command line or imported in other Python-based applications. At build time
this script will be used instead to validate the XML files given by users.
This change makes it easier to refine the current configuration items for
better developer experience.
Migration of existing checks in scenario_cfg_gen.py to XML schema will be
done by a following series.
v2 -> v3:
* Keep Invoking asl_gen.py to generate vACPI tables for pre-launched VMs.
v1 -> v2:
* Remove "all rights reserved" from the license header
* Upgrade the severity of the message indicating lack of xmlschema as
error according to our latest definitions of log severities, as
validation violations could indicate build time or boot time failures.
Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
1. for the `virtio-net`, add type field to specify tap/macvtap type.
The generated script will look like this. (eg. -s 4,virtio-net,tap=Waag)
2. Change mac_seed as virtio-net subparameter.
(eg. -s 10,virtio-net,tap=YaaG3,mac_seed=XXXXXX)
Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Rename '--virtio_msix' to '--virtio_msi' for this param
means 'force virtio to use singel-vector MSI'.
Remove the `-W` which is the short version of `--virtio_msi`.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Rename '--virtio_msix' to '--virtio_msi' for this param
means 'force virtio to use singel-vector MSI'.
`-W` is the short version of `--virtio_msi`. But it's
confusing that `-W` and `--virtio_msi` are irrelevant literally.
So remove the short version `W` to prompt user friendliness.
Tracked-On: #6690
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>