Skip to contentSkip to conversation

kselftest kvm/arm/page_fault_test hangs if pagesize is 16KB

DISCUSSION Itaru Kitayama 2 participants 2 messages Jun 27, 2025 – Oct 2 KVM arm64

lore
Share & tools
lore
#0 lore raw

Hi,

Today’s master kvm kselftest page_fault_test hangs in QEMU TCG mode and -cpu max type. Below is the call trace obtained by echo l > /proc/sysrq-trigger:

[ 7179.811953] CPU: 0 UID: 0 PID: 1091 Comm: page_fault_test Not tainted 6.16.0-rc3-00188-g6f2a71a99ebd #29 PREEMPT
[ 7179.812005] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
[ 7179.812029] pstate: 40402009 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 7179.812063] pc : arch_local_irq_enable+0x8/0x34
[ 7179.812104] lr : kvm_arch_vcpu_ioctl_run+0x984/0xad0
[ 7179.812125] sp : ffff800082d6baf0
[ 7179.812133] x29: ffff800082d6baf0 x28: ffff0000c63b2300 x27: 0000000000000000
[ 7179.812190] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000180400
[ 7179.812219] x23: 0000000000000001 x22: ffffce6f66e5f630 x21: ffff0000cddbf000
[ 7179.812248] x20: 0000000000000000 x19: ffff0000c6118000 x18: 0000000000000000
[ 7179.812277] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[ 7179.812305] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[ 7179.812333] x11: 0000000000000000 x10: ffffce6f68835de0 x9 : 1fffe00018171a41
[ 7179.812362] x8 : 0000000000000001 x7 : ffff0000c0b8d200 x6 : 000000000000000f
[ 7179.812389] x5 : ffff0000c00dce30 x4 : ffff319295d92000 x3 : 0000000000000000
[ 7179.812417] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c63b2300
[ 7179.812447] Call trace:
[ 7179.812457]  arch_local_irq_enable+0x8/0x34 (P)
[ 7179.812479]  kvm_vcpu_ioctl+0x1a0/0xaac
[ 7179.812498]  __arm64_sys_ioctl+0xac/0x104
[ 7179.812518]  invoke_syscall+0x48/0x110
[ 7179.812535]  el0_svc_common.constprop.0+0x40/0xe8
[ 7179.812553]  do_el0_svc+0x20/0x2c
[ 7179.812596]  el0_svc+0x38/0x124
[ 7179.812616]  el0t_64_sync_handler+0x144/0x168
[ 7179.812634]  el0t_64_sync+0x1ac/0x1b0

I checked testing with the 4KB and 64KB page sizes, page_fault_test runs fine.

Itaru.

reviewer
#1 lore raw

Hi Itaru,

On Fri, 27 Jun 2025 07:34:57 +0100, Itaru Kitayama <[email protected]> wrote:

[...]

Quoted 1 line

I checked testing with the 4KB and 64KB page sizes, page_fault_test runs fine.

I hit the same hang. It's a QEMU bug: with a 52-bit PA, the stage 1 walk computes the wrong base address for an initial table smaller than 64 bytes, such as the 16KB mode's level 0. I've posted a fix [1].

Cheers,
/fuad

[1] https://lore.kernel.org/all/[email protected]/