Subject: next-20250121: kvm selftests: RIP: 0010:__kmalloc_node_noprof+0xff/0x490

From: "Aithal, Srikanth" <[email-masked]>
Date: Wed, 22 Jan 2025 10:18:13 +0530

Hello all,

While running kvm selftests on AMD EPYC platform with 
6.13.0-next-20250121 below general protection fault is being hit.

/Jan 22 00:45:35 kernel: Oops: general protection fault, probably for 
non-canonical address 0xe659260b3c31e5e0: 0000 [#1] PREEMPT SMP NOPTI
Jan 22 00:45:35 kernel: CPU: 113 UID: 0 PID: 143333 Comm: 
memslot_perf_te Not tainted 6.13.0-next-20250121-f066b5a6c7-98baed10f3f #1
Jan 22 00:45:35 kernel: Hardware name: Dell Inc. PowerEdge R6515/07PXPY, 
BIOS 2.14.1 12/17/2023
Jan 22 00:45:35 kernel: RIP: 0010:__kmalloc_node_noprof+0xff/0x490
Jan 22 00:45:35 kernel: Code: 0f 84 0b 01 00 00 84 c9 0f 85 03 01 00 00 
41 83 fb ff 0f 85 e9 00 00 00 41 bb ff ff ff ff 41 8b 44 24 28 49 8b 34 
24 48 01 f8 <48> 8b 18 48 89 c1 49 33 9c 24 b8 00 00 00 48 89 f8 48 0f 
c9 48 31
Jan 22 00:45:35 kernel: RSP: 0018:ffffa77176403ab0 EFLAGS: 00010282
Jan 22 00:45:35 kernel: RAX: e659260b3c31e5e0 RBX: ffffed7142251180 RCX: 
0000000000000000
Jan 22 00:45:35 kernel: RDX: 0000000003106071 RSI: 000000000003b080 RDI: 
e659260b3c31e5e0
Jan 22 00:45:35 kernel: RBP: ffffa77176403b10 R08: 0000000000000000 R09: 
ffffa771c9605000
Jan 22 00:45:35 kernel: R10: ffffa77176403b28 R11: 00000000ffffffff R12: 
ffff92a240044400
Jan 22 00:45:35 kernel: R13: 0000000000000008 R14: 00000000ffffffff R15: 
0000000000000dc0
Jan 22 00:45:35 kernel: FS:  00007f91abd0d740(0000) 
GS:ffff92e13e880000(0000) knlGS:0000000000000000
Jan 22 00:45:35 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jan 22 00:45:35 kernel: CR2: 000000002346c3c8 CR3: 000000223fbb6004 CR4: 
0000000000770ef0
Jan 22 00:45:35 kernel: PKRU: 55555554
Jan 22 00:45:35 kernel: Call Trace:
Jan 22 00:45:35 kernel: <TASK>
Jan 22 00:45:35 kernel: ? show_regs+0x6d/0x80
Jan 22 00:45:35 kernel: ? die_addr+0x3c/0xa0
Jan 22 00:45:35 kernel: ? exc_general_protection+0x248/0x470
Jan 22 00:45:35 kernel: ? asm_exc_general_protection+0x2b/0x30
Jan 22 00:45:35 kernel: ? __kmalloc_node_noprof+0xff/0x490
Jan 22 00:45:35 kernel: ? srso_alias_return_thunk+0x5/0xfbef5
Jan 22 00:45:35 kernel: ? __get_vm_area_node+0xd2/0x140
Jan 22 00:45:35 kernel: ? __vmalloc_node_range_noprof+0x2ec/0x7f0
Jan 22 00:45:35 kernel: __vmalloc_node_range_noprof+0x2ec/0x7f0
Jan 22 00:45:35 kernel: ? __vmalloc_node_range_noprof+0x2ec/0x7f0
Jan 22 00:45:35 kernel: ? __vcalloc_noprof+0x26/0x40
Jan 22 00:45:35 kernel: __vmalloc_noprof+0x4d/0x60
Jan 22 00:45:35 kernel: ? __vcalloc_noprof+0x26/0x40
Jan 22 00:45:35 kernel: __vcalloc_noprof+0x26/0x40
Jan 22 00:45:35 kernel: kvm_arch_prepare_memory_region+0x13f/0x300 [kvm]
Jan 22 00:45:35 kernel: kvm_set_memslot+0x83/0x570 [kvm]
Jan 22 00:45:35 kernel: kvm_set_memory_region.part.0+0x434/0x500 [kvm]
Jan 22 00:45:35 kernel: kvm_vm_ioctl+0xa46/0x17a0 [kvm]
Jan 22 00:45:35 kernel: ? blk_finish_plug+0x30/0x50
Jan 22 00:45:35 kernel: ? srso_alias_return_thunk+0x5/0xfbef5
Jan 22 00:45:35 kernel: ? do_madvise.part.0+0x657/0x19a0
Jan 22 00:45:35 kernel: ? srso_alias_return_thunk+0x5/0xfbef5
Jan 22 00:45:35 kernel: ? from_kgid_munged+0x16/0x30
Jan 22 00:45:35 kernel: ? srso_alias_return_thunk+0x5/0xfbef5
Jan 22 00:45:35 kernel: ? cp_new_stat+0x151/0x180
Jan 22 00:45:35 kernel: ? srso_alias_return_thunk+0x5/0xfbef5
Jan 22 00:45:35 kernel: ? __audit_syscall_entry+0xce/0x140
Jan 22 00:45:35 kernel: __x64_sys_ioctl+0xa4/0xd0
Jan 22 00:45:35 kernel: x64_sys_call+0x1227/0x2140
Jan 22 00:45:35 kernel: do_syscall_64+0x51/0x120
Jan 22 00:45:35 kernel: entry_SYSCALL_64_after_hwframe+0x76/0x7e
Jan 22 00:45:35 kernel: RIP: 0033:0x7f91abb0367b
Jan 22 00:45:35 kernel: Code: ff ff ff 85 c0 79 9b 49 c7 c4 ff ff ff ff 
5b 5d 4c 89 e0 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa b8 10 00 
00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 6d 57 0f 00 f7 d8 64 
89 01 48
Jan 22 00:45:35 kernel: RSP: 002b:00007ffea79df348 EFLAGS: 00000246 
ORIG_RAX: 0000000000000010
Jan 22 00:45:35 kernel: RAX: ffffffffffffffda RBX: 00000000232615a0 RCX: 
00007f91abb0367b
Jan 22 00:45:35 kernel: RDX: 00000000232615a0 RSI: 0000000040a0ae49 RDI: 
0000000000000006
Jan 22 00:45:35 kernel: RBP: 0000000022ce1300 R08: 0000000023261700 R09: 
0000000000000000
Jan 22 00:45:35 kernel: R10: 00000000238cd370 R11: 0000000000000246 R12: 
0000000013e45000
Jan 22 00:45:35 kernel: R13: 0000000000003e46 R14: 0000000000000000 R15: 
00007f91abd0d6c8
Jan 22 00:45:35 kernel: </TASK>
Jan 22 00:45:35 kernel: Modules linked in: binfmt_misc tls xt_CHECKSUM 
xt_MASQUERADE xt_conntrack ipt_REJECT xt_tcpudp nft_compat x_tables 
nf_nat_tftp nf_conntrack_tftp bridge stp llc nft_fib_inet nft_fib_ipv4 
nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 
nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 
nf_defrag_ipv4 ip_set nf_tables nfnetlink sunrpc nls_iso8859_1 ipmi_ssif 
amd_atl intel_rapl_msr intel_rapl_common amd64_edac kvm_amd ee1004 kvm 
i2c_piix4 rapl wmi_bmof k10temp acpi_power_meter efi_pstore pcspkr 
i2c_smbus ipmi_si acpi_ipmi ipmi_devintf ipmi_msghandler mac_hid 
sch_fq_codel dmi_sysfs xfs mgag200 drm_client_lib i2c_algo_bit 
drm_shmem_helper mpt3sas drm_kms_helper ghash_clmulni_intel sha512_ssse3 
raid_class sha256_ssse3 drm ccp tg3 scsi_transport_sas sp5100_tco 
sha1_ssse3 wmi dm_mirror dm_region_hash dm_log msr autofs4 aesni_intel 
crypto_simd cryptd
Jan 22 00:45:35 kernel: ---[ end trace 0000000000000000 ]---
Jan 22 00:45:35 kernel: pstore: backend (erst) writing error (-28)
Jan 22 00:45:35 kernel: RIP: 0010:__kmalloc_node_noprof+0xff/0x490
Jan 22 00:45:35 kernel: Code: 0f 84 0b 01 00 00 84 c9 0f 85 03 01 00 00 
41 83 fb ff 0f 85 e9 00 00 00 41 bb ff ff ff ff 41 8b 44 24 28 49 8b 34 
24 48 01 f8 <48> 8b 18 48 89 c1 49 33 9c 24 b8 00 00 00 48 89 f8 48 0f 
c9 48 31
Jan 22 00:45:35 kernel: RSP: 0018:ffffa77176403ab0 EFLAGS: 00010282
Jan 22 00:45:35 kernel: RAX: e659260b3c31e5e0 RBX: ffffed7142251180 RCX: 
0000000000000000
Jan 22 00:45:35 kernel: RDX: 0000000003106071 RSI: 000000000003b080 RDI: 
e659260b3c31e5e0
Jan 22 00:45:35 kernel: RBP: ffffa77176403b10 R08: 0000000000000000 R09: 
ffffa771c9605000
Jan 22 00:45:35 kernel: R10: ffffa77176403b28 R11: 00000000ffffffff R12: 
ffff92a240044400
Jan 22 00:45:35 kernel: R13: 0000000000000008 R14: 00000000ffffffff R15: 
0000000000000dc0
Jan 22 00:45:35 kernel: FS:  00007f91abd0d740(0000) 
GS:ffff92e13e880000(0000) knlGS:0000000000000000
Jan 22 00:45:35 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jan 22 00:45:35 kernel: CR2: 000000002346c3c8 CR3: 000000223fbb6004 CR4: 
0000000000770ef0
Jan 22 00:45:35 kernel: PKRU: 55555554/

_Recreate steps:_

1. Build and Install next-20250121 kernel with attached kernel_config.

2. Build and run selftests/kvm component from linux next-20250121 tree

Issue currently seem to be hit intermittently, I am trying to find more 
reliable recreations steps, meantime wanted to post the issue here for 
awareness/getting any pointers.

Thanks,

Srikanth Aithal <[email-masked]>