As the type of pthread_t is unsigned long, so the init value for it
should not be '-1'. When the tid is '-1', it will continue to call
pthread_kill/pthread_join. This is incorrect.
Tracked-On: #7960
Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
There was some secure coding style violations of virtio net and tmp,
this patch add some NULL check to fix these violations.
Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
disable NOTIFY during getting requests from virtqueue. This will improve
the IO performance.
Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Add ioeventfd and iothread to virtio framework. When a virtio device
claim to support iothread, virtio framework will register a ioeventfd
and add it to iothread's epoll. After that, the new notify will come
through the iothread instead of the vcpu thread. The notify handler will
be called to process the request.
Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Supply a decidate thread, which can moniter a set of fds with epoll,
when the data is ready, call the corresponding callback.
This iothread will be created automatically with the first successful
call to iothread_add, and will be destroyed in iothread_deinit if it
was created.
Note, currenlty only support one iothread.
Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Use the VHOST_NET_F_VIRTIO_NET_HDR in linux system header file,
and set the correct feature bit for Virtio net header.
Tracked-On: #7790
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Free the virtio_vsock struct resource in virtio vsock deinit function
in case memory leak.
Tracked-On: #7759
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Replace the exclamation mark with period mark in debug info and fix
the Guest CID max value macro.
Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".
Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
This patch does:
- define IASL_MIN_VER in the top-level Makefile and pass it Device Model
- verify the "iasl" version at run time
if "iasl" version is older than IASL_MIN_VER, refuse to launch the
post-launched VM and exit directly.
Tracked-On: #7880
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
At run time (on the *target* machine), acrn-dm depends on "iasl" to build
the ACPI tables for post-launched VMs.
This patch does:
- remove the dependency on ASL_COMPILER, which would only be used at build time
- add a new acrn-dm parameter "--iasl <iasl_compiler_path>"
If "--iasl <iasl_compiler_path>" is specified as the acrn-dm parameter,
acrn-dm uses <iasl_compiler_path> as the path to the "iasl" compiler;
otherwise, "which iasl" is used to detect the "iasl" compiler.
If "iasl" is not found at run time, refuse to launch the post-launched VM
and exit directly.
v2 -> v3:
- use "strlen" rather than "strncmp" to check whether asl_compiler
has been set or not
v1 -> v2:
- remove "iasl_param" and "with_iasl_param" to simplify the logic
Tracked-On: #7880
Signed-off-by: Victor Sun <victor.sun@intel.com>
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Remove sample files and launch scripts related to the Apollo Lake (APL)
platform since ACRN no longer supports it. Clean the Makefile as well to not
install these files on the target system.
Tracked-On: #6175
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Fix the log format problem in devicemodel when using virtio-console with
'stdio' configuration.
In virtio-console, it will change the STDIO's attributes, and will case
the log message after that not align.
e.g:
for (i=0; i<3; i++)
printf('test\n');
The original output would be like this:
test
test
test
After add 'OPOST' to oflag of STDIO, the output would be like this:
test
test
test
(OPOST - Enable implementation-defined output processing)
Tracked-On: #7860
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
The patch fix many bugs about the pci msi capabilities.
1. Fix the clear msi mask bit issues.
2. Initialize the offset of pci capabilities this variable will used as
the output of pci_emul_find_capability function.
3. Replace 16-read with 32-read because both mask and pending are 32bit.
4. Add mask and pending element in msicap struct and intialize the struct
value to zero, because we need r/w mask and pending value.
Tracked-On: #7762
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Fix the memory leakage issue caused by incomplete deinit flow.
Tracked-On: #7759
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Check max ep index in doorbell write function to avoid overwriting
the pci_xhci_dev_emu->eps[XHCI_MAX_ENDPOINTS].
Tracked-On: #7759
Signed-off-by: Liu Long <long.liu@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
In get_mmio_hpa_resource, although very unlikely, parsing
of /proc/iomem may fail. Handle the case of failure and exit early.
Tracked-On: #7593
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
Updates to the TSC members and maintainer list
* Update the Technical Steering Committee (TSC) members following the election
of Junjie Mao as the new chair
* Update Thomas Gleixner's email address since he joined Intel Corporation
* Delete the MAINTAINERS files in the 'hypervisor' and 'devicemodel' folders
as they are obsolete and unused.
Tracked-On: #7706
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Flow Table 6-95 from xHCI spec, Ring Segment Size defines
the number of TRBs supported by the ring segment, valid
values for this field are 16 to 4096.
Tracked-On: #6981
Signed-off-by: Liu Long <long.liu@intel.com>
tfd is one data field of FIS for AHCI, it is unacceptable if it is
random value, could cause AHCI data transport failure.
Acturally there is no chance the switch statement has the value other
than 0~3, since there is only 2 bit to deduce.
Add the initial value for tfd as ATA_S_ERROR, which is checked by
function ahci_write_fis_d2h afterwards, so guest driver could handle it well.
Tracked-On: #7679
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Virtual display is component which based on native window system.
This feature depended phisical monitor connected and graphic driver in
SOS running correctly. If these dependencies fail, it is a fatal error
for virtual display. We have to terminate the device model to let user
fix runtime environment issue for graphics.
Tracked-On: #7672
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
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>
Since any uuid relevant action directly uses Linux kernel UAPI
(linux/uuid.h) the use of libuuid is not required.
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>
This patch checks the obsoleted parameters and print some warnings
instead of exiting the acrn-dm directly. The following obsoleted
parameters are covered:
-i, --ioc_node
-G, --gvtargs
-Y, --mptgen
--vsbl
--part_info
--pm_by_vuart
--pm_notify_channel
Tracked-On: #6690
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Signed-off-by: Chenli Wei <chenli.wei@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>