Commit Graph

8030 Commits

Author SHA1 Message Date
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
Zhao Yakui 64ecf193e4 ACRN:DM:PCI: Load rom_file and map it into PCI ROMbar
PCI ROM is the firmware specific to PCI device and it is provided by
the device vendor. The PCI rom resides in 0x30 offset of PCI config space.
This can be used to check whether the PCI rom exists. And when it exists,
it can load the firmware from the addr that is obtained from ROM bar addr.

For the user-vm, it will try to load the rom_file for the given PCI device and
enable the VM to access the firmware that is defined in rom_file.

BTW: The emulated rom_file is converted from efi image by using EfiRom. It has
no dependency on the ROM bar of physical PCI devices. Of course if the physical
PCI devices supports the ROM bar, the rom_file can also be dumped from the PCI
rom.

Now this is limited to PCI display device.

V2->V3: Add the function of pci_load_rombar/pci_release_rombar to handle the
	rombar in course of passthrough_init/deinit.

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 270aaf82d8 ACRN:DM:PCI: Add the support of allocating resource for PCI ROM bar
Now the device model only supports the 0..5 PCI bar for PCI/PCIE devices.
This tries to allocate the PCI_MEM32 resource for PCI ROM bar.

V1->V2: Use the PCI_ROMBAR as bar index and PCIBAR_ROM bar type when calling
the pci_emul_alloc_bar to allocate the guest physical addr for PCI ROM bar.
And it will allocate the resource from PCIBAR_MEM32 region.

V2->V3: Add more comments that describes the parameter of pci_emul_alloc_bar.

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
Chuang Ke 50cdcb3660 [config_tool] Message when CAT not supported
use better wording instead the message when CAT not supported

Tracked-On: #8136
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
2022-09-22 23:14:01 +08:00
Reyes, Amy dc6fccfa0d doc: Editorial changes to hypercall hld
Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-21 09:18:37 -07:00
Junjie Mao 245951f8ea doc: add hypercall ABI in the HLD
The application binary interface (ABI) is an important aspect of
hypercalls. But unfortunately it is not yet defined anywhere in the current
HLD.

This patch adds the current ABI specification to the hypercall section of
HLD.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-09-21 08:16:56 -07:00
Chuang Ke a35f3c0d65 [config_tool] vCAT widget behavior
let vCAT chunk no longer  fixed-drag

Tracked-On: #8187
Signed-off-by: Chuang-Ke <chuangx.ke@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-09-21 16:51:03 +08:00
Junjie Mao 3a4b84e078 config_tools: handle multiple xs:documentation properly
With multiple xs:documentation nodes under the same xs:annotation, xs2js
will convert the XML into a dict where the key `xs:documentation` maps to a
list rather than a string. This patch enhances the converter.py to handle
such case properly.

Tracked-On: #8098
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2022-09-21 15:15:38 +08:00
Conghui 91cc0d5bf8 dm: iothread: fix bug in iothread handler
Fix the bug in iothread handler, the event should be read out so that the
next epoll_wait not return directly as the fd can still readable.

Tracked-On: #8181
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-09-21 12:29:07 +08:00
Conghui fcd92f1c2f dm: virtio-blk: fix parameter err
Fix the truncate issue for virtio block parameter.

Tracked-On: #8162
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-09-21 12:29:07 +08:00
Reyes, Amy c6cbd6b6df doc: Update sample app
- Minor editorial changes
- Improve image quality

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-20 13:18:09 -07:00
Wu Zhou 6a430de814 hv: remove CPU frequency control from guests
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 remove guest's ability to control CPU frequency by
removing the guests' HWP/EIST CPUIDs and blocking the related MSR
accesses. Including:
  - Remove CPUID.06H:EAX[7..11] (HWP)
  - Remove CPUID.01H:ECX[7] (EIST)
  - Inject #GP(0) upon accesses to MSR_IA32_PM_ENABLE,
    MSR_IA32_HWP_CAPABILITIES, MSR_IA32_HWP_REQUEST,
    MSR_IA32_HWP_STATUS, MSR_IA32_HWP_INTERRUPT,
    MSR_IA32_HWP_REQUEST_PKG
  - Emulate MSR_IA32_PERF_CTL. Value written to MSR_IA32_PERF_CTL
    is just stored for reading. This is like how the native
    environment would behavior when EIST is disabled from BIOS.
  - Emulate MSR_IA32_PERF_STATUS by filling it with base frequency
    state. This is consistent with Windows, which displays current
    frequency as base frequency when running in VM.
  - Hide the IA32_MISC_ENABLE bit 16 (EIST enable) from guests.
    This bit is dependent to CPUID.01H:ECX[7] according to SDM.
  - Remove CPID.06H:ECX[0] (hardware coordination feedback)
  - Inject #GP(0) upon accesses to IA32_MPERF, IA32_APERF

Also DM do not need to generate _PSS/_PPC for post-launched VMs
anymore. This is done by letting hypercall HC_PM_GET_CPU_STATE sub
command ACRN_PMCMD_GET_PX_CNT and ACRN_PMCMD_GET_PX_DATA return (-1).

Tracked-On: #8168
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2022-09-21 03:48:58 +08:00
Reyes, Amy f0eddc6a4c doc: Update acrnctrl readme
- Update broken link and minor editorial changes

Tracked-On: #8172

Signed-off-by: Reyes, Amy <amy.reyes@intel.com>
2022-09-20 09:09:47 -07:00