#1103236 fix a kernel warning during early boot with qemu

#1103236#5
Date:
2025-04-15 07:41:26 UTC
From:
To:
Dear Maintainer,

When I run a QEMU image on Debian Bookworm, I observed the following
warning during early boot:

[    0.000000] NUMA: Warning: invalid memblk node 16 [mem
0x0000000004000000-0x0000000007ffffff]
[    0.000000] NUMA: Faking a node at [mem
0x0000000004000000-0x00000000bfffffff]
[    0.000000] NUMA: NODE_DATA [mem 0xbfbf9f80-0xbfbfcfff]

Steps to reproduce:
# on the host:
wget
https://downloads.elxr.dev/elxr-minimal-ostree-imx-12.9.0.0-arm64.img.zst
zstd -d elxr-minimal-ostree-imx-12.9.0.0-arm64.img.zst
cp -f /usr/share/AAVMF/AAVMF_VARS.fd ./
cp -f /usr/share/AAVMF/AAVMF_CODE.fd ./
qemu-img create -f raw boot-image-qemu-single.hddimg 10G
dd if=elxr-minimal-ostree-imx-12.9.0.0-arm64.img
of=boot-image-qemu-single.hddimg conv=notrunc

qemu-system-aarch64 -m 2048 -cpu cortex-a57 -M virt -nographic \
-smp 2,sockets=2,cores=1,threads=1 \
-m 2G,slots=2,maxmem=8G \
-object memory-backend-ram,size=1024M,id=mem0 \
-object memory-backend-ram,size=1024M,id=mem1 \
-numa node,nodeid=0,cpus=0,memdev=mem0 \
-numa node,nodeid=1,cpus=1,memdev=mem1 \
-drive if=pflash,format=raw,file=AAVMF_CODE.fd \
-drive if=pflash,format=raw,file=AAVMF_VARS.fd \
-drive if=none,file=boot-image-qemu-single.hddimg,id=hd,format=raw 
-device virtio-blk-device,drive=hd

# on the guest:
root@localhost:~#
root@localhost:~# dmesg | grep -w invalid
[    0.000000] NUMA: Warning: invalid memblk node 16 [mem
0x0000000004000000-0x0000000007ffffff]
root@localhost:~#


After investigating, I found that the following upstream commit resolves
the issue:
https://salsa.debian.org/qemu-team/edk2/-/commit/e5ec3ba409b5baa9cf429cc25fdf3c8d1b8dcef0

I have backported this patch for bookworm and attached it here for your
consideration.

#1103236#10
Date:
2025-04-18 02:43:45 UTC
From:
To:
Ping  ......
#1103236#15
Date:
2025-07-19 01:18:27 UTC
From:
To:
Hi Wenlin,

Thank you for your diagnosis and for the backport. Is this causing any functional issues for you, or are you just wanting to rid of the warning? Note that updates to stable are supposed to be for issues with >= important severity.

  -dann

#1103236#18
Date:
2025-07-19 01:18:27 UTC
From:
To:
Hi Wenlin,

Thank you for your diagnosis and for the backport. Is this causing any functional issues for you, or are you just wanting to rid of the warning? Note that updates to stable are supposed to be for issues with >= important severity.

  -dann