Modifying GRUB Settings
In the GRUB configuration file, enable huge pages on the host to enhance memory management, enable IOMMU passthrough to accelerate memory access, and enable GICv4.1 to reduce CPU consumption and latency and improve virtual drive I/O performance.
- Open the grub configuration file in the host system.
vim /etc/default/grub
- Press i to enter the insert mode and add the following content to GRUB_CMDLINE_LINUX:
"default_hugepagesz=1G hugepagesz=1G hugepages=800 pci=realloc transparent_hugepage=never iommu.passthrough=1 arm64.nopauth kvm-arm.vgic_v4_enable=1 kvm-arm.virt_msi_bypass=1 irqchip.gicv3_rsv_buses_start=30 irqchip.gicv3_rsv_buses_count=10"
Huge page configuration reference: hugepages = Total memory x 0.8 (rounded down). In this example, the value is 800 GB (1 TB x 0.8).
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Update the grub configuration file.
grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
- Set the boot kernel.
grub2-set-default 'openEuler (5.10.0-patched-vm) 22.03 (LTS-SP4)'
- Reboot the server.
reboot
- After the reboot, confirm that the kernel is switched to 5.10.0-patched-vm.
uname -r
- Check whether the hugepage configuration takes effect.
cat /sys/devices/system/node/node*/meminfo | grep Huge
In the command output, if the sum of each Node x HugePages_Total field is 800, the configuration is successful.

- Check whether IOMMU passthrough is successfully configured.
dmesg | grep iommu | head -n 10
If "iommu: Default domain type: Passthrough" is displayed in the command output, the configuration is successful.

- Check whether GICv4.1 is successfully configured.
dmesg | grep GICv4.1
If "GICv4.1 support enabled" is displayed in the command output, the configuration is successful.

- After the VM is started, run the following command:
dmesg | grep "Create shadow device"
If "Create shadow device" is displayed in the command output, GICv4.1 is successfully configured.
