Commit Graph

8290 Commits

Author SHA1 Message Date
Na Cui
732865a4da doc: update optional arguments for passthrough devices
This patch adds the description of newly added optional parameters for
PCI device passthrough. The new parameters are related to irq and
acpi dsdt info, which are designed for the passthrough of LPSS devices.

Tracked-On: #8615

Signed-off-by: Na Cui <na.cui@intel.com>
2025-08-19 07:49:23 +00:00
Jiaqing Zhao
f9725dd334 hv: reserve hypervisor region in e820 table
Mark hypervisor memory region as unusable in its e820 table to avoid
being overlapped by e820_alloc_memory(). As it is already filtered out
in hypervisor e820 table, there is no longer need to filter it out in
service VM e820.

Tracked-On: #8738
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2025-08-19 07:49:23 +00:00
Jiaqing Zhao
1c7e1a192b hv: refactor hypervisor image size helper function
The hypervisor image size is determined at link time, but now it is
calculated and stored in a global variable during mmu initialization,
and the helper function reads from that variable. Change to calculate
it inside helper function to avoid inconsistency.

Tracked-On: #8738
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2025-08-19 07:49:23 +00:00
Jiaqing Zhao
3c6aa23ab2 hv: instr_emul: Correct handling of instruction length
The VM-exit instruction length(VMX_EXIT_INSTR_LEN) in VMCS is undefined
on EPT violation, except during delivery of a software interrupt,
privileged software exception, or software exception[1]. Although CPU
is likely to set the field, it can be incorrect in certain cases, such
as cmp+jcc and test+jcc.

Since hypervisor does not know exactly how much bytes needed, and GVA
translation is costly, it first copies at most 15 (VIE_INST_SIZE) bytes
within the page, then decodes the instruction. If more bytes are needed
during decoding and copied length is less than 15, it copies remaining
bytes.

[1] 29.2.5, https://cdrdv2-public.intel.com/671200/325462-sdm-vol-1-2abcd-3abcd.pdf

Tracked-On: #8756
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
2025-08-19 07:49:23 +00:00
Haoyu Tang
fa8cf2f1ff hv: bzimage_loader clear zero-page with 4k size
MEM_4k is used to create zero-page, clear it with same size.

Tracked-On: #8765
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
2025-08-19 07:49:23 +00:00
Jiaqing Zhao
47027892a5 hv: pm: fix acpi register size calculation
The Access Size field in ACPI GAS was not introduced before ACPI 2.0,
Errata C. It is not guaranteed to be a non zero value, like QEMU
programs it to 0. As it only indicates how many bytes it can be
accessed at once, the register size should be determined by Bit Width
and Bit Offset. In IO space, Bit Offset is always 0, the size is
(Bit Width / 8).

Tracked-On: #8771
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
Reviewed-by: Li Fei <fei1.li@intel.com>
2025-08-19 07:49:23 +00:00
Victor Sun
944d83d6e8 update CODEOWNERS
Tracked-on: #5581

Signed-off-by: Victor Sun <victor.sun@intel.com>
2025-08-18 14:26:03 +08:00
YuanXin-Intel
78bf76e467 dm: fix the issue that RTVM cannot bring up with io uring
Device model uses polling mode to fetch the virtio blk request in RTVM.
When RTVM brings up with io uring, the threads handling io uring and vq are
not same, which would cause competition. To fix this issue, device
model should handle vq and io uring in the same thread to avoid conflict.

Tracked-On: #8737

Signed-off-by: YuanXin-Intel <xin.yuan@intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
2025-05-23 10:06:16 +08:00
dongpingx
60fc6c2bc4 misc: upgrade dependency for acrn-configurator
upgrade crossbeam-channel to 0.5.15 which is used by tauri's component `tao`

Tracked-On: #8769
Signed-off-by: DongpingX Wu <dongpingx.wu@intel.com>
2025-04-15 16:36:04 +08:00
dongpingx
a737902715 misc: upgrade two dependencies for acrn-configurator
upgrade openssl to 0.10.72
upgrade tokio to 1.43.1

Tracked-On: #8768
Signed-off-by: DongpingX Wu <dongpingx.wu@intel.com>
2025-04-09 15:21:03 +08:00
Yichong Tang
27aee66f88 hv: hyperv: Add hyperv page destory function
In current code process, hyperv data in struct vm_arch is never cleared
during VM shutdown and is retained to next VM launch. As the enabled
bit of hypercall_page msr is not clear, hypercall page might cause fatal
error such as Windows VM BSOD during VM restart and memory
remapping. Hyperv page destory function can ensure hyperv page is
destory during each VM shutdown so hyperv related config such as
hypercall page is established correctly during each VM launch.

Tracked-On: #8755
Signed-off-by: Yichong Tang <yichong.tang@intel.com>
2025-03-10 15:36:03 +08:00
Yifan Liu
11d7c0dcb3 dm: Fix concurrent acrn-dm hugetlb init race
During init of hugetlb we check and create /run/hugepage/acrn folder.
Concurrent acrn-dm instances might race between the time of check and
create.

This commit ignore EEXIST error when creating directory.

Tracked-On: #8764
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2025-03-07 17:20:56 +08:00
Haoyu Tang
bff0493d25 hv: fix stac/clac context in get_initrd_load_addr()
Tracked-On: #8761
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
2025-02-24 16:44:22 +08:00
dongpingx
ef49283e51 misc: resolve dependabot alerts
upgrade nanoid to 3.3.8
upgrade idna to 1.0.0
upgrade vite to >=3.2.11, actually locked at 6.0.3
upgrade rollup to >=2.79.2, actually locked at 4.28.1

Tracked-On: #8751
Signed-off-by: dongpingx <dongpingx.wu@intel.com>
2024-12-19 21:51:42 +08:00
yuhuanX
e8b100aab2 doc: Change TSC Chair from Junjie to Yu due to job change.
Tracked-On: #8746
Signed-off-by: YuhuanX Huang <yuhuanx.huang@intel.com>
2024-11-04 12:06:34 +08:00
Haiwei Li
95859dea34 doc: add module design for peripheral ivshmem device
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in
vp-dm_vperipheral ivshmem module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-10-09 09:50:54 +08:00
Zhang Chen
b55440dce9 config_tools: Add ivshmem region ID to launch script
Add missed ivshmem region ID. If no region ID in scenario,
will set 0 as default.

Tracked-On: #8645

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-09-23 02:06:18 +08:00
Gao, Shiqing
9d7f14e783 hv: release: fix the compilation error
This patch fixes the following compilation error when including
`release/uart16550.c` into the module test.

./release/uart16550.c:14:6: error: conflicting types for ‘get_pio_dbg_uart_cfg’; have ‘bool(uint64_t *, uint64_t *)’ {aka ‘_Bool(long unsigned int *, long unsigned int *)’}
   14 | bool get_pio_dbg_uart_cfg(__unused uint64_t *pio_address, __unused uint64_t *nbytes) {
      |      ^~~~~~~~~~~~~~~~~~~~

./include/debug/uart16550.h:142:6: note: previous declaration of ‘get_pio_dbg_uart_cfg’ with type ‘bool(uint16_t *, uint32_t *)’ {aka ‘_Bool(short unsigned int *, unsigned int *)’}
  142 | bool get_pio_dbg_uart_cfg(uint16_t *pio_address, uint32_t *nbytes);
      |      ^~~~~~~~~~~~~~~~~~~~

Tracked-On: #861

Signed-off-by: Gao, Shiqing <shiqing.gao@intel.com>
2024-09-18 15:57:33 +08:00
David B. Kinder
4d2537aafe doc: remove me from CODEOWNERS
I retired from Intel as of Sep 30, 2024

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2024-09-17 16:52:49 -04:00
Jiaqing Zhao
8aca9eb12f dm: uart: add escape sequence Ctrl-a x to exit dm
When guest console is redirected to stdio, Ctrl-c is also passed to
guest. Add escape sequence Ctrl-a x to send SIGINT to exit acrn-dm
in such case.

Tracked-On: #8731
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
2024-09-14 10:03:52 +08:00
Yuan Lu
dbc3ff39aa hv: vm_reset: simulate RESET_CONTROL(0xCF9) register
Add reset_control in acrn_vm. Use this reset_control to simulate
RESET_CONTROL(0xCF9) register in hypervisor.

Tracked-On: #8724
Signed-off-by: Yuan Lu <yuan.y.lu@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-09-12 14:09:17 +08:00
Haiwei Li
fcffdf8dbd misc: fix two IOAPIC related configs
For Service VM, the I/O APIC number and RTE number are from platform.
Otherwise, hypervisor emulates one I/O APIC and 48 RTEs. But
'MAX_IOAPIC_NUM' is always 1 and 'MAX_IOAPIC_LINES' is always 120 for
now.

This patch is introduced to fix these issues.

Tracked-On: #8725
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
Suggested-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-09-11 15:10:45 +08:00
Yonghua Huang
7d15cc5255 doc: add IVSHMEM region ID support
Add guide to configure IVSHMEM Region ID.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2024-09-11 13:45:46 +08:00
Jiaqing Zhao
eae668268e hv: handle reboot from Service VM properly
Service VM may write 0x6 to port 0xcf9 to trigger a warm reset, but
current hypervisor always performs a cold reset by writing 0xE to CF9.
Hypervisor should reboot the system in the same mode as Service VM
specified. Specific OS features (like linux pstore) requires warm
reset to keep data across reboot.

The behavior of hv console's reboot command (cold reset) remains
unchanged.

Tracked-On: #8539
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-09-09 14:37:16 +08:00
Haiwei Li
17c4ce75a1 hv: cpuid: expose CPUID.EAX=07H subleaf to VMs
Per SDM, VPDPBUSD/VPDPBUSDS/VPDPWSSD/VPDPWSSDS instructions depend on
CPUID Feature Flag 'AVX-VNNI, AVX512_VNNI, AVX512VL'. 'AVX512_VNNI' and
'AVX512VL' are already exposed to any VM.

'AVX-VNNI' is in CPUID.(EAX=07H,ECX=1):EAX.AVX-VNNI[bit 4]. This patch
is to expose all the CPUID.EAX=07H subleaf features to VMs.

Mask corresponding bits if want to disable some features in the future.

Tracked-On: #8710
Reviewed-by: Fei Li <fei1.li@intel.com>
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-09-09 14:03:51 +08:00
Haiwei Li
1571a6d5f2 doc: add module design for peripheral vhost_bridge device
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in
vp-dm_vperipheral vhost_bridge module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-09-03 09:51:43 +08:00
Haiwei Li
9a4c41cdc4 hv: vhostbridge: add comments to clarify the statement
A vhostbridge can be emulated in hypervisor. Function `init_vhostbridge()` is
used to initialize a virtual host bridge and it configures the PCI configuration
space.

However, some configuration elements are not clearly described, which affects
maintainability and readability. This patch add some comments to address it.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-09-03 09:51:43 +08:00
Haoyu Tang
fa1f2ba7df local_gva2gpa_common: optimize code
Remove unreachable code branch in line 163:
if CR0 enabled WP, supervisor-mode writing a read-only page have
been checked in line 109.

Merge redundant checking:
if smap is enabled, supervisor-mode can't access user-mode address
when eflags.ac disabled.

Tracked-On: #8708
Signed-off-by: Haoyu Tang <haoyu.tang@intel.com>
2024-08-30 15:19:51 +08:00
caixuanx
0198edf145 doc: modify v3.3 release notes
Delete the redundant field "Celadon" in "Enabling Celadon as User VM"
2024-08-26 13:39:49 +08:00
Yi Sun
e07a9618f9 hv: ENODEV should be able to be set into RAX as hypercall return value
Some hypercalls return -ENODEV which should be set into RAX as return
value, e.g. HC_ASSIGN_PCIDEV. So, remove the check in
vmcall_vmexit_handler() and change return value to -EACCESS if the
hypercall is not sent from Service VM or allowed VM.

Tracked-On: #8598
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
2024-08-23 10:14:14 +08:00
Haiwei Li
aba53e78ef doc: add module design for peripheral vuart device
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in
vp-dm_vperipheral vuart module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-08-20 17:23:42 +08:00
Haiwei Li
436cb9cddf doc: add module design for peripheral vpci_bridge device
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in
vp-dm_vperipheral vpci_bridge module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-08-20 16:51:08 +08:00
Haiwei Li
172c56fe0a doc: add module design for peripheral vrtc device
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in vp-dm_vperipheral
vrtc module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-08-20 13:36:13 +08:00
Chen, Jinshi
48a102e6b0 hv: fix testability issues that impact module test
This patch fixes the following testability issues identified by the dynamic
module test.

Global variables defined in function scope cannot be referenced outside
the function, making it impossible to check the return value of these
functions.

Tracked-On: #861

Signed-off-by: Chen, Jinshi <jinshi.chen@intel.com>
2024-08-19 10:21:28 +08:00
Yuan Lu
95bfc87eec hv: hypercall: change condition for hcall_get_cpu_pm_state
After rebooting guest, CPPC initialization failed because _CST and _CPC
missed in DSDT table. When writing _CST and _CPC in DSDT table, it gets
cx_cnt or px_cnt as condition. Getting cx_cnt or px_cnt triggers
the hypercall hcall_get_cpu_pm_state. The hypercall hcall_get_cpu_pm_state
uses VM_CREATED as VM state's condition. While, after rebooting guest,
the VM state is VM_PAUSED when writing _CST and _CPC in DSDT table.
Therefore, changing VM state's condition from VM_CREATED to VM_CREATED or
VM_PAUSED for hcall_get_cpu_pm_state can solve the CPPC initialization
failed issue after rebooting guest.

Tracked-On: #8695
Signed-off-by: Yuan Lu <yuan.y.lu@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-08-16 09:21:26 +08:00
Gao, Shiqing
ce96ba3fae hv: multiboot: fix compilation error for module test
Fix below compilation error when building the module test for multiboot_priv.h.
./boot/multiboot/multiboot_priv.h: In function ‘boot_from_multiboot’:
./boot/multiboot/multiboot_priv.h:33:27: error: ‘MULTIBOOT_INFO_MAGIC’ undeclared (first use in this function)
   33 |         return ((magic == MULTIBOOT_INFO_MAGIC) && (info != 0U));

Tracked-On: #861

Signed-off-by: Gao, Shiqing <shiqing.gao@intel.com>
2024-08-15 15:21:46 +08:00
Yuan Lu
88cf1229a7 dm: acpi: support CPPC V2 capability in _OSC of DSDT for ACRN guest.
After upgrading to guest kernel 6.1.80, it checks the CPPC V2 capability
in _OSC of DSDT. To support it for ACRN guest, add CPPC V2 capability in
_OSC of DSDT. Currently we only support CPPC V2 capability in _OSC of
DSDT.

Tracked-On: #8691
Signed-off-by: Yuan Lu <yuan.y.lu@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-08-15 14:35:04 +08:00
Yonghua Huang
4e552b0785 hv: allow guest with the highest severity to read RESET_CONTROL
Guest VM, such as Linux, may read RESET_CONTROL(0xCF9) register
before writing to, in this case, ACRN should not always return
dummy value.

Tracked-On: #8688
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-08-12 10:06:15 +08:00
Jiaqing Zhao
5c351bee0f hv: vtd: allocate drhd_dev_scope based on board file
Determine the size of drhd_dev_scope based on DRHD_MAX_DEVSCOPE_COUNT
in board file instead of hardcoding. The current default value 16 will
be used if it is not defined in board file to keep compatibility, a
warning will be raised in this case.

Tracked-On: #8494
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-08-05 15:51:17 +08:00
Jiaqing Zhao
65f84d6ae6 board_inspector: generate maximum DRHD devscope count
Add a new field DRHD_MAX_DEVSCOPE_COUNT in board file representing
maximum devscope count in a DMAR structure for statically allocating
drhd_dev_scope array in hypervisor.

Tracked-On: #8494
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-08-05 15:51:17 +08:00
Jiayuan Yang
069afc6519 doc: specify numpy version in sample application guide
histapp.py cannot run on numpy>=2, thus specify numpy<2 via pip install
command.

Tracked-On: #8664
Signed-off-by: Jiayuan Yang <jiayuan.yang@intel.com>
2024-08-05 14:04:59 +08:00
Jiayuan Yang
2474421fba doc: add release note draft for release 3.3
In this release note:
1. New features
2. Configurator and Board inspector updates
3. Docs updates
4. Fixed issues and known issues

Signed-off-by: Jiayuan Yang <jiayuan.yang@intel.com>
2024-08-05 14:04:59 +08:00
Jiayuan Yang
81529af1ca doc: update SOS to 22.04.4 in GSG and sample application guide
In this guide, each VM continue to use 22.04. SOS upgrade is done in
GSG(22.04.2->22.04.4).

Tracked-On: #8664
Signed-off-by: Jiayuan Yang <jiayuan.yang@intel.com>
2024-08-05 14:04:35 +08:00
Jiayuan Yang
f189d773c7 doc: add ACRN v3.3 Maintenance hardware-rpl asus minipc
In v3.3 release, Maintenance hardware is change from Vecow to Asus mini
PC.

Tracked-On: #8677
Signed-off-by: Jiayuan Yang <jiayuan.yang@intel.com>
2024-08-05 14:04:35 +08:00
Jiayuan Yang
17d67247dc doc: revert Ubuntu24.04 support in GSG
Since Ubuntu24.04 requires 6.8 kernel(as shown in Ubuntu linux kernel
release lifecycle), we need to revert the ubuntu24.04 support in GSG to
suit our 6.1 acrn kernel.

Tracked-On: #8664
Signed-off-by: Jiayuan Yang <jiayuan.yang@intel.com>
2024-08-05 14:04:35 +08:00
Haiwei Li
fa2b8fcfbe doc: add module design for some defines in hwmgmt_page
GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

ACRN hypervisor is decomposed into a series of components and modules. The
module design in hypervisor is to add inline doxygen style comments above
functions, macros, structures, etc.

This patch is to add comments for some elements in hwmgmt_page module.

Tracked-On: #8665

Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-08-01 14:50:27 +08:00
Haiwei Li
cb431d9df4 doc: add custom commands in acrn.doxyfile
`consistency` is used to describe the consistency rule and `alignment`
is used to describe the align info.

These two are used to enhance the documentation inside a struct comment
block.

Signed-off-by: Gao, Shiqing <shiqing.gao@intel.com>
2024-08-01 13:23:21 +08:00
dongpingx
4924766b67 misc: fix openssl's vulnerability for tauri
Trivy scaned one vulnerability three days ago and we fixed it now.

The title for vulnerability is openssl's `MemBio:get_buf` has undefined
behavior with empty buffers.

I tested through building configurator, launching it and generating
scenario.xml & launch scripts. I confirmed the result is correct.

Signed-off-by: dongpingx <dongpingx.wu@intel.com>
Tracked-On: #8668
2024-07-30 10:06:31 +08:00
Jiaqing Zhao
2dc56a8f23 hv: add GUEST_FLAG_STATELESS flag
GUEST_FLAG_STATELESS indicates guest is running a stateless operating
system and need to be shutdown forcefully without data loss. This flag
is only appalicable to pre-launched VM. For TEE_VM, this flag will be
set implicitly.

Tracked-On: #8671
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2024-07-30 09:26:50 +08:00
Haiwei Li
c4ea248bc9 hv: remove Service VM delayed loading
Now multiboot modules memory is already reserved from e820 in function
`alloc_mods_memory()` and Service VM will not corrupt pre-launched VM
modules.

So remove the code of Service VM delayed loading.

Tracked-On: #8652
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
2024-07-18 11:26:49 +08:00