Commit Graph

1158047 Commits

Author SHA1 Message Date
yichongt 7159ad071b virt: acrn: Introduce interfaces for PIO region passthrough
PIO region passthrough enables an OS in a virtual machine to directly
access a PIO device in the host. It promises almost the native
performance, which is required in performance-critical scenarios of
ACRN.

ACRN hypervisor will pass through most resource to Service VM at the
begining except those pre-allocated to hypervisor itself and pre-launched
VM. GPA and HPA of all these passthrough resource are identical mapped in
Service VM. In this case, user space program can manipulate the PIO region
in Service VM as PIO region in Host, such as delivering GPA in Service VM
to hypervisor to assign PIO region to other post launched VM.

HSM provides the following ioctls:
  - Assign - ACRN_IOCTL_ASSIGN_PIO_REGION
    Pass data struct acrn_pio_region from userspace to the hypervisor, and
    inform the hypervisor to assign a PIO region to a User VM.

  - De-assign - ACRN_IOCTL_DEASSIGN_PIO_REGION
    Pass data struct acrn_pio_region from userspace to the hypervisor, and
    inform the hypervisor to de-assign a PIO region from a User VM.

These hypercalls are for ACPI device passthrough function of ACRN.
Now ACRN only support legacy UART which has a PIO region. Before passing
through this PIO region to a post-launched VM, ACRN device model would
unbind UART device from Service VM through sysfs node
/sys/bus/pnp/drivers/serial/unbind.

Tracked-On: projectacrn/acrn-hypervisor#8635

Signed-off-by: Yichong Tang <yichong.tang@intel.com>
2024-07-31 15:40:11 +08:00
Yonghua Huang 51b9a968e5 virt: acrn: fix unintentional integer overflow issues
fix misc coding issues such as unintentional integer overflow,
 NULL pointer access ect. in acrn log and sbuf driver.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2024-07-26 09:54:11 +08:00
Jian Jun Chen 2355d104a1 virt: acrn: support asyncio data match
Virtio legacy device (ver < 1.0) uses a single PIO for all virtqueues.
Notifications from different virtqueues are implemented by writing
virtqueue index to the PIO. Writing different values to the same addr
needs to be mapped to different eventfds by asyncio. This is called
data match feature of asyncio.

Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Signed-off-by: Gao, Shiqing <shiqing.gao@intel.com>
2024-06-05 15:28:58 +08:00
Fei Li f528146c92 virt: acrn: add acrn hypervisor log back
Add acrn hvlog back for ACRN Hypervisor debug.

Signed-off-by: Fei Li <fei1.li@intel.com>
2024-05-30 10:51:22 +08:00
Conghui 94e442ef2a virt: acrn: Introduce acrntrace
Signed-off-by: Conghui <conghui.chen@intel.com>
2024-05-30 10:51:22 +08:00
Conghui c6d21f4fb6 virt: acrn: remove WQ_UNBOUND flag
Due to the two level schedule model in type 1 hypervisor, Service OS
kernel's scheduler does not aware the running status of the User VM,
which means, a thread may be schedule to a CPU which is idle in Service
OS but actually running in User VM.
For the ioreq dispatch workqueue, as it was in the critical path of I/O
request, and ACRN hypervisor only inject the ioreq interrupt to CPU0, so
migrate to other CPU is meaningless and will bring more latency.
So, remove the WQ_UNBOUND flag, and let CPU0 do the dispatch directly.

Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-05-30 10:51:22 +08:00
Conghui a23e4bf4ca virt: acrn: support asyncio
Asyncio is a new mechanism in ACRN, which is special for these devices
which need high I/O performance. ACRN hypervisor would process the I/O
request from User VM in an async mode.

For this kind of I/O reqeusts, a new shared page is created by device
model in userspace, and register to kernel with ioctl. ACRN hsm driver
will pin the page to avoid page swapping. Use hypercall to pass the base
addresses to hypervisor, so that hypervisor can put asyncio requests to
this buffer.

When User VM traps to hypervisor due to an IO/MMIO access, hypervisor
need to distinguish it between original syncronize IO and asyncronize IO.
So, the hypercalls are added to assign or deassign the aynscio info to
hypervisor.

In ACRN, we use the ioeventfd in vhost device. We also support the
virtio device using ioveventfd for FE to NOTIFY BE. But in current
implementation, when the User VM write the NOTIFY register to notify BE,
it will trap to hypervisor. After the write access is finished, User VM
can return.
To return earlier, we provide an asyncio mode for an I/O request. For
asyncio, hypervisor directly put the request in an asyncio shared buffer,
and then return to User VM. To take use of this mechanism, add a new flag
ACRN_IOEVENTFD_FLAG_ASYNCIO to indicate that the IO is asyncio. And use
hypercall to register the asyncio info to hypervisor.

When the User VM do an IO/MMIO access and traps to hypervisor, hypervisor
will parse the I/O base address, and check if it was registered. If yes,
hypervisor will queue the corresponding ioeventfd to the aysncio buffer,
and inject an interrupt to Service VM. ACRN HSM driver in Service VM
will traverse the fd list and signal the eventfd.

Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-05-30 10:51:22 +08:00
Conghui 3243a21d5d virt: acrn: add shared buffer interface
In ACRN, the shared buffer is created to shared data between hypervisor,
kernel and device model (in userpace). This buffer can be allocated and
initialized by kernel or device model.

Add hypercall to register shared buffer(sbuf) to ACRN hyperviosr. The
'vm_id' is used to indicate who owns this sbuf. The 'buffer' is the base
address for sbuf.

Signed-off-by: Conghui <conghui.chen@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu f123b28d5d Add CONFIG_IGC=y to user vm config
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yonghua Huang 8843484740 extend uio driver to supports msix
This patch extends UIO PCI generic driver to
 support MSI-X interrupt.

Tracked-On:projectacrn/acrn-hypervisor#5407

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu f7b7b085f0 Add CONFIG_ACRN_GUEST to guest kernel config
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu 03e98e186a config: Add CONFIG_DEVMEM=y to service VM config
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu d60822c5a6 config: Add CONFIG_FB_EFI=y to service vm config
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu db65af5d6f config: Enable Service VM framebuffer console
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Geoffroy Van Cutsem 826589118e Configruations: convert to minimal config files
Use 'make savedefconfig' to convert the extensive kernel configuration files
to simplified ones.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2024-05-30 10:51:22 +08:00
Ionut Nechita 383aff70db xfs: Added XFS support in config file - u.vm
Description:
 - Added XFS support in Kernel User VM config file

Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
Change-Id: I109ea86c3af303b3d86150d07d2d4d966e8d549d
2024-05-30 10:51:22 +08:00
Ionut Nechita c33fceaece xfs: Added XFS support in config file - s.vm
Description:
 - Added XFS support in Kernel Service VM config file

Signed-off-by: Ionut Nechita <ionut_n2001@yahoo.com>
Change-Id: Ic76684b701ff5cf7ba90850776240eb2d77287c1
2024-05-30 10:51:22 +08:00
Yifan Liu 6537f798d1 config: Enable UaaG kernel console
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Liu Long 19124186c8 ACRN: Kernel: Enable vsock kernel config
Enable vsock kernel config in Service VM and Guest VM.

Tracked-On: projectacrn/acrn-hypervisor#7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2024-05-30 10:51:22 +08:00
Zhao Yakui d809b94342 config: Enable Virtio-GPU in guest_vm 2024-05-30 10:51:22 +08:00
Yifan Liu 2063a67279 config: Add the support for UDMABUF
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu ab613f2e5d config: Add Docker related configs to kernel_config_user_vm
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Yonghua Huang f0367582db config: add TCC buffer driver support
Add Intel TCC buffer driver support for ACRN service VM.

Tracked-On: projectacrn/acrn-hypervisor#7010
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu 70f840bf78 config: Add kernel_config_user_vm
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2024-05-30 10:51:22 +08:00
Xiangyang Wu 5b41969878 config: update serial configuration for Service VM
The CONFIG_SERIAL_8250_NR_UARTS should be increased to at least 48,
and CONFIG_SERIAL_8250_RUNTIME_UARTS should be increased to at least
32 in order to support multi port serial cards out of the box. This
will cover at least the situation, where two 8 port cards are used
simultaneously and there is still some room for internal ports or
the other card or vUARTs.

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
2024-05-30 10:51:22 +08:00
Liu Long fffe98b0ef Kernel-config: Rename sos config to service_vm config
Rename Acrn kernel config name to kernel_config_uefi_service_vm.

Tracked-On: projectacrn/acrn-hypervisor#6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
2024-05-30 10:51:22 +08:00
Yifan Liu f2550f1334 config: remove CONFIG_EXTRA_FIRMWARE and CONFIG_EXTRA_FIRMWARE_DIR 2024-05-30 10:51:22 +08:00
pengfujx 403770bb05 config: remove kernel physical start address
From ACRN release 2.5, hypervisor supports relocate kernel to the guest free space. So specify the kernel physical start address is not needed any more.

Tracked-On: projectacrn/acrn-hypervisor#6557

Signed-off-by: pengfujx <pengfux.ji@intel.com>
2024-05-30 10:51:22 +08:00
zhongru.gu 7bfd4a4cef config: Enabled Intel I225 NIC PTM capability
Enable PTM for PTM_enabling test on I225 NIC

Tracked-On: projectacrn/acrn-hypervisor#6544

Signed-off-by: zhongru.gu <zhongrux.gu@intel.com>
2024-05-30 10:51:22 +08:00
Liu,Junming 3cf2b77a88 config: add AST driver(ASPEED GPU)
Some platform has ASPEED GPU,
add AST driver to enable Service VM display locally

Tracked-On: projectacrn/acrn-hypervisor#6357

Signed-off-by: Liu,Junming <junming.liu@intel.com>
2024-05-30 10:51:22 +08:00
Geoffroy Van Cutsem e5fc8f6cad config: include additional USB drivers
Add some additional USB Mass Storage drivers (built-in) to the
kernel configuration. This solves booting off USB with some devices
and on some platforms.

Also add the USB HID driver as built-in (instead of a module).

Tracked-On: projectacrn/acrn-hypervisor#5943
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2024-05-30 10:51:22 +08:00
Geoffroy Van Cutsem 1be366d777 config: add IGC driver (Intel Ethernet I225-LM)
The latest NUCs based on Intel Tiger Lake (TGL) also come with the
Intel Ethernet I225-LM Ethernet adpater. The driver for this is
called IGC, this patch enables it (as a module) in the kernel
configuration

Tracked-On: projectacrn/acrn-hypervisor#6221
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2024-05-30 10:51:22 +08:00
Geoffroy Van Cutsem fcf02f3e9b config: add the Virtio blk driver to the Service VM config
Add the Virtio blk driver (VIRTIO_BLK) driver to the Service VM
kernel config (SOS). This simplifies the set-up procedure for
running ACRN on QEMU.

Tracked-On: projectacrn/acrn-hypervisor#6125
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2024-05-30 10:51:22 +08:00
Shuo A Liu 82f21f34ff config: Add minimal config for 5.10 ACRN kernel
To use this config file:

 $ mv kernel_config_uefi_sos .config
 $ make olddefconfig
 $ make

Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
2024-05-30 10:51:22 +08:00
Cezary Rojewski 2c3877703a ASoC: mediatek: Drop da7219_aad_jack_det() usage
Do not access the internal function directly, do so through
component->set_jack() instead.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221031160227.2352630-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-25 15:19:55 +08:00
Cezary Rojewski 9186268466 ASoC: Intel: avs: Allow for 16 channels configuration
AudioDSP firmware and HDAudio controller support and facilitate audio
formats with up to 16 channels. Reflect that with BE DAIs.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 8bcb3713a5 ALSA: hda: Allow for 16 channels configuration
As per HDAudio specification, up to 16 channels are supported. Reflect
that in the code.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Amadeusz Sławiński b6dbc6b5fb ASoC: Intel: avs: Allow to specify custom I2S config for i2s_test
Change i2s_test module option from enable flag to string allowing to
specify which i2s and in what TDM configuration should be enabled.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 5a4a7d2576 lib/string_helpers: Introduce parse_int_array()
Existing parse_inte_array_user() works with __user buffers only.
Separate array parsing from __user bits so the functionality can be
utilized with kernel buffers too.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 49446d05da ALSA: hda: Enable avs-driver by default for all SST configurations
The skylake-driver is deprecated in favour of the avs-driver. As the
latter supports all configurations of its predecessor and more, simply
replace the driver-constant returned when FLAG_SST is met.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 0e05597ae7 ASoC: Intel: avs: Load rt5640 on ADL-based platforms
To support ADL-rt5640 configuration add adequate entry to
board-selection table for ADL.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 32250a87ab ASoC: Intel: avs: Add rt5640 machine board
To support AVS-rt5640 configuration add machine board connecting AVS
platform component driver with rt5640 codec one.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
2024-04-24 22:20:32 +02:00
Amadeusz Sławiński e2ee515656 ASoC: Intel: avs: Restore stream decoupling on prepare
Revert changes from commit b87b8f43afd5 ("ASoC: Intel: avs: Drop
superfluous stream decoupling") to restore working streaming during S3.

Fixes: b87b8f43afd5 ("ASoC: Intel: avs: Drop superfluous stream decoupling")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240405090929.1184068-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 40f8c997bf ASoC: Intel: avs: Populate board selection with new I2S entries
commit 5b417fe0cded0b5917683398e6519aae8045cd40 upstream

Update board selection with tables specifying supported I2S
configurations. DMIC/HDAudio board selection require no update as
dmic/hdaudio machine boards are generic and not tied to any specific
codec.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-11-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:32 +02:00
Cezary Rojewski 8b0e058596 ASoC: Intel: avs: ICCMAX recommendations for ICL+ platforms
commit 36478a74c7ddaf58d80da5cef9c5ddb5beed5a2e upstream

For ICL+ platforms to avoid DMI/OPIO L1 entry during the base firmware
load procedure, HW recommends to set LTRP_GB to 95us and start an
additional CAPTURE stream in the background.

Once the load completes, original LTRP_GB value is restored and the
additional stream is released.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-10-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00
Cezary Rojewski 7815b9f7aa ASoC: Intel: avs: TGL-based platforms support
commit 5acb19ecd1982bd1578912473b33df75a23fefc2 upstream

Define handlers specific to cAVS 2.5 platforms, that is TGL, ADL, RPL
and all other variants based on this very version of AudioDSP
architecture. Most operations are inherited from their predecessors with
the major difference being AudioDSP cores management - firmware handlers
that on its own so there is no need to interfere.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00
Cezary Rojewski f6c73037de ASoC: Intel: avs: ICL-based platforms support
commit 275b583d047a23c48d01b0c45fb5d95618c1da2d upstream

Define handlers specific to cAVS 2.0 platforms, that is ICL, JSL and all
other variants based on this very version of AudioDSP architecture. Most
operations are inherited from their predecessors with the major
difference being firmware-logging functionality - IPC request as well as
debug memory windows layout have changed.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-8-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00
Cezary Rojewski 938c03cad3 ASoC: Intel: avs: CNL-based platforms support
commit 8a6502ade116bc4b8293f094f8d74059c67c3f27 upstream

Define handlers specific to cAVS 1.8 platforms, that is CNL, CFL, CML
and all other variants based on this very version of AudioDSP
architecture. Most operations are inherited from their predecessors.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00
Cezary Rojewski 111b1e15f5 ASoC: Intel: avs: Abstract IRQ handling
commit 97bd565ff5a2fc89d302f9919fde37fadf51b645 upstream

Servicing IPCs on CNL platforms and onward differs from the existing
one. To make room for these, relocate SKL-based platforms specific code
into the skl.c file leaving only the genering irq_handler in the common
code.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00
Cezary Rojewski 980ffc4a5a ASoC: Intel: avs: Abstract IPC handling
commit 7576e2f4d99df6efabb77f52b9539fd345233aee upstream

Servicing IPCs on CNL platforms and onward differs from the existing
one. To make room for these, enrich platform descriptor with fields
representing crucial IPC registers and utilize them throughout the code.

While cleaning up device descriptors, reduce the number of code lines by
assigning 'min_fw_version' within a single line.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240220115035.770402-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-24 22:20:31 +02:00