48d3719dba
This patch adds VirtIO support to the libhsakmt library, enabling communication with AMD GPUs via VirtIO. Details - CMakeLists.txt: Added a new CMakeLists.txt file for the VirtIO component of libhsakmt. - hsakmt_virtio.c/h: Implemented the core VirtIO functionality, including VirtIO GPU device initialization, command execution, and memory management. - virtio_gpu.c/h: Contains the implementation of the VirtIO GPU device, including ioctl handling, shared memory management, and command execution. - hsakmt_virtio_events.c: Implements event handling for VirtIO, such as event creation, destruction, setting, resetting, and querying event states. - hsakmt_virtio_memory.c: Manages memory operations for VirtIO, including memory allocation, freeing, mapping, and unmapping. - hsakmt_virtio_queues.c: Implements queue management for VirtIO, including queue creation, destruction, and updating. - hsakmt_virtio_topology.c: Handles system and node properties for VirtIO. - hsakmt_virtio_vm.c: Manages VM-related operations for VirtIO, such as reserving and dereserving VA space. - include/linux/virtgpu_drm.h: Contains DRM definitions for VirtIO GPU. Key Features - VirtIO GPU Initialization: The library can now initialize a VirtIO GPU device and communicate with it. - Command Execution: Supports executing commands on the VirtIO GPU device. - Memory Management: Provides functions for allocating, freeing, mapping, and unmapping memory for VirtIO operations. - Event Handling: Implements a comprehensive event system for VirtIO. - Queue Management: Allows for creating, destroying, and updating queues on the VirtIO GPU device. - System and Node Properties: Retrieves and manages system and node properties for VirtIO. Signed-off-by: Honglei Huang <Honglei1.Huang@amd.com>