Implement Hardware page table walker(PTW for short) feature in KVM mode.
Use OnOffAuto type variable ptw to check the PTW feature. If the PTW
feature is not supported with KVM host, it reports error if there is
ptw=on option.
This patchset is based on PTW feature on TCG mode:
https://lore.kernel.org/qemu-devel/20251016015027.1695116-1-maobibo@loongson.cn/
With PTW enabled, there is no obvious performance improvement with
generic macro benchmark, and somewhat improvement with micro benchmark
such as test-tlb located at https://github.com/torvalds/test-tlb,
overwall there is no negative effective with PTW enabled.
Here is result about test-tlb with command ./test-tlb 0x40000000 0x8000
host VM without HW PTW VM with HW PTW improvement
cycles 180 320 261 20%
And TLB miss rate is about 52% n this scenerary.
Performance counter stats for 'taskset 0xf ./test-tlb 0x40000000 0x8000':
67,724,819 dTLB-load-misses #52.24% of all dTLB cache accesses
129,639,899 dTLB-loads
Bibo Mao (2):
linux-headers: Update to Linux v6.18-rc2
target/loongarch: Add PTW feature support in KVM mode
include/standard-headers/linux/ethtool.h | 1 +
include/standard-headers/linux/fuse.h | 22 ++++++++++--
.../linux/input-event-codes.h | 1 +
include/standard-headers/linux/input.h | 22 +++++++++++-
include/standard-headers/linux/pci_regs.h | 10 ++++++
include/standard-headers/linux/virtio_ids.h | 1 +
linux-headers/asm-loongarch/kvm.h | 1 +
linux-headers/asm-riscv/kvm.h | 23 +++++++++++-
linux-headers/asm-riscv/ptrace.h | 4 +--
linux-headers/asm-x86/kvm.h | 34 ++++++++++++++++++
linux-headers/asm-x86/unistd_64.h | 1 +
linux-headers/asm-x86/unistd_x32.h | 1 +
linux-headers/linux/kvm.h | 3 ++
linux-headers/linux/psp-sev.h | 10 +++++-
linux-headers/linux/stddef.h | 1 -
linux-headers/linux/vduse.h | 2 +-
linux-headers/linux/vhost.h | 4 +--
target/loongarch/cpu.c | 5 +--
target/loongarch/cpu.h | 1 +
target/loongarch/kvm/kvm.c | 35 +++++++++++++++++++
20 files changed, 169 insertions(+), 13 deletions(-)
base-commit: 36df9f3764a5d18683e79f743bc9fa1550d76da0
--
2.39.3