-
Notifications
You must be signed in to change notification settings - Fork 4
/
edk2-stable202408.patch
69 lines (64 loc) · 3.57 KB
/
edk2-stable202408.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 89579e247f60f063a62ac6e327230bfe0ea8388b Mon Sep 17 00:00:00 2001
From: Dongli Zhang <[email protected]>
Date: Mon, 23 Sep 2024 12:00:22 -0700
Subject: [PATCH 1/1] edk2-stable202408
Signed-off-by: Dongli Zhang <[email protected]>
---
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
index bb2389d16c..8bc702a35e 100644
--- a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
+++ b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
@@ -144,6 +144,14 @@ SetIoPadding (
reservation are determined by raising two to
this power.
**/
+/*
+ * 在以下调用SetMmioPadding():
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|702| <<GetResourcePadding>> SetMmioPadding (--FirstResource, FALSE, TRUE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|726| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, TRUE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|734| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, FALSE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|751| <<GetResourcePadding>> SetMmioPadding (--FirstResource, FALSE, TRUE, (UINTN)HighBitSetRoundUp32(SIZE_2MB));
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|766| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, FALSE, (UINTN)HighBitSetRoundUp64 (RShiftU64 (Pci64Size, 8)));
+ */
STATIC
VOID
SetMmioPadding (
@@ -541,6 +549,13 @@ InitializeRootHpc (
cannot be allocated due to insufficient
resources.
**/
+/*
+ * 在以下使用GetResourcePadding:
+ * - MdePkg/Include/Protocol/PciHotPlugInit.h|267| <<global>> EFI_GET_HOT_PLUG_PADDING GetResourcePadding;
+ * - MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c|417| <<GetResourcePaddingForHpb>> Status = gPciHotPlugInit->GetResourcePadding (
+ * - MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c|1255| <<PciScanBus>> Status = gPciHotPlugInit->GetResourcePadding (
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|843| <<DriverInitialize>> mPciHotPlugInit.GetResourcePadding = GetResourcePadding;
+ */
STATIC
EFI_STATUS
EFIAPI
@@ -757,9 +772,22 @@ GetResourcePadding (
}
if (DefaultPrefMmio) {
+ /*
+ * Pci64Size默认34359738368 = 0x800000000
+ *
+ * -fw_cfg name=opt/ovmf/X-PciMmio64Mb,string=65536
+ */
UINT64 Pci64Size = PcdGet64 (PcdPciMmio64Size);
if (Pci64Size > SIZE_32GB) {
+ /*
+ * 在以下调用SetMmioPadding():
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|702| <<GetResourcePadding>> SetMmioPadding (--FirstResource, FALSE, TRUE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|726| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, TRUE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|734| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, FALSE, (UINTN)HighBit);
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|751| <<GetResourcePadding>> SetMmioPadding (--FirstResource, FALSE, TRUE, (UINTN)HighBitSetRoundUp32(SIZE_2MB));
+ * - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c|766| <<GetResourcePadding>> SetMmioPadding (--FirstResource, TRUE, FALSE, (UINTN)HighBitSetRoundUp64 (RShiftU64 (Pci64Size, 8)));
+ */
SetMmioPadding (
--FirstResource,
TRUE,
--
2.39.3 (Apple Git-146)