When qemu aarch64 is configured as NUMA, the EDK2 boot fail. <br />Below is my test command:<br />```<br />
<div style="line-height: 1.42857;">qemu-system-aarch64 \</div>
<div style="line-height: 1.42857;">-nographic \</div>
<div style="line-height: 1.42857;">-serial tcp:localhost:54320 -serial tcp:localhost:54321 \</div>
<div style="line-height: 1.42857;">-smp 4 \</div>
<div style="line-height: 1.42857;">-s -S -machine virt,secure=on,mte=off,gic-version=3,virtualization=false \</div>
<div style="line-height: 1.42857;">-cpu max,sve=off \</div>
<div style="line-height: 1.42857;">-d unimp -semihosting-config enable=on,target=native \</div>
<div style="line-height: 1.42857;">-m 2048 \</div>
<div style="line-height: 1.42857;">-bios bl1.bin\</div>
<div style="line-height: 1.42857;">-initrd rootfs.cpio.gz \</div>
<div style="line-height: 1.42857;">-kernel Image -no-acpi \</div>
<div style="line-height: 1.42857;">-append 'console=ttyAMA0,38400 keep_bootcon root=/dev/vda2 ' \</div>
<div style="line-height: 1.42857;">-machine virt,iommu=smmuv3 -device virtio-scsi-pci,disable-legacy=on,id=scsi0,iommu_platform=on,addr=0x2 \</div>
<div style="line-height: 1.42857;">-object memory-backend-ram,id=mem0,size=1G \</div>
<div style="line-height: 1.42857;">-object memory-backend-ram,id=mem1,size=1G \</div>
<div style="line-height: 1.42857;">-numa node,memdev=mem0,cpus=0-1,nodeid=0 \</div>
<div style="line-height: 1.42857;">-numa node,memdev=mem1,cpus=2-3,nodeid=1<br />```<br /><br /></div>
<div>Then I found that ArmVirtPkg always take the first memory node as system memory,<br />but when I configure qemu, the memory node in qemu dtb is as following.<br /><br />```<br />
<div><span style="white-space: pre;"> </span>memory@80000000 {</div>
<div><span style="white-space: pre;"> </span>numa-node-id = <0x01>;</div>
<div><span style="white-space: pre;"> </span>reg = <0x00 0x80000000 0x00 0x40000000>;</div>
<div><span style="white-space: pre;"> </span>device_type = "memory";</div>
<div><span style="white-space: pre;"> </span>};</div>
<div> </div>
<div><span style="white-space: pre;"> </span>memory@40000000 {</div>
<div><span style="white-space: pre;"> </span>numa-node-id = <0x00>;</div>
<div><span style="white-space: pre;"> </span>reg = <0x00 0x40000000 0x00 0x40000000>;</div>
<div><span style="white-space: pre;"> </span>device_type = "memory";</div>
<div><span style="white-space: pre;"> </span>};</div>
```<br /><br />Then edk2 use 'memory@80000000' as system memory which is NUMA node 1.<br />And the memory node order is implement in qemu: arm_load_dtb() which add memory from node 0 to N.<br /><br /><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/hw/arm/boot.c#L618" target="_blank" rel="noopener">https://gitlab.com/qemu-project/qemu/-/blob/master/hw/arm/boot.c#L618</a><br /><br />As I understand it, loader should take node 0.<br />Should I modify <span style="font-family: Calibri, sans-serif; font-size: 11pt;">ArmVirtPkg/PrePi/FdtParser.c:</span><span style="font-size: 11pt; font-family: Calibri, sans-serif;">FindMemnode() for the NUMA case</span>?</div>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/91074">View/Reply Online (#91074)</a> |    |  <a target="_blank" href="https://groups.io/mt/92198841/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>