Commit e87f462
committed
bzimage: Improve initrd memory allocation
Simplified checks for address/size out of range but also a new check to
limit to identity mapped 4GiB region.
The potential address is now clamped to the max start address if that is
in the range. This fixes the issue with booting with more than 2GiB as
the Linux max is just under 2GiB and previously the potential address
would be at the top of the 3GiB boundary when running with more than
2GiB.
Tested with image boot with initrd with 1GiB and 4GiB RAM.
Fixes: #175
Signed-off-by: Rob Bradford <robert.bradford@intel.com>1 parent fe76bbb commit e87f462
1 file changed
+31
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
103 | 123 | | |
104 | 124 | | |
105 | 125 | | |
106 | | - | |
| 126 | + | |
107 | 127 | | |
108 | | - | |
| 128 | + | |
109 | 129 | | |
110 | 130 | | |
111 | 131 | | |
| |||
0 commit comments