Mailing List Archive

kernel BUG at arch/x86/xen/p2m.c:542
I'm building a new Gentoo server with Xen (4.16.6_pre1) on new hardware
and my first attempt to create
the first guest domain resulted in failure with a dmesg trace:

3013 [Tue Dec 26 11:12:04 2023] ------------[ cut here ]------------
3014 [Tue Dec 26 11:12:04 2023] kernel BUG at arch/x86/xen/p2m.c:542!
3015 [Tue Dec 26 11:12:04 2023] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
3016 [Tue Dec 26 11:12:04 2023] CPU: 19 PID: 3555 Comm: xenstored Not tainted
6.1.67-gentoo-x86_64 #1
3017 [Tue Dec 26 11:12:04 2023] Hardware name: ASRock X670E Steel
Legend/X670E Steel Legend, BIOS 1.28 07/27/2023
3018 [Tue Dec 26 11:12:04 2023] RIP: e030:xen_alloc_p2m_entry+0x485/0x8c0
3019 [Tue Dec 26 11:12:04 2023] Code: 3d a8 6c 8a 01 73 5d 48 8b 05 a7 6c 8a
01 48 8b 04 f8 48 83 f8 ff 74 59 48 bf ff ff ff ff ff ff ff 3f 48 21 c7
e9 60 fc ff ff <0f> 0b 49 8d 7e 08 4c 89 f1 48 c7 c0 ff ff ff ff 49 c7
06 ff ff ff
3020 [Tue Dec 26 11:12:04 2023] RSP: e02b:ffffc9004284fd80 EFLAGS: 00010246
3021 [Tue Dec 26 11:12:04 2023] RAX: 0000000000000000 RBX: 0000000010007fff
RCX: ffffffff82610000
3022 [Tue Dec 26 11:12:04 2023] RDX: 0000000000000000 RSI: ffffc9008003fff8
RDI: 000000000e54d067
3023 [Tue Dec 26 11:12:04 2023] RBP: ffffc9004284fe28 R08: ffffea0000000000
R09: 0000000000000000
3024 [Tue Dec 26 11:12:04 2023] R10: 0000000000000000 R11: ffff898088000000
R12: ffffc9008003fff8
3025 [Tue Dec 26 11:12:04 2023] R13: 0000000000000000 R14: 0000000010008000
R15: 0000000010008000
3026 [Tue Dec 26 11:12:04 2023] FS: 00007f5ea714ac40(0000)
GS:ffff88901f0c0000(0000) knlGS:0000000000000000
3027 [Tue Dec 26 11:12:04 2023] CS: e030 DS: 0000 ES: 0000 CR0: 0000000080050033
3028 [Tue Dec 26 11:12:04 2023] CR2: 0000563fa8a34000 CR3: 0000000106ba6000
CR4: 0000000000050660
3029 [Tue Dec 26 11:12:04 2023] Call Trace:
3030 [Tue Dec 26 11:12:04 2023] <TASK>
3031 [Tue Dec 26 11:12:04 2023] ? __die_body.cold+0x1a/0x1f
3032 [Tue Dec 26 11:12:04 2023] ? die+0x2a/0x50
3033 [Tue Dec 26 11:12:04 2023] ? do_trap+0xc5/0x110
3034 [Tue Dec 26 11:12:04 2023] ? xen_alloc_p2m_entry+0x485/0x8c0
3035 [Tue Dec 26 11:12:04 2023] ? do_error_trap+0x6a/0x90
3036 [Tue Dec 26 11:12:04 2023] ? xen_alloc_p2m_entry+0x485/0x8c0
3037 [Tue Dec 26 11:12:04 2023] ? exc_invalid_op+0x4c/0x60
3038 [Tue Dec 26 11:12:04 2023] ? xen_alloc_p2m_entry+0x485/0x8c0
3039 [Tue Dec 26 11:12:04 2023] ? asm_exc_invalid_op+0x16/0x20
3040 [Tue Dec 26 11:12:04 2023] ? xen_alloc_p2m_entry+0x485/0x8c0
3041 [Tue Dec 26 11:12:04 2023] xen_alloc_unpopulated_pages+0x9a/0x430
3042 [Tue Dec 26 11:12:04 2023] gnttab_alloc_pages+0x14/0x40
3043 [Tue Dec 26 11:12:04 2023] gntdev_alloc_map+0x1cf/0x2e0
3044 [Tue Dec 26 11:12:04 2023] gntdev_ioctl+0x307/0x550
3045 [Tue Dec 26 11:12:04 2023] __x64_sys_ioctl+0x90/0xd0
3046 [Tue Dec 26 11:12:04 2023] do_syscall_64+0x3b/0x90
3047 [Tue Dec 26 11:12:04 2023] entry_SYSCALL_64_after_hwframe+0x64/0xce
3048 [Tue Dec 26 11:12:04 2023] RIP: 0033:0x7f5ea7261d0b
3049 [Tue Dec 26 11:12:04 2023] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60
c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10
00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04
25 28 00 00
3050 [Tue Dec 26 11:12:04 2023] RSP: 002b:00007fffc998b0e0 EFLAGS: 00000246
ORIG_RAX: 0000000000000010
3051 [Tue Dec 26 11:12:04 2023] RAX: ffffffffffffffda RBX: 0000000000001000
RCX: 00007f5ea7261d0b
3052 [Tue Dec 26 11:12:04 2023] RDX: 00007fffc998b140 RSI: 0000000000184700
RDI: 000000000000000c
3053 [Tue Dec 26 11:12:04 2023] RBP: 00007fffc998b1f0 R08: 00007fffc998b21c
R09: 00007fffc998b140
3054 [Tue Dec 26 11:12:04 2023] R10: 00007fffc998b21c R11: 0000000000000246
R12: 0000000000000001
3055 [Tue Dec 26 11:12:04 2023] R13: 0000000000000003 R14: 000000000000000c
R15: 00007fffc998b140
3056 [Tue Dec 26 11:12:04 2023] </TASK>
3057 [Tue Dec 26 11:12:04 2023] Modules linked in: xen_pciback cfg80211 8021q
garp mrp vfat fat amdgpu mfd_core iommu_v2 gpu_sched drm_buddy
snd_hda_codec_realtek i2c_algo_bit drm_ttm_helper snd_hda_codec_generic
ledtrig_audio snd_hda_codec_hdmi ttm drm_display_helper snd_hda_intel
cec btusb intel_rapl_msr snd_intel_dspcfg btrtl intel_rapl_common
rc_core btbcm snd_intel_sdw_acpi snd_hda_codec btintel sd_mod
crct10dif_pclmul snd_hda_core drm_kms_helper bluetooth snd_hwdep
ghash_clmulni_intel snd_pcm sha512_ssse3 drm sp5100_tco ecdh_generic
sha256_ssse3 uas snd_timer rfkill i2c_piix4 wmi_bmof joydev sha1_ssse3
usb_storage ecc pcspkr efi_pstore k10temp snd i2c_core soundcore ccp
video wmi backlight gpio_amdpt gpio_generic mac_hid efivarfs xfs nvme
nvme_core xhci_pci crc32_pclmul xhci_pci_renesas crc32c_intel t10_pi
aesni_intel crypto_simd cryptd crc64_rocksoft r8169 ahci realtek
xhci_hcd mdio_devres crc64 libahci libphy
3058 [Tue Dec 26 11:12:04 2023] ---[ end trace 0000000000000000 ]---

I've logged a bug in Gentoo's Bug system with all the details and
background:

     https://bugs.gentoo.org/920747

I've posted preserved colorized "scripts" of the attempt and dmesg
output and
HTML conversions with line numbers, along with relevent files at:

https://salemdata.us/xen/20231226_bug/

I am not posting to xen developers because
https://xenproject.org/help/mailing-list/ instructs:
"Please do not use this list for technical support queries."

Thank you,

John Poole
Re: kernel BUG at arch/x86/xen/p2m.c:542 [ In reply to ]
On 12/26/2023 2:39 PM, John L. Poole wrote:
> I'm building a new Gentoo server with Xen (4.16.6_pre1) on new hardware
> and my first attempt to create
> the first guest domain resulted in failure with a dmesg trace:
> <snip>

I think I may have determined the problem and fixed it: ballooning and/or
allocated all of memory to Dom0 leaving none for a VM.  See for fix:

https://bugs.gentoo.org/920747

John