The vsock cid type is u64, redefine the cid type to u64, and use
dm_strtoul API replace dm_strtoi.
Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
1280x720 resolution will crash IDD of windows guest. To simplise, just
remove this mode.
Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
All the modes that vdisplay supported should be reported to driver,
then driver should select the modes which report to OS.
Tracked-On: #7507
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The virtio feature bits is 64bits but the access will be split
as two times 32bits access. This patch fixes the bug which overwrites
another side 32bits, and causes feature bits are lost.
Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This patch supports the user space logic of vhost vsock which
is majorly for its initialization phase.
Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The patch expose the vhost kernel ioctrl API and remove the virtio_net
operation functions to the virtio_net code module.
Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Use needed constants from libderm instead of directly using
kernel UAPI.
Tracked-On: #6688
Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
EDID uses the bytes of 38-53 to support up to 8 standard modes. And it is
based on the mechanism: Byte 0 defines the xres / 8 - 31 and byte 1 defines
the aspect_ratio/refresh_rate.
But now it uses the incorrect logic in course of adding standard mode, which
causes that no standard mode is added in EDID block.
Fix it and add another two standard modes so that the guest_vm can parse
more modes from EDID.
Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
The EDID uses the bytes of 54-125 to define the four detailed_timing_blocks.
But the static offset is used to update the DTB. This will cause that
the incorrect offset is used for DTB if the edid_generate is called several
times.
Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This patch checks the change of "-s" sub parameters, which was
obsoleted or moved and the print some warnings msg or show the new
format.
The following obsoleted parameters are covered:
-s ,pci-gvt
-s ,virtio-hdcp
-s ,npk
-s ,virtio-coreu
--mac_seed
Reviewed-by: VanCutsem Geoffroy <geoffroy.vancutsem@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@intel.com>
For all Definition Blocks in ACPI Namespace, their name are a fixed 32 bits.
This patch refine CPU Definition Blocks name to support more than 10 CPUs
for a guest.
Tracked-On: #7387
Signed-off-by: Fei Li <fei1.li@intel.com>
Now vdpy_get_display_info/get_edid is called before vdpy_init.
This is incorrect. They should be called after setting up the
connection with vdisplay.
Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Now some fileds are not initialized, which causes that ACRN-DM doesn't
handle the request of VIRTIO_GPU_CMD_GET_DISPLAY_INFO and
VIRTIO_GPU_CMD_GET_EDID.
Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
The virtio_gpu in guest_vm will try to fetch the EDID to query
the supported resolution. Guest vm will send the cmd of
VIRTIO_GPU_CMD_GET_EDID and receive the response of VIRTIO_GPU_RESP_OK_EDID.
Now acrn-dm has some issues in course of handlding EDID request: Incorrect
resp type, the incorrect response. This will cause that the guest_vm fails
to fetch the EDID.
Tracked-On: #7376
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Otherwise it will use the "acrn_dm" as the thread_name, which is not
convenient to check the cpu_usage of rendering_thread.
Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
In course of creating the udmabuf, udmabuf_create_list is allocated and
passed to kernel. After the dmabuf is returned, it is not used
any more. Need to free it otherwises it will cause the memory leak.
Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
It still tries to access the gpu->vdpy_handel after the gpu
is free. This is incorrect.
Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
When virtio-gpu tries to submit the framebuffer based on
VIRTIO_GPU_CMD_2D, one pixman_image will be created. When the
sdl rendering_thread is terminated, the pixman_image will be
released. But its pointer is set to NULL. In the next reboot,
its access in vdpy_surface_set is incorrect.
Tracked-On: #7337
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Now all the 3D ops are handled in one dedicated thread. As 3D ops are
not safe in multi-thread env, some checks are added so that it can indicate
that it is not in the expected code path.
Tracked-On: #7296
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Otherwise the memory related with vga_context is leaked.
v1->v2: Use the pthread_join instead of usleep to wait for
the termination of vga_thread.
Tracked-On: #7296
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This is not needed as it is reconfigured in course of vga_thread_loop.
At the same time it is not thread-safe as the 3D api is involved
in vdpy_surface_set.
v2->v3: move the initialization of vga_surface width/height into
vga_thread.
Tracked-On: #7296
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
In order to support the VGA op, one vga_thread is created. But
in course of virtio_gpu_reset, it will also create one vga_thread.
This is incorrect.
v1->v2: the thread_id of vga_thread is treated as read-only after
the thread is created.
One thread_status based on atomic type indicates the life_cycle
of vga_thread.
v2->v3: Add the vga_thread_mtx in course of changing life_cycle of vga_thread
Tracked-On: #7296
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Add license information to virtio_gpu.c
Fix some grammar issues.
Tracked-On: #7241
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).
Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
The DMABuf sharing is based on the BLOB feature. This will
check the attribute of system memory for guest_vm and udmabuf.list_limit
parameter. If it meets with the requirement, export the BLOB feature
so that the FE driver in guest_vm can send the blob cmd.
VIRTIO_GPU_CMD_CREATE_BLOB:
VIRTIO_GPU_CMD_SET_SCANOUT_BLOB:
VIRTIO_GPU_CMD_SET_FLUSH(BLOB)
Tracked-On: #7210
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Now Virtio-gpu FE is using the below cmds to submit the framebuffer that
needs to be displayed.
VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D
VIRTIO_GPU_CMD_SET_SCANOUT
VIRTIO_GPU_CMD_FLUSH
This will introduce twice copy. In order to optimize the twice copy, the below
cmds are added and the virtio-gpu BE can use the dma-buf sharing.
VIRTIO_GPU_CMD_CREATE_BLOB
VIRTIO_GPU_CMD_SET_SCANOUT_BLOB
VIRTIO_GPU_CMD_FLUSH
V2->V3: Remove the inlined header file of devicemodel/include/public/udmabuf.h
to avoid the license issue
Tracked-On: #7210
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Now the Opengl rendering is used implicitly in SDL backend. But sometimes
it needs to create the texture explicitly based on DMABuf so that it can
render the framebuffer submitted from virtio-gpu.
Tracked-On: #7210
Acked-by: Wang Yu <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Legacy VGA & VBE interface as a common interface is supported by
many legacy and modern OS. Many installer of OS distribution use
this interface to display the GUI of installer when setup a refresh
new installation on bare-metal. Besides, Windows OS always use this
interface to display it's BSOD, recovery mode & safe mode GUI. It
is need because Windows don't include virtio-gpu driver as their
in-box driver, VGA interface will be used before the virtio-gpu
driver been installed.
To be compatiable with the PCI bar layout of legacy VGA, the layout
is refined to meet with the requirement of legacy VGA and modern
virtio-gpu.
BAR0: VGA Framebuffer memory, 16 MB in size.
BAR2: MMIO Space
[0x0000~0x03ff] EDID data blob
[0x0400~0x041f] VGA ioports registers
[0x0500~0x0516] bochs display interface registers
[0x1000~0x17ff] Virtio common configuration registers
[0x1800~0x1fff] Virtio ISR state registers
[0x2000~0x2fff] Virtio device configuration registers
[0x3000~0x3fff] Virtio notification registers
BAR4: MSI/MSI-X
BAR5: Virtio port io
Tracked-On: #7210
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Hardware cursor emulation of virtio-gpu video adapter. Guest vm can
show its own cursor in virtual display, not share the cursor with
service vm. It also accelerated by SDL(OpenGL ES 2.0 backend) API
with hardware acceleration based on the GPU hardware own by service
vm.
Tracked-On: #7210
Signed-off-by: Sun, Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Implement 2D mode of virtio-gpu adapter which can transfer outputs
from guest vm framebuffer and store them to host 2D scanout buffers.
These 2D scanout buffer can be shown by calling vdpy_surface_set/update
API provided device/include/vdisplay.h.
Virtio-gpu 2D commands calling sequence:
1) VIRTIO_GPU_CMD_GET_EDID
2) VIRTIO_GPU_CMD_GET_DISPLAY_INFO
3) VIRTIO_GPU_CMD_RESOURCE_CREATE_2D
4) VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING
5) VIRTIO_GPU_CMD_SET_SCANOUT
6) VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D
7) VIRTIO_GPU_CMD_RESOURCE_FLUSH
Tracked-On: #7210
Signed-off-by: Sun, Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Extended display identification data(EDID) is a data to store
display timings which are supported by ACRN virtual monitor.
Virtio-gpu FE driver will request it to config crtc for display
resolutions.
Tracked-On: #7210
Signed-off-by: Sun, Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
ACRN virtual monitor shown as a GUI system window of service vm.
It can display graphic outputs of guest vm which is stored in
service vm's buffers by virtio-gpu. Display operation is accelerated
by Intel GPU PF(SRIOV) device with SDL(OpenGL ES 2.0 backend) API.
This provides one generic display solution. When the virtio-gpu is
added, it will firstly try to setup the connection to graphics system
and then display the framebuffer from the guest vm in the created
window region.
Tracked-On: #7210
Signed-off-by: Sun, Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Virtio-gpu is a virtio based graphic adapter. It supports 2D mode
which can transfer the guest vm's framebuffer into service vm's
buffers for displaying. It can co-work with Intel GPU VF(SRIOV)
device and provide thransport for the accelerated contents. With
this, guest vm can benefit Intel GPU hardware to accelerate media
coding, 3D rendering and compute.
Tracked-On: #7210
Signed-off-by: Sun, Peng <peng.p.sun@linux.intel.com>
Reviewed-by: Zhao, yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
i2c bus counter 'acpi_i2c_adapter_num' shall be updated
when virtio-i2c device is de-initialized, else in user VM
reboot case, this global counter will not be reset and
keep the value last user VM boot, which is not expected
and cause iasl(building ACPI data) program crash finally
because the i2c device name space overflow.
Tracked-On: #7208
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Now, the DM assumes the device name entered by user is dependent on
the type.
For example, the device of tap type is named tap_TAAG, this patch
remove the above assumption.
User could set any name, no matter the code of DM or actually created,
it is represented by user input.
Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei<chenli.wei@linux.intel.com>
HMAC_*, MD5_* and SHA256_* are deprecated since openssl3.0, replace them with the corresponding equivalents.
Tracked-On: #6743
Signed-off-by: Tw <wei.tan@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
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>
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>
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>
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>
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>
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>
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 current code would cause infinite calls to vq_getchain()
because that:
- error check of vq_getchain() return value is missing.
- virtqueue misunderstand that there are avaliable descripters
even though the idx of avail ring is invalid.
This patch fixes it by checking validity of the return of
vq_getchain() and jump out of the loop for invalid return value.
This patch alse add validity check in judgment of avaliable
descriptor, and check if the diff between idx of avail ring and
the last idx is greater than size of this queue.
Tracked-On: #7038
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>
Hook ssram init && de-init functions to vdev
devices lifecycle management:
1) initialize ssram when vdev devices
are initialized.
2) de-initialize ssram when vdev devices
are reset or destroyed.
notes:
ssram configuration data can be released only when
user VM shutdown, hence it can't be done in deinit_vssram().
- VM reboot:
do deinit_vssram() only.
- VM shutdown:
do both deinit_vssram() and clean_vssram_config().
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Add TCC native memory hierarchy entries to vRTCT:
- wrap one function to get TCC RTCT data.
- Add memory hierarchy entries from TCC
RTCT to vRTCT.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
add all L2 & L3 cache buffers to RTCT entries:
- SSRAM WAY_MASK entry, cache ways bitmask indicates
the cache ways used by specific cache buffer.
- SSRAM region entry, support format V2 only.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This patch initializes below entries in vRTCT:
- Hardcode ACPI header
- Hardcode RTCT compatibility entry, support RTCT v2 only
for ACRN user VMs.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Add EPT mapping for all L2 & L3 vSSRAM buffers
for user VM.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
This patch allocates cache buffers from native TCC
buffer driver and do setup, make them ready to be
mapped to ACRN user VMs as software SRAM regions.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
- wrap TCC driver interface to get SSRAM regions count
and region configuration.
- add function to load configurations of all SSRAM regions.
- Add header file to describe TCC data structure.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
This patch figures out the guest cache hierarchy:
- calculate the cache hierarchy parameters, including
cache thread sharing number and inclusiveness of LLC.
- define and initialize data structure to describe
L2 & L3 cache buffers, these buffers will be mapped
to user VM as ssram regions.
- add some utility functions.
- complete the implementation of function
'create_ssram_rtct_entries()', though most functions
inside are not implemented yet.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Yu1 Wang <yu1.wang@intel.com>
1) With this patch, '--ssram' option is updated to enable
vSSRAM feature support for ACRN user VMs.
'--ssram' argument of Device Model shall follow below format:
--ssram {Ln,vcpu=vcpu_set,size=nK|M;}
example:
--ssram L2,vcpu=0,1,size=4K;L2,vcpu=2,3,size=1M;L3,vcpu=all,size=2M
2) define data structure and variable
to store the configuration data for later processing.
3) add new API to cleanup configuration data when VM shutdown.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Move below logic out of init_vssram():
- get guest vCPU information
- vssram GPA space
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
virtual RTCT will be created on TCC driver interface, instead of
pass-through native RTCT to ACRN user VMs.
this patch removes dependency on native RTCT table:
- rename build_vrtct() function to init_ssram()
and minor changes inside.
- drop function create_and_inject_vrtct()
- add one API to get virtual RTCT table.
- rename variable 'pt_rtct' to 'ssram'
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
Rename them to unify the coding style or for simplification
purpose, also remove redundant function declearations
in pci_core.h header file.
v4 update:
SSRAM* -> VSSRAM*
ssram* -> vssram*
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
guest ssram will be virtualized based on tcc driver interface,
instead of pass-thru native rtct, rename its source files to
avoid confusing:
- rename:
rtct.c -> vssram.c
rtct.h -> vssram.h
- move rtct.c from platform/acpci/ to platform/
- new directory 'vssram' to hold vssram source files.
Tracked-On: #7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Wang Yu1 <yu1.wang@intel.com>
The following parameters have not used by new design:
1. --vsbl <vsbl_file_path>
2. --part_info <part_info_name>
3. -G, --gvtargs <GVT_args>
4. -s <slot>,pci-gvt
5. -Y, --mptgen
6. -s <slot>,virtio-hdcp
7. -s <slot>,npk
8. -s <slot>,virtio-coreu
9. -i, --ioc_node <ioc_mediator_parameters>
10. --pm_by_vuart [pty|tty],<node_path>
11. --pm_notify_channel <channel>
This patch remove these parameters from usage and comment in code to
explain they are all obsoleted now.
Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Otherwise it will fail to set the GPU opregion/stolen_memory for guest VM in
course of GPU passthrough and the display can't work.
Tracked-On: #6988
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
this patch validates input of virtio_console_control_tx()
function to avoid potential progream crash with malicious
input from guest.
Tracked-On: #6851
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This patch is to eliminate kernel error msgs:
'ACPI Error: AE_NOT_FOUND, Evaluating _PSS'
This is caused by missing of _PSS table in guest ACPI. It would
happen when pstate is not injected to the guest.
Kernel ACPI pstate driver first probes
_PPC(performance capabilites) and _PCT(performance control)
in ACPI. If they exist, then it loads the _PSS(performance state).
If _PPC/_PCT are presented while _PSS is missing, it prints
the error msg.
In acrn-dm, _PPC/_PCT are hard-coded to all vCPUs, while _PSS
are constructed with the pCPUs' pstate data. This is base on
assumption that all VMs can have pstate.
Now the pstate is given to VM only when the VM is not sharing
any CPU(and no RTVM is setup in the scenario).
When the VM doesn't have pstate, the hypercall will return px_cnt=0,
and the _PSS is not constructed. In this case, _PPC/PCT should not
be injected, too.
Tracked-On: #6848
Signed-off-by: Zhou, Wu <wu.zhou@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
The UUID has several usages before:
1, For HV to identify the static VM configuration of post-launched VM.
2, Seed virtualization.
3, Slightly prevent launching malicous VM from SOS as lack of secure
boot.
The UUID is confused to user, user don't understand what it is. And user
don't know where to get/apply the UUID. The worst experience is user
can't launch any VMs w/o re-compile the hv. Everything needs to be
static decided in building phase.
Now we decide to remove UUID and split each usage. For 1st usage, use
vmname as the identifier of static VM configuration. For 2nd one, we
will use --vseed as the new parameter. For 3rd one, will pretect by
SOS's dm-verity.
This patch will remove the UUID parameter and support 1st&3rd usages
from DM part. For 2nd usage, another patch will be submitted later.
Tracked-On: #6685
Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Fix the Vulnerable coding style in xhci and pci core
Tracked-On: #6769
Signed-off-by: Liu Long <longliu@intel.com>
Reviewed-by: Huang, Yonghua <yonghua.huang@intel.com>
Address of software SRAM configured by TCC tool shall be
page-aligned. This patch fixup these addresses if they're
not page aligned.
Tracked-On: #6778
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Fix a potential overflow problem in get_more_acpi_dev_info where ch_read
might have a value greater than 32.
Tracked-On: #6769
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Rename uos_rpmb_size to user_vm_rpmb_size.
rename get_uos_count to get_user_vm_count.
rename get_uos_id to get_user_vmid.
rename uos_id to user_vmid.
Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Rename SOS_VM_NUM to SERVICE_VM_NUM.
rename SOS_SOCKET_PORT to SERVICE_VM_SOCKET_PORT.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename PCI_DEV_TYPE_SOSEMUL to PCI_DEV_TYPE_SERVICE_VM_EMUL.
rename SHUTDOWN_REQ_FROM_SOS to SHUTDOWN_REQ_FROM_SERVICE_VM.
rename PROCESS_RUN_IN_SOS to PROCESS_RUN_IN_SERVICE_VM.
rename SHUTDOWN_REQ_FROM_UOS to SHUTDOWN_REQ_FROM_USER_VM.
rename UOS_SOCKET_PORT to USER_VM_SOCKET_PORT.
rename SOS_CONSOLE to SERVICE_VM_OS_CONSOLE.
rename SOS_LCS_SOCK to SERVICE_VM_LCS_SOCK.
rename SOS_VM_BOOTARGS to SERVICE_VM_OS_BOOTARGS.
rename SOS_ROOTFS to SERVICE_VM_ROOTFS.
rename SOS_IDLE to SERVICE_VM_IDLE.
rename SEVERITY_SOS to SEVERITY_SERVICE_VM.
rename SOS_VM_UUID to SERVICE_VM_UUID.
rename SOS_REQ to SERVICE_VM_REQ.
rename RTCT_NATIVE_FILE_PATH_IN_SOS to RTCT_NATIVE_FILE_PATH_IN_SERVICE_VM.
rename CBC_REQ_T_UOS_ACTIVE to CBC_REQ_T_USER_VM_ACTIVE.
rename CBC_REQ_T_UOS_INACTIVE to CBC_REQ_T_USER_VM_INACTIV.
rename uos_active to user_vm_active.
Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This patch enables TPM2 passthrough to post-launched VM with eventlog
support.
User starts by providing command line "--acpidev_pt <TPM2_HID>",
of which the <TPM2_HID> will be searched from /proc/iomem for TPM2 buffer
start address and size. Furthermore, If TPM2 eventlog is supported,
TPM2 eventlog information will be retrieved from sysfs TPM2 table and
passed-through as well.
v4 -> v5:
move tpm2 related logic from acpi.c to tpm.c
multiple API rename
Tracked-On: #6686
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This patch refines the ACPI device passthrough framework by defining a
generic framework. Note that when user gives an HID by "--acpidev_pt
<HID>", the pt logic will go through all registered ops to see if
there's a match.
v4 -> v5:
parse_pt_acpidev/parse_pt_mmiodev -> create_pt_acpidev/create_pt_mmiodev
(there were already "init_xxx" function present, so rename to
create_xxx)
"super user" -> "superuser"
multiple API renames
Tracked-On: #6686
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
'error' might be used uninitialized in cfginitbar. So initialize it to zero
at the beginning.
Tracked-On: #6284
Signed-off-by: Fei Li <fei1.li@intel.com>
Previously, when pass-thru IGD,
need to use the extra parameter "gpu",
it isn't friendly to user.
So remove the "gpu" paramater here.
Refine the logic for the judgment of IGD
check the following three conditions:
1. Physical BDF is 00:02.0
2. VGA class
3. vendor id is 0x8086
Then we can assume it's IGD.
Tracked-On: #6357
Signed-off-by: Liu,Junming <junming.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
For pass-thru PCI dev,
get the class id from the physical pci config space,
then set the value in virtual config space class id.
Tracked-On: #6357
Signed-off-by: Liu,Junming <junming.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
For pass-thru dev PIO bar,ensure it's identical mapping
(guest PIO bar start address equals to host PIO bar start address).
Then in HV side, set the corresponding VMCS io bitmap
to pass-thru these io ports for performance.
Tracked-On: #6508
Signed-off-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
1. refine the name of some functions and struct
2. add the support for PIO bar reservation
Tracked-On: #6508
Signed-off-by: Liu,Junming <junming.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
When destroy the usb device release the resource allocate for transfer
in case cause the memory leak issue. Add the release and cancel
transfer request call back for the emulation device, use the emulation
device call back in xHCI controller emulation.
Tracked-On: #6533
Signed-off-by: Liu Long <long.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Fix the bug introduced by 977da8f08. There had a typo that added
the "&" by mistake.
Tracked-On: #6476
Signed-off-by: Liu Long <long.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The event ring segment table pointer may be NULL when get the address
from guest, add pointer check before use it.
Tracked-On: #6476
Signed-off-by: Liu Long <long.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Function virtio_console_close_all will close all consoles, if the console->nports
value is 1, after the console be destroyed by the mevent teardown function, when
get the nports from the console, there will cause the NULL pointer. Fix the issue.
Tracked-On: #6431
Signed-off-by: Liu Long long.liu@intel.com
Reviewed-by: Jian Jun Chen jian.jun.chen@intel.com
Acked-by: Wang, Yu1 yu1.wang@intel.com
"port->cb" in 'virtio_console_notify_tx()'
function maybe NULL when malicious inputs
are injected from virtio frondend in guest.
Tracked-On: #6388
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
1. add a name field to indicate what the MMIO Device is.
2. add two more MMIO resource to the acrn_mmiodev data structure.
Tracked-On: #6366
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
IC_ADD_HV_VDEV -> ACRN_IOCTL_CREATE_VDEV
IC_REMOVE_HV_VDEV -> ACRN_IOCTL_DESTROY_VDEV
struct acrn_emul_dev -> struct acrn_vdev
Also, move struct acrn_vdev to acrn_common.h as this structure is used
by both DM and HV.
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
IC_ASSIGN_MMIODEV -> ACRN_IOCTL_ASSIGN_MMIODEV
IC_DEASSIGN_MMIODEV -> ACRN_IOCTL_DEASSIGN_MMIODEV
struct acrn_mmiodev has slight change. Move struct acrn_mmiodev into
acrn_common.h because it is used by both DM and HV.
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
IC_ASSIGN_PCIDEV -> ACRN_IOCTL_ASSIGN_PCIDEV
IC_DEASSIGN_PCIDEV -> ACRN_IOCTL_DEASSIGN_PCIDEV
QUIRK_PTDEV -> ACRN_PTDEV_QUIRK_ASSIGN
struct acrn_assign_pcidev -> struct acrn_pcidev
Move struct acrn_pcidev into acrn_common.h because it is used by both
DM and HV.
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
vmm.h has some unused definitions.
Keep the useful definitions and delete vmm.h
Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The TPM driver will access some mmio registers using absolute address,
That means TPM base GPA must use same HPA value, when passthough it to VM
Tracked-On: #6126
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
CRB_REGS_CTRL_REQ is offset of control register to TPM mmio base,
need use the address to generate TPM2 acpi table
Tracked-On: #6126
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
With virtio polling mode enabled, a timer is running in the virtio
backend service. And the timer will also be triggered if its frondend
driver didn't do the device reset in shutdown. A freed virtio device
will be accessed in the polling timer handler.
Do the virtio reset() callback specifically to clear the polling timer
before the free.
Tracked-On: #6147
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Get and save native root port's max payload in dev cap register in
vrp_config data structure which will be used to configure vrp's max
payload by hv.
Tracked-On: #5915
Signed-off-by: Rong Liu <rong.l.liu@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
The trb pointer may be NULL when get the address from user space, add
the pointer check before use the trb.
Tracked-On: #6172
Signed-off-by: Liu Long <long.liu@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>