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 on KVM host, it reports error if there is ptw=on
option. By default PTW feature is disabled on la464 CPU type, and auto
detected on max CPU type.
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 command './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-rc3
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 | 6 ++--
target/loongarch/cpu.h | 1 +
target/loongarch/kvm/kvm.c | 35 +++++++++++++++++++
20 files changed, 169 insertions(+), 14 deletions(-)
base-commit: 36076d24f04ea9dc3357c0fbe7bb14917375819c
--
2.39.3