Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/arm64: Optimized SGI to avoid VM exit. #14689

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fix-Point
Copy link
Contributor

Summary

This patch is necessary to optimize the handling of SGI (Software Generated Interrupts) in a virtualized environment on ARM64 architecture. The original implementation required reading the IGROUPR0 register each time an SGI was sent, which, due to the GIC Redistributor being a purely emulated device, caused a VM exit. This VM exit leads to significant performance degradation. The patch addresses this issue by replacing the read operation with a predefined value set during the initialization in gicv3_cpuif_init, assuming that this value remains unmodified post-initialization.

Impact

The change primarily affects the performance of virtualized environments by reducing the number of VM exits caused by SGI handling. Users running virtual machines on ARM64 hardware should experience improved performance, especially in scenarios with frequent SGI usage. There are no direct changes to the build process, hardware requirements, or documentation. Security and compatibility are not directly impacted by this change, but the overall system performance may be enhanced due to reduced VM exits.

Testing

The change was verified on QEMU-virt/arm64.

In the virtualized environment, each time an SGI is sent, the value of IGROUPR0 needs to be read once. Since the GIC Redistributor is a purely emulated device, each read of IGROUPR0 will cause a VM exit, causing serious performance degradation. This patch replaces the read with the value previously set in `gicv3_cpuif_init`, and we assume that this value has not been modified after initialization.

Signed-off-by: ouyangxiangzhen <[email protected]>
@github-actions github-actions bot added Arch: arm64 Issues related to ARM64 (64-bit) architecture Size: XS The size of the change in this PR is very small labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm64 Issues related to ARM64 (64-bit) architecture Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants