Created attachment 378 [details] test files Description of problem: IPI virtualization is a new VT-x feature, targeting to eliminate VM-exits on source vCPUs when issuing unicast, physical-addressing IPIs. Once it is enabled, the processor virtualizes the following kinds of operations that send IPIs without causing VM-exits: - Memory-mapped ICR writes - MSR-mapped ICR writes - SENDUIPI execution Version-Release number of selected component (if applicable): N/A How reproducible: Measure the average time sending IPI from the source vCPU to the target vCPU completing the IPI handling by kvm-unit-tests w/ and w/o IPI virtualization. Steps to Reproduce: Experiment 1: Apply patch "0001-modify-smptest.c.patch" on kvm-unit-tests and build it to get test image "x86/smptest.flat". Configure your QEMU and perf path in the file "perf-ipiv-test.sh", and run the script with and without IPIv respectively. Experiment 2: Apply patch "0001-modify-smp.c.patch" kvm-unit-tests that AP was modified to run in the idle loop instead of the halt to ensure no VM exit impact on target vCPU. Build it to get test "image x86/vmexit.flat". The test script is ipi-test.sh, configure and run it with/without IPIv. Actual results: N/A Expected results: Experiment 1: Check the value after "APIC_WRITE"/"MSR_WRITE" in the printed log. Compared with disabling IPIv, enabling IPIv reduces the APIC_WRITE/MSR_WRITE VM-exit by 1000000 times in xapic/x2apic mode. Experiment 2: Check the value after "ipi ipi" in the printed log. Compared with disabling IPIv, enabling IPIv reduces the overhead by at least 22.21% in the xapic mode and 15.98% in the x2apic mode. Additional info: enable IPIv: modprobe -r kvm-intel && modprobe kvm-intel enable_ipiv=1 disable IPIv: modprobe -r kvm-intel && modprobe kvm-intel enable_ipiv=0 files in attachment: 0001-modify-smp.c.patch 0001-modify-smptest.c.patch ipi-test.sh perf-ipiv-test.sh
merged: https://gitee.com/anolis/cloud-kernel/pulls/703