Size = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2]));\r
Reg += 4;\r
\r
+ PropSize -= 4 * sizeof (UINT32);\r
+\r
+ //\r
+ // Disregard any flash devices that overlap with the primary FV.\r
+ // The firmware is not updatable from inside the guest anyway.\r
+ //\r
+ if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) &&\r
+ (Base + Size) > PcdGet64 (PcdFvBaseAddress)) {\r
+ continue;\r
+ }\r
+\r
mNorFlashDevices[Num].DeviceBaseAddress = (UINTN)Base;\r
mNorFlashDevices[Num].RegionBaseAddress = (UINTN)Base;\r
mNorFlashDevices[Num].Size = (UINTN)Size;\r
mNorFlashDevices[Num].BlockSize = QEMU_NOR_BLOCK_SIZE;\r
Num++;\r
-\r
- PropSize -= 4 * sizeof (UINT32);\r
}\r
}\r
\r