Commit Graph

8242 Commits

Author SHA1 Message Date
TrellixVulnTeam a4f1a2f185 Adding tarfile member sanitization to extractall() 2022-10-20 14:58:52 +08:00
David B. Kinder 6d1e24058f doc: update doc build tutorial
Update instructions for newer versions of the PyPI tools and doxygen.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-10-19 22:12:27 -07:00
David B. Kinder 38f8097b54 doc: update doc build tools for Ubuntu 22.04 and Sphinx
Update known-issues processing and tweak conf.py and requirements.txt
(for PyPI package versions) to handle a broader version of
doc-generation tools (sphinx, breathe, docutils, etc.).  This should
let us move to Ubuntu 22.04 while maintaining doc-build compatibility
with older tool versions available with Ubuntu 20.04 (doxygen in particular).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-10-19 09:37:39 -07:00
Yuanyuan Zhao b16aae48d0 config_tools: add pio serial port bdf to config.h
Add bdf info of pio serial port to config.h.

Tracked-On: #8235
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao junjie.mao@intel.com
2022-10-19 17:23:11 +08:00
Yuanyuan Zhao f9e16db9e1 config_tools: board_inspector: parse bdf for ioport serial controler
Add bdf infomation to ioport serial controler.

Tracked-On: #8235
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com>
Reviewed-by: Junjie Mao junjie.mao@intel.com
2022-10-19 17:23:11 +08:00
Chenli Wei dcb0f05efc hv: refine the sworld memory allocate
The current code uses a predefined sworld memory array to reserve memory
for trusty VMs, and assume all post launched VMs are trusty VM which is
not correct.

This patch statically reserved memory just for trusty VMs and save 16M
memory for every non trusty VM.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2022-10-19 15:58:25 +08:00
Chenli Wei 7ae785a452 misc: refine the allocate logic of offline tool
The current code use VM number to calculate HV_RAM_SIZE, this is not
match the HV logic.

This patch use the max number of trusty VMs to calculate the size of
sworld memory and assume 4M ram / VM to calculate the final ACRN ram
size.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-19 15:58:25 +08:00
David B. Kinder 4b6c782726 doc: prep for Ubuntu 22.04
These changes are compatible with both the Ubuntu 20.04 and 22.04
documentation build processes.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2022-10-18 15:20:04 -07:00
zhangrouyu ee0a1b0f1c doc:Modify the tqdm package problem in the GSG document
We have real fix in PR#8222, thus remove the workround in document.
delete the command: sudo pip3 install tqdm

Signed-off-by: zhangrouyu <rouyu.zhang@intel.com>
Tracked-On:8155
2022-10-18 15:04:11 -07:00
Junjie Mao dea357fa3b board-inspector: fix a branch condition that checks existence of HWP
Evaluating an XPATH on a tree results an empty list (rather than None) when
that tree does not contain any matching node. This patch fixes a branch
condition that does not check the XPATH evaluation result properly.

Tracked-On: #8168
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 15:56:43 +08:00
Junjie Mao 1c532da088 board_inspector: tolerate PCI functions with undefined header layout
While PCIe specification defines only type 0 and type 1 configuration space
headers, there can be cases where a PCI function has a different header
type. As an example, that device itself is under development or is a
special emulated device.

This patch makes the board inspector gracefully skips those PCIe functions
and continue scanning the rest in such cases, as the only impact of the
anomaly is the prevention of ACRN from passing through that PCIe function
to any VM. It is an overkill to crash the board inspector.

Tracked-On: #6689
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 15:56:43 +08:00
Junjie Mao 7ce49f8c3c config_tools: determine SSRAM_ENABLED automatically
Today users are able to tweak whether the hypervisor includes support to
software SRAM (SSRAM). This, however, gives rise to potential functional
incorrectness when the hypervisor is not built with such support but a
service VM attempts to assign SSRAM to a post-launched VM (which is
possible as the service VM can still see the SSRAM-related ACPI tables). In
such cases the SSRAM assigned to a post-launched VM is not properly
initialized and thus not locked in cache.

As makes little sense for a user to configure the SSRAM support in the
hypervisor in a different way as the presence of SSRAM on hardware, this
patch removes the "SSRAM support" option from the configurator. The config
tools will now automatically enable the SSRAM support if the hardware
supports the feature and disable that otherwise.

Tracked-On: #8231
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 15:20:48 +08:00
Yang,Yu-chu ce5b4435bc config-tools: add topology extract_display
This method gets connected displays andis add them as child nodes to
a corresponding graphics card.

Tracked-On: #7970
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 08:57:42 +08:00
Yang,Yu-chu b235e88f24 config-tools: add new extractors helpers
Add 2 helplers:
1. get_realpath: this method returns the realpath of paramenter
if it's a valid path string
2. get_bdf_from_realpath: this method returns the bus, device, function
number if the parameter is a path to /sys/devices

Tracked-On: #7970
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-14 08:57:42 +08:00
Chenli Wei 34e5061418 misc: modify hidden_pdev_list to fix build issue
This patch remove a invalid variable from hidden_pdev_list to fix an
build issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-10-08 17:26:08 +08:00
Wu Zhou fbdc2774af hv: add ACRN CPU frequency initializer
The design of ACRN CPU performance management is to let hardware
do the autonomous frequency selection(or set to a fixed value),
and remove guest's ability to control CPU frequency.

This patch is to implement the CPU frequency initializer, which will
setup CPU frequency base on the performance policy type.

Two performance policy types are provided for user to choose from:
  - 'Performance': CPU runs at its CPU runs at its maximum frequency.
    Enable hardware autonomous frequency selection if HWP is presented.
  - 'Nominal': CPU runs at its guaranteed frequency.

The policy type is passed to hypervisor through boot parameter, as
either 'cpu_perf_policy=Nominal' or 'cpu_perf_policy=Performance'.
The default type is 'Performance'.

Both HWP and ACPI p-state are supported. HWP is the first choice, for
it provides hardware autonomous frequency selection, while keeps
frequency transaction time low.

Two functions are added to the hypervisor to call:
  - init_frequency_policy(): called by BSP at start up time. It processes
    the boot parameters, and enables HWP if it is presented.
  - apply_frequency_policy(): called after init_frequency_policy().
    It applies initial CPU frequency policy setting for each core. It
    uses a set of frequency limits data struct to quickly decide what the
    highest/nominal frequency is. The frequency limits are generated by
    config-tools.

The hypervisor will not be governing CPU frequency after initial policy
is applied.

Cores running RTVMs are fixed to nominal/guaranteed frequency, to get
more certainty in latency. This is done by setting the core's frequency
limits to highest=lowest=nominal in config-tools.

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-10-08 11:13:21 +08:00
Wu Zhou 41b2d6baee config-tools: generate CPU frequency limits
This patch is to generates frequency limits for each CPU, as a set of
data structure in hypervisor .c code.

With the frequency limits data, the hypervisor performance manager does
not have to deal with the CPU/board info. It just choose the
highest/lowest/guaranteed performance level and performance/nominal
p-state, and use them to construct HWP_REQUEST/PERF_CTL reg value.

How are frequency limits decided:
  - For CPUs in standard VMs, frequency limits are just decided by
    CPU/board info.
  - For CPUs assigned to RTVMs, we want certainty in latency, so just
    set its frequency to nominal/guaranteed by letting highest=lowest.
  - In some cases, CPUs are sharing frequency on hardware level
    (e.g. ADL e-cores in group of 4). This is described as _PSD in ACPI
    spec, or 'frequency domain' in Linux cpufreq driver. Thoese CPUs'
    frequency are linked together. If one of them are running RTVM,
    all other CPUs in the domain should be set to the same frequency.

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-08 11:13:21 +08:00
Wu Zhou 635120e3f2 config-tools: extract CPU frequency info in board_inspector
This patch adds CPU frequency info extraction for board_inspector.

It is supposed to be used by ACRN CPU performance management.

Including those:
  - Capabilities for HWP base regs, and turbo boost, by reading cpuids.
  - Reporting all CPUID bits in LEAF 06H.
  - Max none turbo ratio and max turbo ratio, by reading MSRs.
  - HWP capabilities, by reading IA32_HWP_CAPABILITIES. Reading this
    register requires HWP enabled in IA32_PM_ENABLE. (SDM Vol3 14.4.2:
    Additional MSRs associated with HWP may only be accessed after HWP
    is enabled)
  - ACPI _PSD info, by reading sys nodes of Linux acpi-pstate driver.
    This table describes frequency domains in which CPUs shares the same
    frequency.

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-08 11:13:21 +08:00
Wu Zhou dd7a71900b config-tools: genertate performance policy parameter
This patch is to generate an ACRN CPU performance policy type boot
parameter.

The generated parameter is either 'cpu_perf_policy=Performance’ or
‘cpu_perf_policy=Nominal’, according to the 'CPU performance policy type'
config item in configurator.

It will then be packed into acrn-hypervisor deb file, and will be
automatically added to grub cfg file through installation.

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-08 11:13:21 +08:00
Wu Zhou a971e12fc6 config-tools: add CPU performance policy option
Add 'CPU performance policy type' option to configurator. User can choose
from 'Performance' or 'Nominal' as the CPU performance policy for ACRN to
apply.

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-08 11:13:21 +08:00
Yang,Yu-chu 914e7a1d25 config-tools: check if the cpu_affinity is null
The cpu_affinity is null when creating a new scenario. Do not update the
pcpu properties if the cpu_affinity is null.

Tracked-On: #8145
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
2022-10-08 10:31:11 +08:00
zhangrouyu 6a1acd7b5e revision the GSG document of ubuntu kernel version
Signed-off-by: zhangrouyu <rouyu.zhang@intel.com>
2022-09-30 09:07:38 -07:00
szhen11 724fb2739f version:3.2-unstable
Signed-off-by: szhen11 <shuang.zheng@intel.com>
2022-09-30 13:04:03 +08:00
Yang,Yu-chu 3d8ea54f74 config-tools: reserve the secondary PCI bus mmio windows
Prevent allocator to allocate PCI bus mmio windows to other devices.

Tracked-On: #8191
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-09-30 11:51:47 +08:00
zihengL1 bef352481f config-tools: Missing tqdm python package in board_inspector.deb
Added python3-tqdm depend in gen_acrn_deb.py

Tracked-On: #8155
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-09-30 11:20:46 +08:00
Chenli Wei b287e6f8ec misc: add documentation element for CACHE_REGION
Some member of CACHE_REGION have no documentation element, this cause
some issue when we generate documentation for user.

This patch add some documentation to fix the above issue.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
2022-09-30 10:49:05 +08:00
Reyes, Amy e354ed3061 doc: Editorial changes to sample app guide
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-29 08:14:52 -07:00
Reyes, Amy 3deb327177 doc: Editorial changes to Configurator doc
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-28 15:52:49 -07:00
Reyes, Amy 31331a6390 doc: Editorial changes to DM params doc
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-28 08:33:28 -07:00
Reyes, Amy 4a7c81a449 doc: Fix typos in interrupt hld
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-27 16:13:38 -07:00
Conghui 0ec9aaea6f dm: support asyncio in ioeventfd
Add a new flag in ioeventfd ioctl to support asyncio. After that, the IO
request will be processed in asyncio path by kernel and hypervisor.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-09-27 16:10:15 +08:00
Conghui 0f599e8d56 dm: add a new page for asyncio
asyncio is a new mechanism in ACRN, which is special for these devices
which need high IO performance. ACRN hypervisor would process the IO
request from User VM in an async mode.

Just like the original IOReq shared page, the devicemodel also create a
page for fastio requests. As the asyncio use the ioeventfd, so the
reuqests are handled in kernel, devicemodel only need to provide the
page.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-09-27 16:10:15 +08:00
Conghui 17f94605f0 hv: dispatch asyncio request
For an IO request, hv will check if it was registered in asyncio desc
list. If yes, put the corresponding fd to the shared buffer. If the
shared buffer is full, yield the vcpu and try again later.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-27 10:26:42 +08:00
Conghui 4c79354798 hv: add hypercall to register asyncio
Add hypercall to add/remove asyncio request info. Hv will record the
info in a list, and when a new ioreq is come, hv will check if it is
in the asyncio list, if yes, queue the fd to asyncio buffer.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-27 10:26:42 +08:00
Conghui 12bfa98a37 hv: support asyncio request
Current IO emulation is synchronous. The user VM need to wait for the
completion of the the I/O request before return. But Virtio Spec
introduces introduces asynchronous IO with a new register in MMIO/PIO
space named NOTIFY, to be used for FE driver to notify BE driver, ACRN
hypervisor can emulate this register by sending a notification to vCPU
in Service VM side. This way, FE side can resume to work without waiting
for the full completion of BE side response.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-27 10:26:42 +08:00
Conghui 9cf9606e56 hv: extend sbuf hypercall
Extend sbuf hypercall to support other kinds of share buffer.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-27 10:26:42 +08:00
Conghui efb01db779 hv: change sbuf to a common infrastructure
sbuf is now only used for debug purpose, but later, it will be used as a
common interfaces. So, move the sbuf related code out of the debug directory.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-27 10:26:42 +08:00
Reyes, Amy fcc8edac38 doc: add 3.1 to /latest header note
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-26 10:07:26 -07:00
Reyes, Amy 9f52c5c32a doc: Update v3.1 release notes
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-26 10:04:24 -07:00
Minggui Cao 6d4ca4b3a1 hv: improve smp call to support debugging RTVM
Improve SMP call to support ACRN shell to operate RTVM.
before, the RTVM CPU can't be kicked off by notification IPI,
so some shell commands can't support it, like rdmsr/wrmsr,
memory/registers dump. So INIT will be used for RTVM, which
LAPIC is pass-thru.

Tracked-On: #8207
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-26 13:28:02 +08:00
Minggui Cao bc4c773cf8 hv: add param to control INIT used to kick pCPU
By default, notification IPI used to kick sharing pCPU, INIT
used to kick partition pCPU. If USE_INIT_IPI flag is passed to
hypervisor, only INIT will be used to kick pCPU.

Tracked-On: #8207
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-26 13:28:02 +08:00
Minggui Cao 2c140addaf hv: use kick-mode in per-cpu to control kick pCPU
INIT signal has been used to kick off the partitioned pCPU, like RTVM,
whose LAPIC is pass-through. notification IPI is used to kick off
sharing pCPU.

Add mode_to_kick_pcpu in per-cpu to control the way of kicking
pCPU.

Tracked-On: #8207
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-26 13:28:02 +08:00
Reyes, Amy 39cdf6f7a6 doc: add 3.1 release docs to menu choice
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-23 22:01:45 -07:00
Reyes, Amy 88c78c9e43 doc: Editorial changes to v3.1 release notes
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-23 14:42:20 -07:00
Reyes, Amy ed9baa64ea doc: Update S5 tutorial
- Update the S5 tutorial to align with new template and GSG scenario

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-23 09:37:29 -07:00
zhangrouyu 76d8fea2ff doc: Upgrade the information about Release Notes
Signed-off-by: zhangrouyu <rouyu.zhang@intel.com>
2022-09-23 08:26:22 -07:00
zhangrouyu 4844ae4772 Update the version infomation of sample app guide
Signed-off-by: zhangrouyu <rouyu.zhang@intel.com>
2022-09-23 08:18:47 -07:00
Zhao Yakui d0720096b0 ACRN:HV:VPCI: Forward access of PCI ROM bar_reg to DM for passthru device
The access to PCI config_space is handled in HV for Passthrough pci
devices. And it also provides one mechanism to forward cfg_access of
some registers to DM. For example: the opregion reg for GPU device.

This patch tried to add the support of emulated PCI ROM bar for the
device. And it doesn't handle the phys PCI ROM bar of phys PCI devices.
At the same time the rom firmware is provided in DM and pci rom bar_reg
is also emulated in DM, this leverages the quirk mechanism so that the
access to PCI rom bar_reg is forwarded to DM.

Tracked-On: #8175
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2022-09-23 18:12:01 +08:00
Zhao Yakui 3c01a6a0cf ACRN:DM:PT: Add romfile option for rombar on GPU passthrough device
Add the option of "romfile=file_location" to specify the rom file for rombar

Tracked-On: #8175
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Wang Yu <yu1.wang@intel.com>
2022-09-23 18:12:01 +08:00
Zhao Yakui db7be2c6f6 ACRN:DM:PCI: Add the emulation of PCI rom bar register for passthru device
The pci_reg 0x30 of PCI config_space is used to check whether the PCI rom
bar is supported. When the PCI rom is supported for the device in guest vm,
the 0x30 pci_reg is emulated and it can return the addr/enable bit.

Tracked-On: #8175
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2022-09-23 18:12:01 +08:00