Compare commits
1897 Commits
edk2-stabl
...
rebase-sta
Author | SHA1 | Date | |
---|---|---|---|
|
242dcee217 | ||
|
3f8a2a16b9 | ||
|
c24fa67677 | ||
|
cd00f3f47f | ||
|
b4f9a2237d | ||
|
9df51aa79f | ||
|
013e5c94d6 | ||
|
f04bd1e3b8 | ||
|
3e722403cd | ||
|
66c69871e7 | ||
|
c98f7f7550 | ||
|
865229bcc8 | ||
|
4ddf2448ed | ||
|
9440986d4e | ||
|
32460bb5b1 | ||
|
207b6d68a0 | ||
|
dff3d3811f | ||
|
4afb939531 | ||
|
72a9ef1c8a | ||
|
1904a64bcc | ||
|
4c4ceb2ceb | ||
|
a85336531c | ||
|
e10d83234c | ||
|
677204f941 | ||
|
cb9d711891 | ||
|
4f58e0cf99 | ||
|
024a291b3e | ||
|
319bb7223a | ||
|
7142e64841 | ||
|
284dbac43d | ||
|
558a25366d | ||
|
4b6ee06a09 | ||
|
3c0b84420f | ||
|
25996a3441 | ||
|
b82c9631da | ||
|
f3b0ee0cee | ||
|
09340de246 | ||
|
6fd2d58d5d | ||
|
b538d6a1b1 | ||
|
b04e11b4c4 | ||
|
5cbfb93abe | ||
|
952b5cf94c | ||
|
82b0358e3f | ||
|
5590cefe93 | ||
|
916f495e77 | ||
|
efc7ccf906 | ||
|
fa7fdb89a3 | ||
|
2727231b0a | ||
|
23ed7f209c | ||
|
6b3a89a9fd | ||
|
4a6400b084 | ||
|
04c36d5a1b | ||
|
6a468a8b55 | ||
|
3dfd64305b | ||
|
47f212295f | ||
|
c56ea95b28 | ||
|
9783dc01cc | ||
|
7421094136 | ||
|
42e8fa84f7 | ||
|
51fcd2023b | ||
|
af9b851732 | ||
|
987bea6525 | ||
|
1c0d4ae2c0 | ||
|
c12bbc1490 | ||
|
17f333f2a4 | ||
|
7097c97bde | ||
|
370c55b2ba | ||
|
24fa360857 | ||
|
248aa153f6 | ||
|
fecf55a66a | ||
|
f0ed194236 | ||
|
fd290ab862 | ||
|
5f783827bb | ||
|
5d4c5253e8 | ||
|
ec6e59aefe | ||
|
1699845c5f | ||
|
3a4efc98b0 | ||
|
3d87214a20 | ||
|
fcce7f77e6 | ||
|
748d57d40f | ||
|
5e31c5666d | ||
|
e942b85a21 | ||
|
0c74aa2073 | ||
|
88781ccd74 | ||
|
54a4fd9b35 | ||
|
9bc2725198 | ||
|
cf3b34c0b8 | ||
|
750d763623 | ||
|
c3f615a1bd | ||
|
d8e4c4b000 | ||
|
74db2ed3e5 | ||
|
5f391c6606 | ||
|
338fd26b8f | ||
|
094727264f | ||
|
c0dfe3ec1f | ||
|
66c24219ad | ||
|
90b6725562 | ||
|
d97f964f7c | ||
|
e3fa6986ae | ||
|
86c8d69146 | ||
|
680030a6ec | ||
|
7dd7b89058 | ||
|
f29160a896 | ||
|
506740982b | ||
|
ddc43e7a41 | ||
|
538b8944c1 | ||
|
d0906f602b | ||
|
be92e09206 | ||
|
6780b3aba0 | ||
|
1dc752d903 | ||
|
8b02ecc5f0 | ||
|
6dc09fda04 | ||
|
390b10b548 | ||
|
7dec566775 | ||
|
0afb874349 | ||
|
47001ab989 | ||
|
a010681f74 | ||
|
28fecae8a3 | ||
|
18fdffe825 | ||
|
b505f11f39 | ||
|
5a67a2efa7 | ||
|
f6bf37c171 | ||
|
ee89b59430 | ||
|
6ced1e91ef | ||
|
789727ccf3 | ||
|
d2b18e6bc2 | ||
|
30d274e354 | ||
|
c0bf953fe8 | ||
|
8ccbf075f0 | ||
|
069f9911a3 | ||
|
2b330b57db | ||
|
f40c1f2a30 | ||
|
5fe9db0f82 | ||
|
6b14ef6b28 | ||
|
4bd3b5ab13 | ||
|
5bdb091133 | ||
|
8a6471819b | ||
|
c212fec9cf | ||
|
61185f1d50 | ||
|
93fac4fd7b | ||
|
c98fbda328 | ||
|
93ff80a218 | ||
|
71aaf7a308 | ||
|
fcfdbe2987 | ||
|
b6cd5ddce9 | ||
|
32e2968a1e | ||
|
7ea05d8fe9 | ||
|
bfcf2d66c7 | ||
|
6363872629 | ||
|
0b2f97c00a | ||
|
abaf405ed9 | ||
|
392a368533 | ||
|
032830e968 | ||
|
c5fb47ddab | ||
|
78e5019071 | ||
|
7750468c37 | ||
|
439030bc37 | ||
|
cc63e04afc | ||
|
022ddb8f84 | ||
|
fecca982e3 | ||
|
18ad6485a9 | ||
|
70892b13b2 | ||
|
74f6ce6734 | ||
|
da7858117f | ||
|
b594fba4ec | ||
|
de95e919be | ||
|
31cd5ee8c0 | ||
|
5ba3602e45 | ||
|
d77efa2ebe | ||
|
0707d9296d | ||
|
e25808f501 | ||
|
98f150a954 | ||
|
963671d380 | ||
|
665789b61b | ||
|
013006e4ef | ||
|
543add1d41 | ||
|
932db9df0c | ||
|
b7f8779fe1 | ||
|
3d5352d934 | ||
|
6ddfbeb0d6 | ||
|
f1203a4099 | ||
|
c98c14576f | ||
|
503344cdbd | ||
|
89ff5da9f9 | ||
|
ee28bea4c0 | ||
|
8707f835ae | ||
|
ee249efe8c | ||
|
6fb3cc05dc | ||
|
79d4d8a81c | ||
|
2e4e41d012 | ||
|
c8f56800fd | ||
|
b0be42516e | ||
|
29114fc574 | ||
|
b387114113 | ||
|
7cc2010f46 | ||
|
b79a64d26e | ||
|
e043e3e3bf | ||
|
8f698f0a64 | ||
|
d402de2222 | ||
|
278250045b | ||
|
37f63deeef | ||
|
596f856c13 | ||
|
1fb6462c67 | ||
|
7fde22823d | ||
|
e4e1f6229c | ||
|
cf58f47623 | ||
|
4b9312de05 | ||
|
7f1ffba5de | ||
|
35f6a2780e | ||
|
a1a6da80aa | ||
|
07c49d5d40 | ||
|
3840c35e34 | ||
|
ccbbc2a5c8 | ||
|
e7486b5064 | ||
|
68461c2c37 | ||
|
bf8f16f771 | ||
|
019feb42a1 | ||
|
5572b43c67 | ||
|
308e6e0936 | ||
|
6b3a512149 | ||
|
6f67ed45e0 | ||
|
a8b80149e1 | ||
|
ddaf39263a | ||
|
ccf91b518f | ||
|
1c0db23151 | ||
|
18fc96c9a9 | ||
|
1e603ac0d8 | ||
|
063a831c66 | ||
|
f71a76ee01 | ||
|
91460083f1 | ||
|
524feaa32f | ||
|
9f9bf82209 | ||
|
1fbc121cfe | ||
|
da4aa451ba | ||
|
e60529df58 | ||
|
2a0d4a2641 | ||
|
918288ab5a | ||
|
bff9815b61 | ||
|
1ae5bee967 | ||
|
855f528199 | ||
|
970aacd191 | ||
|
3775122ede | ||
|
47723854fd | ||
|
275d0a39c4 | ||
|
318b0d714a | ||
|
49b7faba1d | ||
|
e3bd782373 | ||
|
b7a97bfac5 | ||
|
4329b5b0cd | ||
|
52e44713d2 | ||
|
fded08e744 | ||
|
371940932d | ||
|
2ec8f0c640 | ||
|
049ff6c39c | ||
|
17b2872200 | ||
|
ae1079b386 | ||
|
dcffad2491 | ||
|
d159e22913 | ||
|
dc7cfa9bab | ||
|
bac9c74080 | ||
|
adebfe121c | ||
|
13fbc16556 | ||
|
73ac735be8 | ||
|
d9a6e7b0b8 | ||
|
d4c76fa17d | ||
|
422dfaab31 | ||
|
9da786c16f | ||
|
0ce2012c6c | ||
|
1988f2df29 | ||
|
3e91e42136 | ||
|
6d571c0070 | ||
|
0bbec15b54 | ||
|
45ad13bb64 | ||
|
dae8c29dab | ||
|
e59a40b92c | ||
|
aceb3490a2 | ||
|
3ad1d7eb7b | ||
|
8757e648d1 | ||
|
9d32a02a72 | ||
|
ba9c3ceaf8 | ||
|
e7a7169446 | ||
|
74b5309da9 | ||
|
33c81c25bb | ||
|
d25421d0d8 | ||
|
5e09b5d6d7 | ||
|
c8e77454b5 | ||
|
e2c9d8eba4 | ||
|
b485230462 | ||
|
a3ee1eea96 | ||
|
1f161a7915 | ||
|
68238d4f94 | ||
|
44fdc4f398 | ||
|
d0c0e1960a | ||
|
ba96acd963 | ||
|
f881b4d129 | ||
|
bc982869dd | ||
|
8d7c48e0e7 | ||
|
6bb39cfd00 | ||
|
a7a0443751 | ||
|
796e1b82df | ||
|
65200edb3a | ||
|
bda5b4a6cf | ||
|
7f17a15564 | ||
|
b25f84d7b3 | ||
|
efca2c6cfc | ||
|
2cb466cc2c | ||
|
7fa4a984c4 | ||
|
11ad164bce | ||
|
8ccd63d14d | ||
|
c10e5703fe | ||
|
2f4b07b668 | ||
|
2ca8d55974 | ||
|
d698bcfe4f | ||
|
edc6681206 | ||
|
72c441df36 | ||
|
5fd3078a2e | ||
|
75deaf5c3c | ||
|
af3fad99d6 | ||
|
1c440a5ece | ||
|
a1c426e844 | ||
|
0a989069df | ||
|
2d144d7e14 | ||
|
312ccaf81b | ||
|
81b69f306f | ||
|
46c6de57b0 | ||
|
ded41a64bd | ||
|
8801c75b4d | ||
|
dcdc6f8e3f | ||
|
844ead5bce | ||
|
ef4d35d4ed | ||
|
e4ceae5c18 | ||
|
dcf2e39dce | ||
|
e32b58ab5a | ||
|
8f316e99ec | ||
|
4d1f0babe2 | ||
|
1d0b95f645 | ||
|
ff2986358f | ||
|
fac297724e | ||
|
7f04c7a253 | ||
|
458c582685 | ||
|
1b53515d53 | ||
|
c9c87f08dd | ||
|
4df0229ef9 | ||
|
6f77463d72 | ||
|
bbfee34f41 | ||
|
07362769ab | ||
|
1dbb10cc52 | ||
|
5f3658197b | ||
|
8014ac2d7b | ||
|
f31453e8d6 | ||
|
959f71c801 | ||
|
9eddbab650 | ||
|
62b43ec896 | ||
|
6bbce86d21 | ||
|
0cca97e0a8 | ||
|
5a3788bfca | ||
|
010f7298ce | ||
|
147beaa5e7 | ||
|
55a0cdb61c | ||
|
54c2cdb241 | ||
|
3db49a6ca8 | ||
|
f560c5d112 | ||
|
3f8fb8aeb9 | ||
|
bc0b418cba | ||
|
0565a8e885 | ||
|
414ad233a5 | ||
|
344dc4b9d3 | ||
|
2ff435b264 | ||
|
57684402e4 | ||
|
e5b5073153 | ||
|
9e1576bc10 | ||
|
ae59b8ba41 | ||
|
397a084b9b | ||
|
30a25f2778 | ||
|
056b4bf74b | ||
|
141dcaed6c | ||
|
cd6f215223 | ||
|
a1b98c8f84 | ||
|
927ea1364d | ||
|
a3aab12c34 | ||
|
3656352675 | ||
|
97c3f5b8d2 | ||
|
0e9b124f9c | ||
|
d14526372d | ||
|
40a45b5a2b | ||
|
af6e0e728f | ||
|
c5e702e45a | ||
|
909a9a5ae4 | ||
|
9ac93da5b5 | ||
|
beefa753f3 | ||
|
98c7cb3be7 | ||
|
a6013625a3 | ||
|
dc33394701 | ||
|
dec9d35738 | ||
|
b2c4916344 | ||
|
fc04cfd119 | ||
|
3344495489 | ||
|
0a9060b259 | ||
|
71ec5d3415 | ||
|
e3992e40c7 | ||
|
ec15e345ae | ||
|
9f0ebabb57 | ||
|
3630cdf6e7 | ||
|
4c43209a74 | ||
|
7d7decfa3d | ||
|
9a75b030cf | ||
|
aeaee8944f | ||
|
049695a0b1 | ||
|
ff52277e37 | ||
|
588cfc63d2 | ||
|
5694ff42d5 | ||
|
97e1ef8730 | ||
|
d24187a81f | ||
|
1063665fa5 | ||
|
7f72c2829f | ||
|
417ebe6d1d | ||
|
2ddae5df31 | ||
|
d97f3a1d80 | ||
|
313f9f0155 | ||
|
0b09397dfa | ||
|
0c6d29be8b | ||
|
da228b29bd | ||
|
5d016fe0a0 | ||
|
0223bdd4e4 | ||
|
00bf6890a9 | ||
|
9d3fe85fcc | ||
|
264636d8e6 | ||
|
326db0c907 | ||
|
40adbb7f62 | ||
|
b481b00f59 | ||
|
735d0a5e2e | ||
|
b25733c974 | ||
|
28ffd72689 | ||
|
35d8ea8097 | ||
|
0395045ae3 | ||
|
59f024c76e | ||
|
9971b99461 | ||
|
8f6d343ae6 | ||
|
0d341c01ee | ||
|
c7b2794421 | ||
|
1ddcb9fc6b | ||
|
4776a1b39e | ||
|
2244465432 | ||
|
a4b8944e27 | ||
|
682a5ed1a2 | ||
|
638e4ca238 | ||
|
7c2757c298 | ||
|
82e149f2bf | ||
|
6d204e8fbc | ||
|
bfad87ceec | ||
|
195e59bd0c | ||
|
d65b183f92 | ||
|
6a01fb2ea5 | ||
|
c15a899d83 | ||
|
f5b91c60ef | ||
|
db59ff333d | ||
|
cfe4846572 | ||
|
2bce85bd86 | ||
|
58355ec192 | ||
|
0765ee6cd3 | ||
|
ebf378a1ad | ||
|
f91029947b | ||
|
8ae17a71af | ||
|
fd629ef6e3 | ||
|
889535caf8 | ||
|
e7cfdc5f14 | ||
|
6c488a2f39 | ||
|
7d055812cc | ||
|
bc34a79cd2 | ||
|
265b4ab91b | ||
|
b0e892d8a9 | ||
|
0a12d8bd55 | ||
|
8466480965 | ||
|
43ab6622a8 | ||
|
0abd598e3f | ||
|
edba0779ba | ||
|
4a443f73fd | ||
|
ae22b2f136 | ||
|
3b1ddbddee | ||
|
08a6528bac | ||
|
2a5c08caaf | ||
|
f2b074398c | ||
|
e7152e6186 | ||
|
c3d865a4c2 | ||
|
ff1305c9fb | ||
|
9cf1d03ebe | ||
|
5a2490df0e | ||
|
3114fd8ed7 | ||
|
e8166a852e | ||
|
e449451770 | ||
|
16c8cfc810 | ||
|
ea658e35a9 | ||
|
7a5823f85b | ||
|
5804e94886 | ||
|
0d39caefb9 | ||
|
d7d4f09ff8 | ||
|
91f1ce4e27 | ||
|
139887a989 | ||
|
f8de39afab | ||
|
d1c21f8d55 | ||
|
17870bf3f5 | ||
|
2cd1b439d7 | ||
|
9e3de4eee0 | ||
|
5e2338d3df | ||
|
24de462a9d | ||
|
8b59cb79fa | ||
|
a87e8505b1 | ||
|
d81813368a | ||
|
0f66c2e687 | ||
|
4fdd5165c1 | ||
|
59b4b5017c | ||
|
58d9463939 | ||
|
41d1c4475b | ||
|
3a4ec6de01 | ||
|
e1b62f3e28 | ||
|
c7c2de798a | ||
|
7b3b39a2e4 | ||
|
54c662845f | ||
|
1065536c64 | ||
|
d01defe06b | ||
|
29ce755cba | ||
|
f8c918c46f | ||
|
ea65643547 | ||
|
5d533bbc27 | ||
|
9f0061a03b | ||
|
89705ad6c6 | ||
|
a83d953dc2 | ||
|
cc698d0335 | ||
|
0a248f169d | ||
|
32f84bd310 | ||
|
69eb9ad4a1 | ||
|
6f6a43cc8e | ||
|
ba822d2851 | ||
|
e14a022246 | ||
|
8c1e9f9c6f | ||
|
b1f33cbf81 | ||
|
904b002c50 | ||
|
26727c2ae2 | ||
|
30faafd024 | ||
|
286b30f517 | ||
|
3c66390e4a | ||
|
4a9fcab124 | ||
|
0904161f6f | ||
|
c012284048 | ||
|
74daeded0c | ||
|
3ce5f2d445 | ||
|
7f5e75895b | ||
|
59a952d9ab | ||
|
b8a3eec88c | ||
|
cee7ba349c | ||
|
725acd0b9c | ||
|
e51965ddd1 | ||
|
fc4f6627f8 | ||
|
be44fff723 | ||
|
e10f1f5a04 | ||
|
c02eed8e5a | ||
|
1d50544aa2 | ||
|
3c73532a8a | ||
|
aa2f32cefa | ||
|
9e9c35970a | ||
|
20ca600d67 | ||
|
03be51e106 | ||
|
5b5481526f | ||
|
59f0d350a9 | ||
|
9627447625 | ||
|
b5f5106c1e | ||
|
bb13a4adab | ||
|
85a5141a32 | ||
|
3c40ee8c68 | ||
|
2cd9d5f6fa | ||
|
ff22700fc0 | ||
|
408ca20a95 | ||
|
b59574a066 | ||
|
e8c23d1e27 | ||
|
7eb5040607 | ||
|
ad0b1cc144 | ||
|
fe2abc9b74 | ||
|
eccdab611c | ||
|
605248f0fd | ||
|
cf9030f69f | ||
|
67864ffd52 | ||
|
fb5c153abd | ||
|
05cffb6637 | ||
|
89bd992b1f | ||
|
0e0a0a5ee8 | ||
|
528ae029ad | ||
|
e8f860d924 | ||
|
769c46a9a2 | ||
|
f14317e9ba | ||
|
504a0fed85 | ||
|
dd63cb95af | ||
|
f19b3d0cdc | ||
|
bc495d89d4 | ||
|
86cc0f15d9 | ||
|
8bd14e685e | ||
|
9d4becddba | ||
|
5161ba8ea0 | ||
|
0730f564ad | ||
|
d7e41ce340 | ||
|
f0c5d652d9 | ||
|
209480b047 | ||
|
87d0e572c8 | ||
|
934b7f5a73 | ||
|
ec60da4232 | ||
|
4493d74e18 | ||
|
59dc8743ce | ||
|
ac79397267 | ||
|
e948ceeb80 | ||
|
545a5f6b68 | ||
|
237a0564d4 | ||
|
3f3e90d678 | ||
|
0600bea167 | ||
|
3099db510e | ||
|
506cc670c0 | ||
|
238690a30d | ||
|
553dfb0f57 | ||
|
fd1dd8568c | ||
|
3018685da8 | ||
|
04d47a9bf0 | ||
|
b5f20eca8a | ||
|
ff4c49a5ee | ||
|
df2ec2aab0 | ||
|
b59ab98049 | ||
|
7e18c9a788 | ||
|
02d6f39bd5 | ||
|
c83ffd2676 | ||
|
ef3fde64aa | ||
|
120aa60644 | ||
|
5cdeff1eb3 | ||
|
cf31257ec9 | ||
|
cfafa45002 | ||
|
4b5e2b3ac1 | ||
|
dbaf9d3046 | ||
|
8325fd6466 | ||
|
843ed20714 | ||
|
a3b56f93e1 | ||
|
3e133f730b | ||
|
e2d4f75913 | ||
|
7182621edc | ||
|
c3769e392b | ||
|
70b174e24d | ||
|
534021965f | ||
|
26d484d086 | ||
|
b4f8c75e31 | ||
|
ed923afda5 | ||
|
59b6b5059b | ||
|
c0207583e0 | ||
|
4f99b5fb93 | ||
|
68d506e0d1 | ||
|
88580a79d4 | ||
|
cdf36b1e36 | ||
|
466f2f0c5f | ||
|
38ba4a64c5 | ||
|
e1627f7720 | ||
|
9eec96bd4f | ||
|
6436d9b693 | ||
|
3c5f9ac5c3 | ||
|
447798cd3a | ||
|
d451bba399 | ||
|
0e9ce9146a | ||
|
972e3b0b9d | ||
|
ec9cb4452e | ||
|
4ec2fab279 | ||
|
3565ee6c29 | ||
|
aa77dac3fb | ||
|
960c7b25c2 | ||
|
cf78580a34 | ||
|
7ae0516dd9 | ||
|
e2f2bbe208 | ||
|
acb29d4cbe | ||
|
0a9e215312 | ||
|
7284c44951 | ||
|
561362368b | ||
|
26460342d0 | ||
|
1ef4e102c2 | ||
|
21b831c5b5 | ||
|
16b1e88502 | ||
|
8bc44608b8 | ||
|
33e31c289c | ||
|
cb3f41a937 | ||
|
8736b8fdca | ||
|
f444c4bea5 | ||
|
8dd52c949e | ||
|
15538bc62e | ||
|
23dbb8a07d | ||
|
3db76e6476 | ||
|
06b27ccb90 | ||
|
c9cce5a005 | ||
|
33deaa3b84 | ||
|
706811819d | ||
|
05f3c3f3d0 | ||
|
1cb580be85 | ||
|
431ead235f | ||
|
589f2e49e5 | ||
|
35c0c63edb | ||
|
e077ccff6d | ||
|
8a41004643 | ||
|
212cf07aaa | ||
|
68e37f4578 | ||
|
616f0d5037 | ||
|
bb18fb80ab | ||
|
c96b4da2a0 | ||
|
d461137e22 | ||
|
a3e8efcc8e | ||
|
1384ce443d | ||
|
29763016e0 | ||
|
b531ca4bb3 | ||
|
5464d0bed6 | ||
|
c1393bd486 | ||
|
da21991953 | ||
|
e53c618ea4 | ||
|
ae02d487a3 | ||
|
778134e491 | ||
|
ee942c5360 | ||
|
038499a268 | ||
|
08ac799d36 | ||
|
0b4acb88d6 | ||
|
8da978bf68 | ||
|
fbbbd98499 | ||
|
1b1509abee | ||
|
ccbe2e9383 | ||
|
36812d6c3e | ||
|
a6871b5359 | ||
|
2e128302e6 | ||
|
fe6cd1c187 | ||
|
d4358a7f76 | ||
|
f3b2187d55 | ||
|
8e74629070 | ||
|
2426a35625 | ||
|
aa8431822b | ||
|
a671a14e63 | ||
|
08431081a3 | ||
|
09fd4e4172 | ||
|
3ee23713e1 | ||
|
f81ee47513 | ||
|
4821daa524 | ||
|
2b0d117b4b | ||
|
50e8518276 | ||
|
36e9f3d08a | ||
|
cf62548a35 | ||
|
db9800dce8 | ||
|
f9925c8953 | ||
|
822c54eb01 | ||
|
4f3ee7fbaf | ||
|
7806713f00 | ||
|
7f5c24ad35 | ||
|
7ff6ab2b3e | ||
|
7e08d17a4a | ||
|
ca32f75fc6 | ||
|
1e27258a89 | ||
|
a00f7a355a | ||
|
716a3292e0 | ||
|
504953ef97 | ||
|
41c622523d | ||
|
d0cac9f63f | ||
|
f945b72331 | ||
|
601abf5d50 | ||
|
ba5d955e25 | ||
|
b7e6d97973 | ||
|
115b59d9c6 | ||
|
66046aeb6d | ||
|
5fc3c39704 | ||
|
f078a6fdd4 | ||
|
eb83b53309 | ||
|
74c687cc2f | ||
|
fe43b42676 | ||
|
9a38ddc806 | ||
|
8765f3eb42 | ||
|
1cbdd6e9ff | ||
|
cf68ff6130 | ||
|
9bb5ef1287 | ||
|
884ef98454 | ||
|
00dbde5fa4 | ||
|
1f21e11168 | ||
|
cf87fd95c1 | ||
|
170d4ce8e9 | ||
|
d85bf54b7f | ||
|
a6648418c1 | ||
|
e17e58e81b | ||
|
fb044b7fe8 | ||
|
da73578bf7 | ||
|
2ad52adb66 | ||
|
87ef986eeb | ||
|
f8923b72de | ||
|
e44097a965 | ||
|
e5b4fe21ae | ||
|
b24c8b0467 | ||
|
1cd0227c5d | ||
|
22b667c821 | ||
|
2298769ecf | ||
|
36b41b067f | ||
|
cbcdf4ff7b | ||
|
9f5e409623 | ||
|
309450db26 | ||
|
ec7f734366 | ||
|
575bd4f55c | ||
|
c591395f4a | ||
|
bed477d9cf | ||
|
0355e559c6 | ||
|
96ed60dfd7 | ||
|
8abbf6d87e | ||
|
b75d9f556d | ||
|
7fe49887c4 | ||
|
3c3136d3b6 | ||
|
e6e0e7ba74 | ||
|
189addfde6 | ||
|
c62fb45549 | ||
|
747a08eae2 | ||
|
01e1bc2894 | ||
|
772ec92577 | ||
|
a445e1a42c | ||
|
03d6569f70 | ||
|
e07948255c | ||
|
326b9e1d81 | ||
|
eebd446875 | ||
|
c109e4a244 | ||
|
26754b3707 | ||
|
c5fedb030a | ||
|
4049ca493c | ||
|
b26f7dfe29 | ||
|
97f51f2e9b | ||
|
60222e7eb9 | ||
|
731aa70881 | ||
|
586f05b9de | ||
|
1a79cc7d95 | ||
|
95c9f470ca | ||
|
137f799aae | ||
|
01b0d19dbb | ||
|
c4fdec0a83 | ||
|
4b7b32f846 | ||
|
c032db3308 | ||
|
1d0fd0bb3d | ||
|
1217f59d23 | ||
|
cc070b88e4 | ||
|
0103d09ebe | ||
|
a519014472 | ||
|
0d89ceae31 | ||
|
5b76b4a9f9 | ||
|
1ec374cb50 | ||
|
f784fc0e39 | ||
|
ca3f8638fa | ||
|
bf03c4a52a | ||
|
4ddd8ac3a2 | ||
|
5087a07736 | ||
|
82191f8a0e | ||
|
6439c73356 | ||
|
d073a54511 | ||
|
1497c4b074 | ||
|
1a66bd51ca | ||
|
2b2705343a | ||
|
ae79efb7bd | ||
|
80bbea192a | ||
|
cbf0e4f5b3 | ||
|
f6a314e5b5 | ||
|
f36e1ec1f0 | ||
|
ad1c0394b1 | ||
|
be971fc302 | ||
|
bf0bdacdd6 | ||
|
39f3c26e8c | ||
|
d6b05375b4 | ||
|
c70d914428 | ||
|
d11f0ea045 | ||
|
43dcf453fc | ||
|
8b2e6b90b8 | ||
|
909e870e34 | ||
|
b5003ab725 | ||
|
fd0ccccb42 | ||
|
b2df3ee17f | ||
|
8f5505a4c9 | ||
|
28a267af40 | ||
|
e9f5d8c0e0 | ||
|
f67e1934d9 | ||
|
ea628f28e5 | ||
|
89dad77cfb | ||
|
4317b4824b | ||
|
4fb69c2bee | ||
|
eb485b6438 | ||
|
baee97670f | ||
|
7275993dc6 | ||
|
cbcf0428e8 | ||
|
97d367f37e | ||
|
8803033c0c | ||
|
1312c2e9fd | ||
|
bc7bbd3bc4 | ||
|
5cfb5d6c01 | ||
|
6f0729484f | ||
|
408e463135 | ||
|
db38c7de64 | ||
|
dea6002d6e | ||
|
718cf21a5a | ||
|
392456240a | ||
|
29cce3356a | ||
|
1bfd63ac39 | ||
|
5242bae5dd | ||
|
cdfe4310dd | ||
|
4a1afea6f7 | ||
|
b844b106e2 | ||
|
7f1a8cad99 | ||
|
6d074d6a10 | ||
|
c95158e419 | ||
|
4f4a2c3b07 | ||
|
b7a48bed16 | ||
|
e880c307c5 | ||
|
a5cbb59905 | ||
|
cc26a2cb31 | ||
|
f18ec60fa4 | ||
|
0bcc503595 | ||
|
b240eab035 | ||
|
d4ae5df711 | ||
|
d42ad81e22 | ||
|
28a74d7ab2 | ||
|
493a375eef | ||
|
60d0f5802b | ||
|
b74f1f7ab5 | ||
|
ff7ddc02b2 | ||
|
19438cff97 | ||
|
5443c2dc31 | ||
|
414c0f2089 | ||
|
cf07238e5f | ||
|
bd1f0eecc1 | ||
|
65b5dd828e | ||
|
e93468442b | ||
|
2f981bddcb | ||
|
2ce5ae43c2 | ||
|
cf82c09bac | ||
|
48de494bb4 | ||
|
bc19f50c70 | ||
|
b1955cddb2 | ||
|
634192665e | ||
|
b29150aa3e | ||
|
aff67922c5 | ||
|
163083fd80 | ||
|
b81557a00c | ||
|
bbf1822295 | ||
|
24da5c2f28 | ||
|
4d196352f3 | ||
|
9b3d4f28f0 | ||
|
d1e4a16f86 | ||
|
f008890ae5 | ||
|
a23f4377c1 | ||
|
8b66f9df1b | ||
|
dfb941d32a | ||
|
beafabdae4 | ||
|
4c8144dd66 | ||
|
a60eef3afa | ||
|
c5753c3e38 | ||
|
0c4d0b6c8a | ||
|
e8aa4c6546 | ||
|
a481c11144 | ||
|
5f46eb2307 | ||
|
9896a9c618 | ||
|
14bf2cb411 | ||
|
020cc9e2e7 | ||
|
a107fcb618 | ||
|
b1e558f636 | ||
|
2c7fd32676 | ||
|
92006e5804 | ||
|
819cfc6b42 | ||
|
00b51e0d78 | ||
|
48089f3a7c | ||
|
eaffa1d7ff | ||
|
1d76560146 | ||
|
98e9d29e06 | ||
|
055c7bd1a7 | ||
|
991515a058 | ||
|
e91bfffd4f | ||
|
46226fb5d3 | ||
|
c0aeb92663 | ||
|
dfa6147a79 | ||
|
2bead79cfc | ||
|
b2ff8e45db | ||
|
4b5faa5775 | ||
|
43e0ede26b | ||
|
f0d3e59754 | ||
|
bdf3142eb7 | ||
|
20193b20b5 | ||
|
bf1ff73c8c | ||
|
cea8e3b513 | ||
|
ea7a37d352 | ||
|
9b9b331e0f | ||
|
5e1900f266 | ||
|
174a306ccd | ||
|
3af00aec7f | ||
|
c638d1f672 | ||
|
eac38f74c4 | ||
|
2a6dc1211f | ||
|
63c8d160ae | ||
|
84158d0ebe | ||
|
ac492c3ead | ||
|
81f5aa0700 | ||
|
7cede6d5f4 | ||
|
49a113a7a4 | ||
|
9d6d237c3c | ||
|
136931c4db | ||
|
3c274c0d83 | ||
|
107ddf1de9 | ||
|
2d8c17a9b6 | ||
|
bae848ee25 | ||
|
744c42bfd8 | ||
|
01ad4134c3 | ||
|
ef05145136 | ||
|
7672d1cca5 | ||
|
fa789cc68a | ||
|
5cadb8ce21 | ||
|
d11968fcc5 | ||
|
c7c1170a45 | ||
|
677f2c6f15 | ||
|
3f49462558 | ||
|
0f9fd06919 | ||
|
8543840cfd | ||
|
70f3e62dc7 | ||
|
f284981506 | ||
|
1c923b9f25 | ||
|
c7a7f09c1d | ||
|
25a6745fe8 | ||
|
dcf05f958e | ||
|
5309ddc83b | ||
|
925c445fd3 | ||
|
7427dd3fc0 | ||
|
c6b512962e | ||
|
b2de9ec5a7 | ||
|
6510dcf6f7 | ||
|
a52044a9e6 | ||
|
08aacbf056 | ||
|
4d1014093f | ||
|
39ded59c09 | ||
|
3399f64588 | ||
|
dd49d448b0 | ||
|
f220dcbba8 | ||
|
cc13dcc576 | ||
|
33d0a3cc92 | ||
|
a8a72fc1ff | ||
|
a9fc9bb466 | ||
|
fbec9aec00 | ||
|
7178047402 | ||
|
e674096acc | ||
|
ff3382a51c | ||
|
5e400d22a0 | ||
|
fc0d5922f1 | ||
|
8dab4eebe4 | ||
|
964a4f032d | ||
|
629c1dacc9 | ||
|
8bb018afaf | ||
|
243212b0d0 | ||
|
88f436883b | ||
|
63923a5642 | ||
|
96d691166f | ||
|
60475162a6 | ||
|
b164b6d149 | ||
|
98ab6e8718 | ||
|
af8859bce2 | ||
|
1fadd18d0c | ||
|
6c744465b6 | ||
|
3b74b0394d | ||
|
1b25a7049c | ||
|
cdbdd12460 | ||
|
f2188fe5d1 | ||
|
fbb6f18e1c | ||
|
065fa2dcc2 | ||
|
867851dc30 | ||
|
11dae72d3f | ||
|
775b337c78 | ||
|
4f3ddc6e15 | ||
|
8d34c7afb3 | ||
|
ad7d3ace1a | ||
|
5a13f5c2fa | ||
|
f5c987fcac | ||
|
4ceefd6dd1 | ||
|
b4394cca2d | ||
|
7132df94ac | ||
|
b4dde1ae6a | ||
|
701b5797b2 | ||
|
d706d9c64a | ||
|
ef64ae06f8 | ||
|
7b6e7d0098 | ||
|
f51967280b | ||
|
6585ced558 | ||
|
2d212083d0 | ||
|
8c99839776 | ||
|
a78938f274 | ||
|
6607062e91 | ||
|
01ac3d8b69 | ||
|
4416bf3383 | ||
|
44a3d93af3 | ||
|
1a39bdf2c5 | ||
|
ea7a3015a2 | ||
|
2f8b51d6af | ||
|
8a1f540596 | ||
|
7054f1a54e | ||
|
28eb51dd54 | ||
|
8ef7e222ae | ||
|
ab85db3260 | ||
|
81cb0371f9 | ||
|
638dfb4135 | ||
|
5542e528cd | ||
|
a21a994f55 | ||
|
4249829cf2 | ||
|
8f5ad634ad | ||
|
9df2c0a555 | ||
|
dfacaab57e | ||
|
9eb8f2c99f | ||
|
ac33eee8b8 | ||
|
5779671137 | ||
|
c301291dc3 | ||
|
5a118a61d1 | ||
|
0f612c1443 | ||
|
ea88df6b26 | ||
|
f5d851673d | ||
|
8f63f4143d | ||
|
6ee981c858 | ||
|
7c703f0a8a | ||
|
e7667b7b9a | ||
|
49f06b6640 | ||
|
37423fa344 | ||
|
420cd54993 | ||
|
f6c4b0a78e | ||
|
fcd71642df | ||
|
56f65e4bad | ||
|
a87f5fdb3d | ||
|
2d3974a351 | ||
|
92759eeb0c | ||
|
0c136bbba0 | ||
|
e4ff852136 | ||
|
ad6c8540cc | ||
|
0da3df78ff | ||
|
4a0642ad27 | ||
|
ea55bd8f66 | ||
|
4dba2a9d08 | ||
|
aad98d915a | ||
|
51bb8eb76c | ||
|
6250124de8 | ||
|
e5b515f832 | ||
|
530f5b0912 | ||
|
8314a85893 | ||
|
69abcf1e78 | ||
|
8d238f1433 | ||
|
aa3ea84407 | ||
|
c082da89cf | ||
|
67fc78d026 | ||
|
ded0b489af | ||
|
d189de3b0a | ||
|
cdd20638bc | ||
|
4bd0849d81 | ||
|
1288c5415c | ||
|
f211292711 | ||
|
c1dd400a13 | ||
|
8fbf857a0b | ||
|
4354c22f38 | ||
|
0364ccfead | ||
|
a8acc12dfd | ||
|
78262899d2 | ||
|
41abf00bf9 | ||
|
77fee3a9d8 | ||
|
07c7e68360 | ||
|
069d403587 | ||
|
b26359c176 | ||
|
d85b84e201 | ||
|
bc59ede170 | ||
|
f5137e1a54 | ||
|
2bc46e67b6 | ||
|
82b81c6464 | ||
|
897a2b447e | ||
|
5e8958472c | ||
|
ded1d5414b | ||
|
8bcddbcce2 | ||
|
8da2b97392 | ||
|
cfb4a10d76 | ||
|
08a08129ae | ||
|
7f198321ee | ||
|
937fbe4878 | ||
|
ed132ef8ae | ||
|
ea522a12b3 | ||
|
a44fef7de3 | ||
|
4ec9a6f6cd | ||
|
b38068f9f6 | ||
|
15f83fa364 | ||
|
aaf546879a | ||
|
a196b04926 | ||
|
6925150feb | ||
|
1df6658bcb | ||
|
6101bd125a | ||
|
c15941a643 | ||
|
fdc6288f81 | ||
|
ff52068d92 | ||
|
26d6ef38e7 | ||
|
69ac88cabd | ||
|
6a07d9cacf | ||
|
140e4422b1 | ||
|
bd035a066f | ||
|
7ffc433c2e | ||
|
c1e8537690 | ||
|
578a715cfc | ||
|
4e5a804222 | ||
|
9f12d6b6ec | ||
|
5bb7bfbe81 | ||
|
d15d2667d5 | ||
|
d8e5d35ede | ||
|
55bee4a9de | ||
|
0d382976c2 | ||
|
56ad09ba75 | ||
|
b4d3b77973 | ||
|
0f9283429d | ||
|
d064a6f790 | ||
|
0fba57da65 | ||
|
c19e3f578f | ||
|
cc62b85a4a | ||
|
48c53994e6 | ||
|
69e10f0211 | ||
|
9d9761af50 | ||
|
1034d223f8 | ||
|
03663c4319 | ||
|
8e934ab956 | ||
|
84d0b21d18 | ||
|
0e5aecfed1 | ||
|
86cc274941 | ||
|
0b4263a2c2 | ||
|
647cd40cf6 | ||
|
04c5b3023e | ||
|
b63e17d746 | ||
|
d4d24001f7 | ||
|
27727338b2 | ||
|
9181782c30 | ||
|
098c557023 | ||
|
c0bce66068 | ||
|
e1f5c6249a | ||
|
5258c4186f | ||
|
ba2300f97b | ||
|
0f8323b44b | ||
|
ba91d0292e | ||
|
5ce29ae84d | ||
|
c5cf7f69c9 | ||
|
0abfb0be6c | ||
|
45da4e3135 | ||
|
2900e75511 | ||
|
cafb4f3f36 | ||
|
80bc13db83 | ||
|
d322557712 | ||
|
e2607d3a78 | ||
|
0b37723186 | ||
|
2d4c76f783 | ||
|
c08a3a96fd | ||
|
083b029538 | ||
|
dea6c7dc2a | ||
|
0a0e60caf2 | ||
|
0f0422cedc | ||
|
3d50fdc5c6 | ||
|
c6bb7d54be | ||
|
782948c1a7 | ||
|
6dd64168ed | ||
|
c6382ba0f2 | ||
|
77f75c7fb8 | ||
|
b9bbb4ae93 | ||
|
dd246227d6 | ||
|
f47415e031 | ||
|
6fb2760dc8 | ||
|
81dc0d8b4c | ||
|
63887e272d | ||
|
41d7832db0 | ||
|
e6447d2a08 | ||
|
373a95532a | ||
|
ecbc394365 | ||
|
11f62f4cc0 | ||
|
c6f47e678f | ||
|
9165a7e95e | ||
|
e97b9b4e5a | ||
|
25c9d44315 | ||
|
bee67e0c14 | ||
|
ae0be176a8 | ||
|
5215cd5baf | ||
|
e6de6052a0 | ||
|
11ec5161fa | ||
|
db7e6291c0 | ||
|
6eeb58ece3 | ||
|
665fca9ee7 | ||
|
a1f6485a9b | ||
|
05762bd2e0 | ||
|
c580e27efc | ||
|
d89492456f | ||
|
8dbf868e02 | ||
|
293b97d0c4 | ||
|
4dea9e4a0e | ||
|
8e985ac3fd | ||
|
66494e5324 | ||
|
eabaeb0613 | ||
|
8bca1bb977 | ||
|
b65c0eed6b | ||
|
757f502a3b | ||
|
050d6e9434 | ||
|
128547b081 | ||
|
4ef4b81c9b | ||
|
98edce75fa | ||
|
0fc07b1c6a | ||
|
01225075db | ||
|
66803cafcf | ||
|
d7c6030a47 | ||
|
8b441847e3 | ||
|
ba634ce82b | ||
|
c844d86bee | ||
|
c3ac3301e9 | ||
|
0363584ac9 | ||
|
94c802e108 | ||
|
ff7cb2d7c9 | ||
|
5d586606c7 | ||
|
10416bf46e | ||
|
d992a05ade | ||
|
4b02045f86 | ||
|
c6c4362051 | ||
|
4d1452c599 | ||
|
1694b00511 | ||
|
92da8a154f | ||
|
a818a873e5 | ||
|
8d59bbf47e | ||
|
5de2a54b2c | ||
|
d6b42ed7ed | ||
|
832fbc6e32 | ||
|
23c71536ef | ||
|
56e9828380 | ||
|
83d77fa311 | ||
|
01b31b585e | ||
|
02990e2558 | ||
|
78f088b5a7 | ||
|
ecbcff0f49 | ||
|
d226811a66 | ||
|
95ef765839 | ||
|
e5e1cd1a83 | ||
|
04f8371cdd | ||
|
9688e231d7 | ||
|
edacc551e6 | ||
|
ce781cf8bb | ||
|
e5c7d0b017 | ||
|
f384303dc5 | ||
|
ede0bd1496 | ||
|
61e2c83424 | ||
|
5a349b96b1 | ||
|
18f463edba | ||
|
6127bf1f30 | ||
|
2c2cb23528 | ||
|
a7c8969d03 | ||
|
ed2ff315db | ||
|
3163f34a42 | ||
|
697e594fad | ||
|
9bf79303ae | ||
|
67b5dba791 | ||
|
45f5341f6d | ||
|
8f4ec0cc43 | ||
|
f433fa59d2 | ||
|
e3d2c08322 | ||
|
b16284e2a0 | ||
|
6ded9f50c3 | ||
|
797f526ae2 | ||
|
c9fb11f92f | ||
|
55b67b6950 | ||
|
d795fb571b | ||
|
42b0443599 | ||
|
5430f7f60d | ||
|
f9278458b6 | ||
|
89520115b8 | ||
|
dc5f2905eb | ||
|
b991aec050 | ||
|
51734dfc48 | ||
|
61652efd04 | ||
|
33f30cfec2 | ||
|
66f6a64dd9 | ||
|
457b4e42f7 | ||
|
84f553cb63 | ||
|
74ce342f18 | ||
|
f1d31a6ec7 | ||
|
9e7b042ecb | ||
|
1295e37d4b | ||
|
f20e35982b | ||
|
997419d16f | ||
|
ccbbb4b1c5 | ||
|
dd0b33e3e5 | ||
|
7b82da70ed | ||
|
8ba392687b | ||
|
089013a697 | ||
|
1639b6bf07 | ||
|
f2cc962cd2 | ||
|
cf4af503fb | ||
|
b27b897369 | ||
|
eb20c21fcc | ||
|
358e23c1be | ||
|
0657e74116 | ||
|
c28c16e7c4 | ||
|
1a24843ecb | ||
|
09458c2b0b | ||
|
e4af282e9f | ||
|
d0252b8fc1 | ||
|
caa389625f | ||
|
0c6d851d25 | ||
|
6405cd0304 | ||
|
d6457b3090 | ||
|
b62d7ac97b | ||
|
6c299acf48 | ||
|
cdf6ff1719 | ||
|
3e3be2cbc2 | ||
|
68c89b987f | ||
|
e5fcaeb133 | ||
|
4764aa50ef | ||
|
95f0330953 | ||
|
a257988f59 | ||
|
8d185dfb66 | ||
|
2bb6938949 | ||
|
a56ee36c49 | ||
|
728ff1da33 | ||
|
206168e83f | ||
|
cdd79996c2 | ||
|
7df447930c | ||
|
af98f1fb03 | ||
|
fb89f62d27 | ||
|
56e70968e9 | ||
|
26997800c9 | ||
|
0734975824 | ||
|
e03657dca8 | ||
|
11dd44dfbe | ||
|
7dc182ed1e | ||
|
3fab32d41d | ||
|
321240b135 | ||
|
07251f3c6a | ||
|
84d77d9bf5 | ||
|
dbe820d5fa | ||
|
4693b325e8 | ||
|
33f517445b | ||
|
fc00ff286a | ||
|
b4af23aaab | ||
|
4ca4d2b9df | ||
|
12d3d60f51 | ||
|
495809a614 | ||
|
836042ffd8 | ||
|
24e6daa2bc | ||
|
583f1aba8b | ||
|
67a6f414aa | ||
|
3323359a81 | ||
|
54051768cd | ||
|
71210053fa | ||
|
bb40c3836f | ||
|
f2f526e074 | ||
|
263782f667 | ||
|
bb5c115fa6 | ||
|
24f57f9648 | ||
|
2f499c36db | ||
|
4dca07ff0f | ||
|
eb6a748272 | ||
|
66f4b1b0d2 | ||
|
b08a19eae2 | ||
|
e9e6167123 | ||
|
6f0c65cdb0 | ||
|
53eb26b238 | ||
|
3b4d1b38ea | ||
|
e701a4d51e | ||
|
f484427d10 | ||
|
77ea6b547e | ||
|
48d642a310 | ||
|
f8b1854b92 | ||
|
35318c2eb9 | ||
|
0ee255f50a | ||
|
c4c7fb2174 | ||
|
e504b3917e | ||
|
ea1312a5b4 | ||
|
c5cd360277 | ||
|
6521e4d202 | ||
|
e3e88d90e8 | ||
|
f92a9dce10 | ||
|
6f415f8af4 | ||
|
47b1d61169 | ||
|
cc6a0cff99 | ||
|
31f0af7964 | ||
|
b697a31a8d | ||
|
8f8e4fa3f3 | ||
|
e3aba976f6 | ||
|
0cd7542a69 | ||
|
c2abf77116 | ||
|
5eb3d1bcc1 | ||
|
07e17188df | ||
|
e4b3fd905a | ||
|
82c1aa87f9 | ||
|
5eab38ad03 | ||
|
71fd87e98a | ||
|
144028626e | ||
|
c8e631588b | ||
|
2bc8545883 | ||
|
aea5930c40 | ||
|
aad9a30144 | ||
|
878cbd871d | ||
|
f7686f2727 | ||
|
aa3153b872 | ||
|
2e01a5c128 | ||
|
8727cc9a8e | ||
|
c8c6cf149d | ||
|
3b2661d247 | ||
|
cecf279c32 | ||
|
ecfe6382c1 | ||
|
661a669c81 | ||
|
14ef21e559 | ||
|
a926c6c49e | ||
|
96e8676577 | ||
|
c90cb726f8 | ||
|
b6b54367c3 | ||
|
4904a2b1ec | ||
|
563a2d2695 | ||
|
c18fbd2c31 | ||
|
da3dad181e | ||
|
d55d73152e | ||
|
b1db096575 | ||
|
1bfc89414d | ||
|
69e59545b1 | ||
|
2c93253c95 | ||
|
07fa6d1841 | ||
|
f6bd3286ed | ||
|
1f26a9e62e | ||
|
b4e2cf092a | ||
|
cf6a0a52b0 | ||
|
4f441d024b | ||
|
2e71876081 | ||
|
494127613b | ||
|
b7a8264ae4 | ||
|
f077bff840 | ||
|
f8fb208a3e | ||
|
b17a3a133b | ||
|
d6107c593b | ||
|
410ca0ff94 | ||
|
0e57170097 | ||
|
16e0969ef7 | ||
|
b05523a4e9 | ||
|
852227a9d5 | ||
|
1c4dfadb46 | ||
|
b977956a6c | ||
|
f4a6f63999 | ||
|
ae2c904c3d | ||
|
f07a9df9af | ||
|
6b821be140 | ||
|
041c7a31c2 | ||
|
28dce5b130 | ||
|
699372d388 | ||
|
3b76284883 | ||
|
82ccaaf8e7 | ||
|
997c6967b0 | ||
|
7cfe9048e3 | ||
|
961792c9d6 | ||
|
a1386bb252 | ||
|
e4c1d8d231 | ||
|
d2bfe28966 | ||
|
4ad7ea9c84 | ||
|
9b94ebb0c8 | ||
|
a4c9c2b0f0 | ||
|
c20408163f | ||
|
16bd7aa076 | ||
|
866d3b9fd5 | ||
|
cd81e8e030 | ||
|
fa78edc57e | ||
|
b294633c68 | ||
|
bf0c14a562 | ||
|
fd1820b7ea | ||
|
4ca4041b0d | ||
|
8820767fb3 | ||
|
a0f9628705 | ||
|
2fccd1f153 | ||
|
69da506c92 | ||
|
5ad2592ab3 | ||
|
db0a3087a5 | ||
|
6ceaef4804 | ||
|
5bd2e5dfe6 | ||
|
dc5880d02f | ||
|
7fa4692636 | ||
|
75fb0cfc82 | ||
|
bfb574db11 | ||
|
aa1cd447b3 | ||
|
f335d91a3b | ||
|
5a6455e04c | ||
|
7fc183df71 | ||
|
437ed29f27 | ||
|
c7c2599759 | ||
|
0d1ad06c27 | ||
|
facf52aeb8 | ||
|
6bc74286e7 | ||
|
c6e655743f | ||
|
e9782e6907 | ||
|
a6f799e7fd | ||
|
0c3f8766b0 | ||
|
46f51898ff | ||
|
a1d595fc9c | ||
|
f6b86eec5a | ||
|
ec07fd0e35 | ||
|
7b8c5a8eb4 | ||
|
85c6c14c4c | ||
|
cb4820b6c1 | ||
|
5a0932b7d4 | ||
|
fc14c809cb | ||
|
f80f052277 | ||
|
1eeca0750a | ||
|
bc82574de4 | ||
|
2c5961cccf | ||
|
02fcfdce1e | ||
|
5c551d6d91 | ||
|
92b27c2e6a | ||
|
e1aaef001f | ||
|
a43a62f9b0 | ||
|
6d5ae344cd | ||
|
c126e3588d | ||
|
6720b8e46f | ||
|
d78df93863 | ||
|
f13264b340 | ||
|
09cd17b0de | ||
|
a7dec790dc | ||
|
c27cdc941d | ||
|
98fa877efd | ||
|
705c3469b5 | ||
|
cbac2c74e8 | ||
|
d6017bca19 | ||
|
76e956547e | ||
|
550f196e82 | ||
|
8aeb405466 | ||
|
38da9606f7 | ||
|
419c0aafa6 | ||
|
77d6772708 | ||
|
68c1bedbf2 | ||
|
090642db7a | ||
|
f9c6b5134e | ||
|
1b5420e807 | ||
|
f67ec87704 | ||
|
540522fec0 | ||
|
b3f321f2d7 | ||
|
93a21b465b | ||
|
069703228c | ||
|
39254d922e | ||
|
289d93b79c | ||
|
173a7a7daa | ||
|
f6ce1a5cd8 | ||
|
b59e6fdae2 | ||
|
5db84c85c3 | ||
|
96192ba5bd | ||
|
8a763b533b | ||
|
aef0061ac2 | ||
|
aea8a9c954 | ||
|
b98e2113b5 | ||
|
9d669016d9 | ||
|
ff8485179c | ||
|
cc18c503e0 | ||
|
f6e4824533 | ||
|
566cdfc675 | ||
|
7c138e4008 | ||
|
4d37059d8e | ||
|
1f9bd937b3 | ||
|
6ea50514c1 | ||
|
d92db8a086 | ||
|
019621d078 | ||
|
c0984d1ff2 | ||
|
852ae4cd80 | ||
|
f41acc651f | ||
|
d59279f8ce | ||
|
d09c1d4b88 | ||
|
d3109e5f18 | ||
|
6ba931bebf | ||
|
935343cf16 | ||
|
7623b4bf6a | ||
|
13b97736c8 | ||
|
11f0014c0e | ||
|
ae6e470252 | ||
|
558b37b49b | ||
|
d375273c89 | ||
|
bda715bf6d | ||
|
2f2fd79fc4 | ||
|
3509103132 | ||
|
c5ef1f01a1 | ||
|
620cddb1e0 | ||
|
c59230bce1 | ||
|
8c170ad491 | ||
|
15f98047d2 | ||
|
cdcee3d17b | ||
|
4b384c21ad | ||
|
bb13762548 | ||
|
e7aac7fc13 | ||
|
d1855afc6e | ||
|
0d129ef7c3 | ||
|
466d8f65e3 | ||
|
26847fb6be | ||
|
a00e2e5513 | ||
|
ca573b8615 | ||
|
0eda253317 | ||
|
ed1806b2c0 | ||
|
01a06884a1 | ||
|
619f077252 | ||
|
6c8a08bd8a | ||
|
d0ff1cae3a | ||
|
f25ee54763 | ||
|
37d3eb026a | ||
|
7afef31b2b | ||
|
e96a5734f6 | ||
|
bf5678b580 | ||
|
c3e128a4cd | ||
|
3beb8c9654 | ||
|
51411435d5 | ||
|
0826808d4f | ||
|
18df11da8c | ||
|
ae55e9fca6 | ||
|
bde407db51 | ||
|
426efcc374 | ||
|
663e70851c | ||
|
cabcc6851b | ||
|
998ebe5ca0 | ||
|
5c7a611353 | ||
|
e0dcfb31fb | ||
|
e05132aaa0 | ||
|
c01622057c | ||
|
70d1481b55 | ||
|
c3f4f5a949 | ||
|
066d3c8004 | ||
|
c673216f53 | ||
|
6c1988af76 | ||
|
ea382b3b21 | ||
|
7edf120150 | ||
|
5f8b749c73 | ||
|
7e88204fe1 | ||
|
84cb35232d | ||
|
5d25638e1b | ||
|
7fab007f33 | ||
|
32c76a8cd4 | ||
|
7cddfae1e8 | ||
|
ef09160098 | ||
|
36d7626a37 | ||
|
becff4f473 | ||
|
65cc189414 | ||
|
7d62df623f | ||
|
89ed7e4795 | ||
|
3579551734 | ||
|
015a001b03 | ||
|
c0a0b9bc35 | ||
|
328076cfdf | ||
|
124b765051 | ||
|
e037530468 | ||
|
a107ad0f62 | ||
|
021930d7c2 | ||
|
e974064303 | ||
|
096cd41ce7 | ||
|
d05739a3ff | ||
|
987cc09c7c | ||
|
47ab397011 | ||
|
be8d6ef385 | ||
|
8147fe090f | ||
|
7cd55f3009 | ||
|
66f18fde49 | ||
|
2ef0ff39e5 | ||
|
165f1e4936 | ||
|
f81273f7fb | ||
|
43b3ca6b7f | ||
|
ba08910df1 | ||
|
9d70d8f20d | ||
|
82b0ee8354 | ||
|
59aa48bb7d | ||
|
e5ec3ba409 | ||
|
85fd05ab97 | ||
|
fe405f08a0 | ||
|
ec54ce1f1a | ||
|
5ee17c5418 | ||
|
717f35a9f2 | ||
|
82dd766f25 | ||
|
2cc6d4c8ed | ||
|
33a3408fbb | ||
|
ae80fe997d | ||
|
5ef3990735 | ||
|
cbcf0cd65e | ||
|
d8d829b89d | ||
|
5386c9e6da | ||
|
5654ce1d2c | ||
|
0aca5901e3 | ||
|
8c2357809e | ||
|
c32e733151 | ||
|
9ce09870e7 | ||
|
ff379e1b48 | ||
|
d452feedf2 | ||
|
12e4043bd6 | ||
|
992d5451d1 | ||
|
89c5d90003 | ||
|
6bb00aa484 | ||
|
3701f105fa | ||
|
b670700ddf | ||
|
bbd30066e1 | ||
|
3a872dac7b | ||
|
c5d68ef6e7 | ||
|
a086f4a63b | ||
|
a24fbd6061 | ||
|
9bf473da4c | ||
|
bf65d7ee88 | ||
|
16acacf24c | ||
|
d8d4abdff9 | ||
|
538ac013d6 | ||
|
8cb4b429a2 | ||
|
ec87305f90 | ||
|
129404f6e4 | ||
|
3e8b7e1055 | ||
|
62031335bd | ||
|
72a9386f67 | ||
|
0426115b67 | ||
|
b822be1a20 | ||
|
0b633b1494 | ||
|
451521ccbc | ||
|
c55cf3f795 | ||
|
0547ffbf6d | ||
|
4d8651c2fb | ||
|
b21fe5a8a6 | ||
|
a00b71b009 | ||
|
b2d76fdd42 | ||
|
3c16e6fb97 | ||
|
a7e722941c | ||
|
4bdc41cf17 | ||
|
ec25e904c7 | ||
|
01c2fb0d22 | ||
|
3f378450df | ||
|
4a86424224 | ||
|
73ccde8f6d | ||
|
7bda8c6481 | ||
|
6937fc8338 | ||
|
259e1e0462 | ||
|
2846c19da9 | ||
|
ceb52713b0 | ||
|
560f9bb063 | ||
|
39ba0f8dfc | ||
|
5fb3f5723a | ||
|
05da2d24b0 | ||
|
8bd2028f9a | ||
|
6acf72901a | ||
|
4dd7b86556 | ||
|
47b9521513 | ||
|
09f01d4efb | ||
|
c4e76d2fba | ||
|
316e6df435 | ||
|
7a548f3ea9 | ||
|
30697b94fd | ||
|
f70f493d1b | ||
|
0e3e62fc2b | ||
|
e254c71e9e | ||
|
57162cb62d | ||
|
e03b0d0672 | ||
|
0adc35fccd | ||
|
3e3f5bb21c | ||
|
01c0d3c0d5 | ||
|
fb91d6cbd0 | ||
|
19f7c63ea9 | ||
|
44fc90eb0e | ||
|
cda98df162 | ||
|
81bbc1452c | ||
|
e59747bd82 | ||
|
f6a196c7eb | ||
|
862614e254 | ||
|
4bc2c74851 | ||
|
7dbb8a24d1 | ||
|
cc6efda777 | ||
|
27874a382c | ||
|
00743d144b | ||
|
9d9d15b42a | ||
|
78c373f2a5 | ||
|
916825b84f | ||
|
d103840cfb | ||
|
1cd902f1f4 | ||
|
e986f4ce96 | ||
|
804e8c6566 | ||
|
592bf33a29 | ||
|
1fd8d08970 | ||
|
aa65bb4020 | ||
|
11ce7a2de7 | ||
|
5890a18409 | ||
|
a654289439 | ||
|
4cb94f20b0 | ||
|
1ef86f1201 | ||
|
5eb973eb62 | ||
|
5c25f6c67b | ||
|
127e2c5315 | ||
|
54d81d06fc | ||
|
8a485e4bb8 | ||
|
2c284027b2 | ||
|
22f73b6d2d | ||
|
1c75bf3c21 | ||
|
c14c4719f9 | ||
|
4e17aba4b5 | ||
|
2280af5ff8 | ||
|
cf3d4508b2 | ||
|
d9e7f6fe49 | ||
|
ca33daafc6 | ||
|
a639248bd0 | ||
|
7bee249891 | ||
|
a121165e35 | ||
|
d2842bb6ec | ||
|
735a7496cb | ||
|
7de1c71dd2 | ||
|
5d5be45bd1 | ||
|
47d988387e | ||
|
a1d5723914 | ||
|
a8a78ef194 | ||
|
beb0f8d483 | ||
|
dd3ba82d31 | ||
|
8aff08c817 | ||
|
b92e049522 | ||
|
c8c978d328 | ||
|
ae3bc559f9 | ||
|
d992163da6 | ||
|
85d805ed32 | ||
|
6ae2b6648e |
@@ -13,10 +13,14 @@ pr:
|
||||
- master
|
||||
- stable/*
|
||||
|
||||
variables:
|
||||
- template: templates/defaults.yml
|
||||
|
||||
jobs:
|
||||
- template: templates/pr-gate-build-job.yml
|
||||
parameters:
|
||||
tool_chain_tag: 'GCC5'
|
||||
vm_image: 'ubuntu-latest'
|
||||
vm_image: 'ubuntu-22.04'
|
||||
container: ${{ variables.default_linux_image }}
|
||||
arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64"
|
||||
|
||||
usePythonVersion: '' # use Python from the container image
|
||||
|
@@ -27,7 +27,7 @@ steps:
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '>=3.10.6'
|
||||
versionSpec: '3.12'
|
||||
architecture: 'x64'
|
||||
|
||||
- script: |
|
||||
|
@@ -12,9 +12,18 @@ pr:
|
||||
- master
|
||||
- stable/*
|
||||
|
||||
variables:
|
||||
- template: templates/defaults.yml
|
||||
|
||||
jobs:
|
||||
- template: templates/pr-gate-build-job.yml
|
||||
parameters:
|
||||
tool_chain_tag: 'VS2019'
|
||||
vm_image: 'windows-2019'
|
||||
arch_list: "IA32,X64"
|
||||
usePythonVersion: ${{ variables.default_python_version }}
|
||||
extra_install_step:
|
||||
- powershell: choco install opencppcoverage; Write-Host "##vso[task.prependpath]C:\Program Files\OpenCppCoverage"
|
||||
displayName: Install Code Coverage Tool
|
||||
condition: and(gt(variables.pkg_count, 0), succeeded())
|
||||
|
||||
|
@@ -10,15 +10,6 @@ parameters:
|
||||
tool_chain_tag: ''
|
||||
|
||||
steps:
|
||||
- ${{ if contains(parameters.tool_chain_tag, 'GCC') }}:
|
||||
- bash: sudo apt-get update
|
||||
displayName: Update apt
|
||||
condition: and(gt(variables.pkg_count, 0), succeeded())
|
||||
|
||||
- bash: sudo apt-get install gcc g++ make uuid-dev
|
||||
displayName: Install required tools
|
||||
condition: and(gt(variables.pkg_count, 0), succeeded())
|
||||
|
||||
- task: CmdLine@1
|
||||
displayName: Build Base Tools from source
|
||||
inputs:
|
||||
|
12
.azurepipelines/templates/defaults.yml
Normal file
12
.azurepipelines/templates/defaults.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
## @file
|
||||
# File templates/default.yml
|
||||
#
|
||||
# template file containing common default values
|
||||
#
|
||||
# Copyright (c) Red Hat, Inc.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
variables:
|
||||
default_python_version: "3.12"
|
||||
default_linux_image: "ghcr.io/tianocore/containers/fedora-37-test:a0dd931"
|
@@ -34,16 +34,26 @@ parameters:
|
||||
- name: extra_install_step
|
||||
type: stepList
|
||||
default: []
|
||||
- name: usePythonVersion
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
echo "##vso[task.prependpath]${HOME}/.local/bin"
|
||||
echo "new PATH=${PATH}"
|
||||
displayName: Set PATH
|
||||
condition: eq('${{ parameters.tool_chain_tag }}', 'GCC5')
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: ">=3.10.6"
|
||||
versionSpec: ${{ parameters.usePythonVersion }}
|
||||
architecture: "x64"
|
||||
condition: ne('${{ parameters.usePythonVersion }}', '')
|
||||
|
||||
- script: pip install -r pip-requirements.txt --upgrade
|
||||
displayName: 'Install/Upgrade pip modules'
|
||||
@@ -106,7 +116,7 @@ steps:
|
||||
filename: stuart_build
|
||||
arguments: -c ${{ parameters.build_file }} TOOL_CHAIN_TAG=${{ parameters.tool_chain_tag}} TARGET=${{ parameters.build_target}} -a ${{ parameters.build_arch}} ${{ parameters.build_flags}} ${{ parameters.run_flags }} --FlashOnly
|
||||
condition: and(and(gt(variables.pkg_count, 0), succeeded()), eq(variables['Run'], true))
|
||||
timeoutInMinutes: 1
|
||||
timeoutInMinutes: 2
|
||||
|
||||
# Copy the build logs to the artifact staging directory
|
||||
- task: CopyFiles@2
|
||||
|
@@ -12,6 +12,9 @@ parameters:
|
||||
tool_chain_tag: ''
|
||||
vm_image: ''
|
||||
arch_list: ''
|
||||
extra_install_step: []
|
||||
usePythonVersion: ''
|
||||
container: ''
|
||||
|
||||
# Build step
|
||||
jobs:
|
||||
@@ -46,9 +49,12 @@ jobs:
|
||||
TARGET_FMP_FAT_TEST:
|
||||
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||
TARGET_CRYPTO:
|
||||
TARGET_CRYPTO_DEBUG:
|
||||
Build.Pkgs: 'CryptoPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||
Build.Targets: 'DEBUG,NOOPT'
|
||||
TARGET_CRYPTO_RELEASE:
|
||||
Build.Pkgs: 'CryptoPkg'
|
||||
Build.Targets: 'RELEASE,NO-TARGET'
|
||||
TARGET_FSP:
|
||||
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
|
||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||
@@ -70,6 +76,9 @@ jobs:
|
||||
pool:
|
||||
vmImage: ${{ parameters.vm_image }}
|
||||
|
||||
${{ if not(eq(parameters.container, '')) }}:
|
||||
container: ${{ parameters.container }}
|
||||
|
||||
steps:
|
||||
- template: pr-gate-steps.yml
|
||||
parameters:
|
||||
@@ -77,3 +86,47 @@ jobs:
|
||||
build_pkgs: $(Build.Pkgs)
|
||||
build_targets: $(Build.Targets)
|
||||
build_archs: ${{ parameters.arch_list }}
|
||||
usePythonVersion: ${{ parameters.usePythonVersion }}
|
||||
extra_install_step: ${{ parameters.extra_install_step }}
|
||||
|
||||
- job: Build_${{ parameters.tool_chain_tag }}_TARGET_CODE_COVERAGE
|
||||
dependsOn: Build_${{ parameters.tool_chain_tag }}
|
||||
workspace:
|
||||
clean: all
|
||||
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
submodules: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Build Artifacts'
|
||||
inputs:
|
||||
buildType: 'current'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- powershell: Write-Host "##vso[task.setvariable variable=is_code_coverage]0"
|
||||
displayName: Give default value for whether CodeCoverage or not
|
||||
|
||||
- powershell: if (Test-Path -Path $(Build.ArtifactStagingDirectory)/**/coverage.xml) {Write-Host "##vso[task.setvariable variable=is_code_coverage]1"}
|
||||
displayName: Check coverage.xml exist or not
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: Create code coverage report
|
||||
inputs:
|
||||
script: |
|
||||
dotnet tool install -g dotnet-reportgenerator-globaltool
|
||||
reportgenerator -reports:$(Build.ArtifactStagingDirectory)/**/coverage.xml -targetdir:$(Build.ArtifactStagingDirectory)/Coverage -reporttypes:Cobertura -filefilters:-*Build*;-*UnitTest*;-*Mock*;-*usr*
|
||||
condition: eq(variables.is_code_coverage, 1)
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
displayName: 'Publish code coverage'
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
|
||||
condition: eq(variables.is_code_coverage, 1)
|
||||
|
||||
|
@@ -12,16 +12,25 @@ parameters:
|
||||
build_pkgs: ''
|
||||
build_targets: ''
|
||||
build_archs: ''
|
||||
usePythonVersion: ''
|
||||
extra_install_step: []
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
echo "##vso[task.prependpath]${HOME}/.local/bin"
|
||||
echo "new PATH=${PATH}"
|
||||
displayName: Set PATH
|
||||
condition: eq('${{ parameters.tool_chain_tag }}', 'GCC5')
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '>=3.10.6'
|
||||
architecture: 'x64'
|
||||
versionSpec: ${{ parameters.usePythonVersion }}
|
||||
architecture: "x64"
|
||||
condition: ne('${{ parameters.usePythonVersion }}', '')
|
||||
|
||||
- script: pip install -r pip-requirements.txt --upgrade
|
||||
displayName: 'Install/Upgrade pip modules'
|
||||
@@ -37,6 +46,8 @@ steps:
|
||||
displayName: fetch target branch
|
||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
||||
|
||||
- ${{ parameters.extra_install_step }}
|
||||
|
||||
# trim the package list if this is a PR
|
||||
- task: CmdLine@1
|
||||
displayName: Check if ${{ parameters.build_pkgs }} need testing
|
||||
@@ -125,6 +136,7 @@ steps:
|
||||
TestSuites.xml
|
||||
**/BUILD_TOOLS_REPORT.html
|
||||
**/OVERRIDELOG.TXT
|
||||
coverage.xml
|
||||
flattenFolders: true
|
||||
condition: succeededOrFailed()
|
||||
|
||||
|
16
.devcontainer/devcontainer.json
Normal file
16
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"image": "ghcr.io/tianocore/containers/fedora-35-dev:latest",
|
||||
"postCreateCommand": "git config --global --add safe.directory * && pip install --upgrade -r pip-requirements.txt",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"DavidAnson.vscode-markdownlint",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"ms-vscode-remote.remote-containers",
|
||||
"ms-vscode.cpptools",
|
||||
"walonli.edk2-vscode",
|
||||
"zachflower.uncrustify"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
31
.editorconfig
Normal file
31
.editorconfig
Normal file
@@ -0,0 +1,31 @@
|
||||
# EditorConfig file: https://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = latin1
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.py]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
|
||||
[.gitattributes]
|
||||
end_of_line = lf
|
||||
|
||||
[.mailmap]
|
||||
charset = utf-8
|
||||
|
||||
[Maintainers.txt]
|
||||
charset = utf-8
|
||||
|
||||
[Makefile,GNUmakefile]
|
||||
indent_style = tab
|
56
.git-blame-ignore-revs
Normal file
56
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,56 @@
|
||||
# PrmPkg: Apply uncrustify changes
|
||||
a298a84478053872ed9da660a75f182ce81b8ddc
|
||||
# UnitTestFrameworkPkg: Apply uncrustify changes
|
||||
7c0ad2c33810ead45b7919f8f8d0e282dae52e71
|
||||
# UefiPayloadPkg: Apply uncrustify changes
|
||||
e5efcf8be8a1bf59aa98875787475e3144ee4cef
|
||||
# UefiCpuPkg: Apply uncrustify changes
|
||||
053e878bfb5c9d5eca779789b62891add30b14ba
|
||||
# StandaloneMmPkg: Apply uncrustify changes
|
||||
91415a36ae7aaeabb2bbab3762f39544f9aed683
|
||||
# SourceLevelDebugPkg: Apply uncrustify changes
|
||||
c1e126b1196de75e0a4cda21e4551ea9bb05e059
|
||||
# SignedCapsulePkg: Apply uncrustify changes
|
||||
b87864896714cf3062a7bc6d577d8fbd62d105e5
|
||||
# ShellPkg: Apply uncrustify changes
|
||||
47d20b54f9a65b08aa602a1866c1b59a69088dfc
|
||||
# SecurityPkg: Apply uncrustify changes
|
||||
c411b485b63a671a1e276700cff025c73997233c
|
||||
# RedfishPkg: Apply uncrustify changes
|
||||
39de741e2dcb8f11e9b4438e37224797643d8451
|
||||
# PcAtChipsetPkg: Apply uncrustify changes
|
||||
5220bd211df890f2672c23c050082862cd1e82d6
|
||||
# OvmfPkg: Apply uncrustify changes
|
||||
ac0a286f4d747a4c6c603a7b225917293cbe1e9f
|
||||
# NetworkPkg: Apply uncrustify changes
|
||||
d1050b9dff1cace252aff86630bfdb59dff5f507
|
||||
# MdePkg: Apply uncrustify changes
|
||||
2f88bd3a1296c522317f1c21377876de63de5be7
|
||||
# MdeModulePkg: Apply uncrustify changes
|
||||
1436aea4d5707e672672a11bda72be2c63c936c3
|
||||
# IntelFsp2WrapperPkg: Apply uncrustify changes
|
||||
7c7184e201a90a1d2376e615e55e3f4074731468
|
||||
# IntelFsp2Pkg: Apply uncrustify changes
|
||||
111f2228ddf487b0ac3491e416bb3dcdcfa4f979
|
||||
# FmpDevicePkg: Apply uncrustify changes
|
||||
45ce0a67bb4ee80f27da93777c623f51f344f23b
|
||||
# FatPkg: Apply uncrustify changes
|
||||
bcdcc4160d7460c46c08c9395aae81be44ef23a9
|
||||
# EmulatorPkg: Apply uncrustify changes
|
||||
a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97
|
||||
# EmbeddedPkg: Apply uncrustify changes
|
||||
e7108d0e9655b1795c94ac372b0449f28dd907df
|
||||
# DynamicTablesPkg: Apply uncrustify changes
|
||||
731c67e1d77b7741a91762d17659fc9fbcb9e305
|
||||
# CryptoPkg: Apply uncrustify changes
|
||||
7c342378317039e632d9a1a5d4cf7c21aec8cb7a
|
||||
# ArmVirtPkg: Apply uncrustify changes
|
||||
2b16a4fb91b9b31c0d152588f5ac51080c6c0763
|
||||
# ArmPlatformPkg: Apply uncrustify changes
|
||||
40b0b23ed34f48c26d711d3e4613a4bb35eeadff
|
||||
# ArmPkg: Apply uncrustify changes
|
||||
429309e0c6b74792d679681a8edd0d5ae0ff850c
|
||||
# EmulatorPkg: Format with Uncrustify 73.0.8
|
||||
972e3b0b9d67ef2847c9c1c89e606e6074a7ddda
|
||||
# OvmfPkg: Format with Uncrustify 73.0.8
|
||||
0e9ce9146a6dc50a35488e3a4a7a2a4bbaf1eb1c
|
29
.github/codeql/codeql-config.yml
vendored
29
.github/codeql/codeql-config.yml
vendored
@@ -1,29 +0,0 @@
|
||||
## @file
|
||||
# CodeQL configuration file for edk2.
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
name: "CodeQL config"
|
||||
|
||||
# The following line disables the default queries. This is used because we want to enable on query at a time by
|
||||
# explicitly specifying each query in a "queries" array as they are enabled.
|
||||
#
|
||||
# See the following for more information about adding custom queries:
|
||||
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-a-custom-configuration-file
|
||||
|
||||
#disable-default-queries: true
|
||||
|
||||
queries:
|
||||
- name: EDK2 CodeQL Query List
|
||||
uses: ./.github/codeql/edk2.qls
|
||||
|
||||
# We must specify a query for CodeQL to run. Until the first query is enabled, enable the security query suite but
|
||||
# exclude all problem levels from impacting the results. After the first query is enabled, this filter can be relaxed
|
||||
# to find the level of problems desired from the query.
|
||||
query-filters:
|
||||
- exclude:
|
||||
problem.severity:
|
||||
- warning
|
||||
- recommendation
|
14
.github/codeql/edk2.qls
vendored
14
.github/codeql/edk2.qls
vendored
@@ -1,14 +0,0 @@
|
||||
---
|
||||
- description: EDK2 (C++) queries
|
||||
|
||||
# Bring in all queries from the official cpp-queries suite so individual queries can be explicitly enabled.
|
||||
|
||||
- queries: '.'
|
||||
from: codeql/cpp-queries
|
||||
|
||||
# Enable individual queries below.
|
||||
|
||||
- include:
|
||||
id: cpp/infinite-loop-with-unsatisfiable-exit-condition
|
||||
- include:
|
||||
id: cpp/overflow-buffer
|
96
.github/workflows/codeql-analysis.yml
vendored
96
.github/workflows/codeql-analysis.yml
vendored
@@ -1,96 +0,0 @@
|
||||
# @file
|
||||
# GitHub Workflow for CodeQL Analysis
|
||||
#
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '**/*.bat'
|
||||
- '**/*.md'
|
||||
- '**/*.py'
|
||||
- '**/*.rst'
|
||||
- '**/*.sh'
|
||||
- '**/*.txt'
|
||||
|
||||
schedule:
|
||||
# https://crontab.guru/#20_23_*_*_4
|
||||
- cron: '20 23 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: windows-2019
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
package: [
|
||||
"ArmPkg",
|
||||
"CryptoPkg",
|
||||
"DynamicTablesPkg",
|
||||
"FatPkg",
|
||||
"FmpDevicePkg",
|
||||
"IntelFsp2Pkg",
|
||||
"IntelFsp2WrapperPkg",
|
||||
"MdeModulePkg",
|
||||
"MdePkg",
|
||||
"PcAtChipsetPkg",
|
||||
"PrmPkg",
|
||||
"SecurityPkg",
|
||||
"ShellPkg",
|
||||
"SourceLevelDebugPkg",
|
||||
"StandaloneMmPkg",
|
||||
"UefiCpuPkg",
|
||||
"UnitTestFrameworkPkg"]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10.6'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: 'cpp'
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
# Note: Add new queries to codeql-config.yml file as they are enabled.
|
||||
|
||||
- name: Install/Upgrade pip Modules
|
||||
run: pip install -r pip-requirements.txt --upgrade
|
||||
|
||||
- name: Setup
|
||||
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
|
||||
|
||||
- name: Update
|
||||
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
|
||||
|
||||
- name: Build Tools From Source
|
||||
run: python BaseTools/Edk2ToolsBuild.py -t VS2019
|
||||
|
||||
- name: CI Build
|
||||
run: stuart_ci_build -c .pytool/CISettings.py -p ${{ matrix.package }} -t DEBUG -a IA32,X64 TOOL_CHAIN_TAG=VS2019
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -23,3 +23,18 @@
|
||||
[submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
|
||||
path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
|
||||
url = https://github.com/google/googletest.git
|
||||
[submodule "UnitTestFrameworkPkg/Library/SubhookLib/subhook"]
|
||||
path = UnitTestFrameworkPkg/Library/SubhookLib/subhook
|
||||
url = https://github.com/Zeex/subhook.git
|
||||
[submodule "MdePkg/Library/BaseFdtLib/libfdt"]
|
||||
path = MdePkg/Library/BaseFdtLib/libfdt
|
||||
url = https://github.com/devicetree-org/pylibfdt.git
|
||||
[submodule "MdePkg/Library/MipiSysTLib/mipisyst"]
|
||||
path = MdePkg/Library/MipiSysTLib/mipisyst
|
||||
url = https://github.com/MIPI-Alliance/public-mipi-sys-t.git
|
||||
[submodule "CryptoPkg/Library/MbedTlsLib/mbedtls"]
|
||||
path = CryptoPkg/Library/MbedTlsLib/mbedtls
|
||||
url = https://github.com/ARMmbed/mbedtls
|
||||
[submodule "SecurityPkg/DeviceSecurity/SpdmLib/libspdm"]
|
||||
path = SecurityPkg/DeviceSecurity/SpdmLib/libspdm
|
||||
url = https://github.com/DMTF/libspdm.git
|
||||
|
@@ -38,7 +38,6 @@ pull_request_rules:
|
||||
actions:
|
||||
queue:
|
||||
method: rebase
|
||||
rebase_fallback: none
|
||||
name: default
|
||||
|
||||
- name: Post a comment on a PR that can not be merged due to a merge conflict
|
||||
|
@@ -7,12 +7,27 @@
|
||||
##
|
||||
import os
|
||||
import logging
|
||||
import sys
|
||||
from edk2toolext.environment import shell_environment
|
||||
from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager
|
||||
from edk2toolext.invocables.edk2_setup import SetupSettingsManager, RequiredSubmodule
|
||||
from edk2toolext.invocables.edk2_update import UpdateSettingsManager
|
||||
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
|
||||
from edk2toollib.utility_functions import GetHostInfo
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
try:
|
||||
# Temporarily needed until edk2 can update to the latest edk2-pytools
|
||||
# that has the CodeQL helpers.
|
||||
#
|
||||
# May not be present until submodules are populated.
|
||||
#
|
||||
root = Path(__file__).parent.parent.resolve()
|
||||
sys.path.append(str(root/'BaseTools'/'Plugin'/'CodeQL'/'integration'))
|
||||
import stuart_codeql as codeql_helpers
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManager, PrEvalSettingsManager):
|
||||
@@ -34,6 +49,11 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
group.add_argument("-force_piptools", "--fpt", dest="force_piptools", action="store_true", default=False, help="Force the system to use pip tools")
|
||||
group.add_argument("-no_piptools", "--npt", dest="no_piptools", action="store_true", default=False, help="Force the system to not use pip tools")
|
||||
|
||||
try:
|
||||
codeql_helpers.add_command_line_option(parserObj)
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
def RetrieveCommandLineOptions(self, args):
|
||||
super().RetrieveCommandLineOptions(args)
|
||||
if args.force_piptools:
|
||||
@@ -41,6 +61,11 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
if args.no_piptools:
|
||||
self.UseBuiltInBaseTools = False
|
||||
|
||||
try:
|
||||
self.codeql = codeql_helpers.is_codeql_enabled_on_command_line(args)
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
# ####################################################################################### #
|
||||
# Default Support for this Ci Build #
|
||||
# ####################################################################################### #
|
||||
@@ -169,15 +194,17 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
else:
|
||||
logging.warning("Falling back to using in-tree BaseTools")
|
||||
|
||||
if is_linux and self.ActualToolChainTag.upper().startswith("GCC"):
|
||||
if "AARCH64" in self.ActualArchitectures:
|
||||
scopes += ("gcc_aarch64_linux",)
|
||||
if "ARM" in self.ActualArchitectures:
|
||||
scopes += ("gcc_arm_linux",)
|
||||
if "RISCV64" in self.ActualArchitectures:
|
||||
scopes += ("gcc_riscv64_unknown",)
|
||||
if "LOONGARCH64" in self.ActualArchitectures:
|
||||
scopes += ("gcc_loongarch64_unknown_linux",)
|
||||
try:
|
||||
scopes += codeql_helpers.get_scopes(self.codeql)
|
||||
|
||||
if self.codeql:
|
||||
shell_environment.GetBuildVars().SetValue(
|
||||
"STUART_CODEQL_AUDIT_ONLY",
|
||||
"TRUE",
|
||||
"Set in CISettings.py")
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
self.ActualScopes = scopes
|
||||
return self.ActualScopes
|
||||
|
||||
@@ -202,6 +229,16 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
||||
"BaseTools/Source/C/BrotliCompress/brotli", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"RedfishPkg/Library/JsonLib/jansson", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"UnitTestFrameworkPkg/Library/SubhookLib/subhook", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"MdePkg/Library/BaseFdtLib/libfdt", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"MdePkg/Library/MipiSysTLib/mipisyst", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"CryptoPkg/Library/MbedTlsLib/mbedtls", False))
|
||||
rs.append(RequiredSubmodule(
|
||||
"SecurityPkg/DeviceSecurity/SpdmLib/libspdm", False))
|
||||
return rs
|
||||
|
||||
def GetName(self):
|
||||
|
@@ -93,9 +93,7 @@ class CharEncodingCheck(ICiBuildPlugin):
|
||||
files = [Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(x) for x in files]
|
||||
for a in files:
|
||||
files_tested += 1
|
||||
if(self.TestEncodingOk(a, enc)):
|
||||
logging.debug("File {0} Passed Encoding Check {1}".format(a, enc))
|
||||
else:
|
||||
if not self.TestEncodingOk(a, enc):
|
||||
tc.LogStdError("Encoding Failure in {0}. Not {1}".format(a, enc))
|
||||
overall_status += 1
|
||||
|
||||
|
@@ -69,6 +69,13 @@ class EccCheck(ICiBuildPlugin):
|
||||
env.set_shell_var('PACKAGES_PATH', os.pathsep.join(Edk2pathObj.PackagePathList))
|
||||
self.ECC_PASS = True
|
||||
|
||||
abs_pkg_path = Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(packagename)
|
||||
|
||||
if abs_pkg_path is None:
|
||||
tc.SetSkipped()
|
||||
tc.LogStdError("No Package folder {0}".format(abs_pkg_path))
|
||||
return 0
|
||||
|
||||
# Create temp directory
|
||||
temp_path = os.path.join(workspace_path, 'Build', '.pytool', 'Plugin', 'EccCheck')
|
||||
try:
|
||||
@@ -77,7 +84,7 @@ class EccCheck(ICiBuildPlugin):
|
||||
shutil.rmtree(temp_path)
|
||||
# Copy package being scanned to temp_path
|
||||
shutil.copytree (
|
||||
os.path.join(workspace_path, packagename),
|
||||
abs_pkg_path,
|
||||
os.path.join(temp_path, packagename),
|
||||
symlinks=True
|
||||
)
|
||||
|
@@ -10,7 +10,7 @@ import logging
|
||||
import os
|
||||
from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin
|
||||
from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser
|
||||
from edk2toollib.uefi.edk2.parsers.inf_parser import InfParser
|
||||
from edk2toollib.uefi.edk2.parsers.inf_parser import InfParser, AllPhases
|
||||
from edk2toolext.environment.var_dict import VarDict
|
||||
|
||||
|
||||
@@ -116,8 +116,9 @@ class HostUnitTestDscCompleteCheck(ICiBuildPlugin):
|
||||
# should compile test a library that is declared type HOST_APPLICATION
|
||||
pass
|
||||
|
||||
elif len(infp.SupportedPhases) > 0 and \
|
||||
"HOST_APPLICATION" in infp.SupportedPhases:
|
||||
elif (len(infp.SupportedPhases) > 0 and
|
||||
"HOST_APPLICATION" in infp.SupportedPhases and
|
||||
infp.SupportedPhases != AllPhases):
|
||||
# should compile test a library that supports HOST_APPLICATION but
|
||||
# require it to be an explicit opt-in
|
||||
pass
|
||||
|
@@ -12,6 +12,7 @@ import logging
|
||||
import os
|
||||
import pathlib
|
||||
import shutil
|
||||
import stat
|
||||
import timeit
|
||||
from edk2toolext.environment import version_aggregator
|
||||
from edk2toolext.environment.plugin_manager import PluginManager
|
||||
@@ -110,7 +111,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
# A package can add any additional paths with "AdditionalIncludePaths"
|
||||
# A package can remove any of these paths with "IgnoreStandardPaths"
|
||||
#
|
||||
STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h")
|
||||
STANDARD_PLUGIN_DEFINED_PATHS = ("*.c", "*.h", "*.cpp")
|
||||
|
||||
#
|
||||
# The Uncrustify application path should set in this environment variable
|
||||
@@ -299,7 +300,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
If git is not found, an empty list will be returned.
|
||||
"""
|
||||
if not shutil.which("git"):
|
||||
logging.warn(
|
||||
logging.warning(
|
||||
"Git is not found on this system. Git submodule paths will not be considered.")
|
||||
return []
|
||||
|
||||
@@ -325,7 +326,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
If git is not found, an empty list will be returned.
|
||||
"""
|
||||
if not shutil.which("git"):
|
||||
logging.warn(
|
||||
logging.warning(
|
||||
"Git is not found on this system. Git submodule paths will not be considered.")
|
||||
return []
|
||||
|
||||
@@ -372,9 +373,9 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
file_template_path = pathlib.Path(os.path.join(self._plugin_path, file_template_name))
|
||||
self._file_template_contents = file_template_path.read_text()
|
||||
except KeyError:
|
||||
logging.warn("A file header template is not specified in the config file.")
|
||||
logging.warning("A file header template is not specified in the config file.")
|
||||
except FileNotFoundError:
|
||||
logging.warn("The specified file header template file was not found.")
|
||||
logging.warning("The specified file header template file was not found.")
|
||||
try:
|
||||
func_template_name = parser["dummy_section"]["cmt_insert_func_header"]
|
||||
|
||||
@@ -384,9 +385,9 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
func_template_path = pathlib.Path(os.path.join(self._plugin_path, func_template_name))
|
||||
self._func_template_contents = func_template_path.read_text()
|
||||
except KeyError:
|
||||
logging.warn("A function header template is not specified in the config file.")
|
||||
logging.warning("A function header template is not specified in the config file.")
|
||||
except FileNotFoundError:
|
||||
logging.warn("The specified function header template file was not found.")
|
||||
logging.warning("The specified function header template file was not found.")
|
||||
|
||||
def _initialize_app_info(self) -> None:
|
||||
"""
|
||||
@@ -628,7 +629,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
||||
"""
|
||||
Private function to attempt to change permissions on file/folder being deleted.
|
||||
"""
|
||||
os.chmod(path, os.stat.S_IWRITE)
|
||||
os.chmod(path, stat.S_IWRITE)
|
||||
func(path)
|
||||
|
||||
for _ in range(3): # retry up to 3 times
|
||||
|
@@ -215,7 +215,7 @@ indent_braces = false
|
||||
indent_braces_no_class = false
|
||||
indent_braces_no_func = true
|
||||
indent_braces_no_struct = false
|
||||
indent_class = false
|
||||
indent_class = true
|
||||
indent_class_colon = false
|
||||
indent_cmt_with_tabs = false # Whether to indent comments that are not at a brace level with tabs on
|
||||
# a tabstop. Requires indent_with_tabs=2. If false, will use spaces.
|
||||
@@ -223,7 +223,7 @@ indent_col1_comment = true
|
||||
indent_col1_multi_string_literal= true
|
||||
indent_comma_paren = true
|
||||
indent_else_if = true
|
||||
indent_extern = false
|
||||
indent_extern = true
|
||||
indent_first_bool_expr = true
|
||||
|
||||
indent_func_def_param_paren_pos_threshold = 0
|
||||
|
@@ -10,7 +10,7 @@
|
||||
"type": "nuget",
|
||||
"name": "mu-uncrustify-release",
|
||||
"source": "https://pkgs.dev.azure.com/projectmu/Uncrustify/_packaging/mu_uncrustify/nuget/v3/index.json",
|
||||
"version": "73.0.3",
|
||||
"version": "73.0.8",
|
||||
"flags": ["set_shell_var", "host_specific"],
|
||||
"var_name": "UNCRUSTIFY_CI_PATH"
|
||||
}
|
||||
|
@@ -1,5 +1,12 @@
|
||||
# Edk2 Continuous Integration
|
||||
|
||||
This file focuses on information for those working with the `.pytools` directory
|
||||
directly or interested in lower-level details about how CI works.
|
||||
|
||||
If you just want to get started building code, visit
|
||||
[Build Instructions](https://github.com/tianocore/tianocore.github.io/wiki/Build-Instruction)
|
||||
on the TianoCore wiki.
|
||||
|
||||
## Basic Status
|
||||
|
||||
| Package | Windows VS2019 (IA32/X64)| Ubuntu GCC (IA32/X64/ARM/AARCH64) | Known Issues |
|
||||
@@ -8,7 +15,7 @@
|
||||
| ArmPlatformPkg | | :heavy_check_mark: |
|
||||
| ArmVirtPkg | SEE PACKAGE README | SEE PACKAGE README |
|
||||
| CryptoPkg | :heavy_check_mark: | :heavy_check_mark: | Spell checking in audit mode
|
||||
| DynamicTablesPkg | | :heavy_check_mark: |
|
||||
| DynamicTablesPkg | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| EmbeddedPkg |
|
||||
| EmulatorPkg | SEE PACKAGE README | SEE PACKAGE README | Spell checking in audit mode
|
||||
| FatPkg | :heavy_check_mark: | :heavy_check_mark: |
|
||||
@@ -82,43 +89,18 @@ easily and consistently running locally and in a cloud ci environment. To do
|
||||
that a few steps should be followed. Details of EDKII Tools can be found in the
|
||||
[docs folder here](https://github.com/tianocore/edk2-pytool-extensions/tree/master/docs)
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. A supported toolchain (others might work but this is what is tested and validated)
|
||||
* Windows 10:
|
||||
* VS 2017 or VS 2019
|
||||
* Windows SDK (for rc)
|
||||
* Windows WDK (for capsules)
|
||||
* Ubuntu 18.04 or Fedora
|
||||
* GCC5
|
||||
* Easy to add more but this is the current state
|
||||
2. Python 3.7.x or newer on path
|
||||
3. git on path
|
||||
4. Recommended to setup and activate a python virtual environment
|
||||
5. Install the requirements `pip install --upgrade -r pip-requirements.txt`
|
||||
|
||||
### Running CI
|
||||
|
||||
1. clone your edk2 repo
|
||||
2. Activate your python virtual environment in cmd window
|
||||
3. Get code dependencies (done only when submodules change)
|
||||
* `stuart_setup -c .pytool/CISettings.py TOOL_CHAIN_TAG=<your tag here>`
|
||||
4. Update other dependencies (done more often)
|
||||
* `stuart_update -c .pytool/CISettings.py TOOL_CHAIN_TAG=<your tag here>`
|
||||
5. Run CI build (--help will give you options)
|
||||
* `stuart_ci_build -c .pytool/CISettings.py TOOL_CHAIN_TAG=<your tag here>`
|
||||
* -p <pkg1,pkg2,pkg3> : To build only certain packages use a CSV list
|
||||
* -a <arch1,arch2,arch3>: To run only certain architectures use a CSV list
|
||||
* -t <target1,target2>: To run only tests related to certain targets use a
|
||||
CSV list
|
||||
* By default all tests are opted in. Then given a package.ci.yaml file those
|
||||
tests can be configured for a package. Finally setting the check to the
|
||||
value `skip` will skip that plugin. Examples:
|
||||
* `CompilerPlugin=skip` skip the build test
|
||||
* `GuidCheck=skip` skip the Guid check
|
||||
* `SpellCheck=skip` skip the spell checker
|
||||
* etc
|
||||
6. Detailed reports and logs per package are captured in the `Build` directory
|
||||
Quick notes:
|
||||
|
||||
* By default all CI plugins are opted in.
|
||||
* Setting the plugin to `skip` as an argument will skip running the plugin.
|
||||
Examples:
|
||||
* `CompilerPlugin=skip` skip the build test
|
||||
* `GuidCheck=skip` skip the Guid check
|
||||
* `SpellCheck=skip` skip the spell checker
|
||||
* etc.
|
||||
* Detailed reports and logs per package are captured in the `Build` directory.
|
||||
|
||||
## Current PyTool Test Capabilities
|
||||
|
||||
|
@@ -239,5 +239,10 @@
|
||||
],
|
||||
"AdditionalIncludePaths": [] # Additional paths to spell check
|
||||
# (wildcards supported)
|
||||
},
|
||||
|
||||
# options defined in .pytool/Plugin/UncrustifyCheck
|
||||
"UncrustifyCheck": {
|
||||
"AuditOnly": True
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# ARM processor package.
|
||||
#
|
||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
# Copyright (c) 2011 - 2022, ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2011 - 2023, ARM Limited. All rights reserved.
|
||||
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
@@ -139,10 +139,10 @@
|
||||
# Define if the GICv3 controller should use the GICv2 legacy
|
||||
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042
|
||||
|
||||
## Define the conduit to use for monitor calls.
|
||||
# Default PcdMonitorConduitHvc = FALSE, conduit = SMC
|
||||
# If PcdMonitorConduitHvc = TRUE, conduit = HVC
|
||||
gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047
|
||||
# Whether to remap all unused memory NX before installing the CPU arch
|
||||
# protocol driver. This is needed on platforms that map all DRAM with RWX
|
||||
# attributes initially, and can be disabled otherwise.
|
||||
gArmTokenSpaceGuid.PcdRemapUnusedMemoryNx|TRUE|BOOLEAN|0x00000048
|
||||
|
||||
[PcdsFeatureFlag.ARM]
|
||||
# Whether to map normal memory as non-shareable. FALSE is the safe choice, but
|
||||
@@ -221,6 +221,13 @@
|
||||
#
|
||||
gArmTokenSpaceGuid.PcdArmDmaDeviceOffset|0x0|UINT64|0x0000044
|
||||
|
||||
#
|
||||
# Boot the Uefi Shell instead of UiApp when no valid boot option is found.
|
||||
# This is useful in CI environment so that startup.nsh can be launched.
|
||||
# The default value is FALSE.
|
||||
#
|
||||
gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable|FALSE|BOOLEAN|0x0000052
|
||||
|
||||
[PcdsFixedAtBuild.common, PcdsPatchableInModule.common]
|
||||
gArmTokenSpaceGuid.PcdFdBaseAddress|0|UINT64|0x0000002B
|
||||
gArmTokenSpaceGuid.PcdFvBaseAddress|0|UINT64|0x0000002D
|
||||
@@ -305,6 +312,11 @@
|
||||
gArmTokenSpaceGuid.PcdSystemBiosRelease|0xFFFF|UINT16|0x30000058
|
||||
gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease|0xFFFF|UINT16|0x30000059
|
||||
|
||||
## Define the conduit to use for monitor calls.
|
||||
# Default PcdMonitorConduitHvc = FALSE, conduit = SMC
|
||||
# If PcdMonitorConduitHvc = TRUE, conduit = HVC
|
||||
gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047
|
||||
|
||||
[PcdsFixedAtBuild.common, PcdsDynamic.common]
|
||||
#
|
||||
# ARM Architectural Timer
|
||||
@@ -316,6 +328,7 @@
|
||||
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|30|UINT32|0x00000036
|
||||
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|26|UINT32|0x00000040
|
||||
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|27|UINT32|0x00000041
|
||||
gArmTokenSpaceGuid.PcdArmArchTimerHypVirtIntrNum|28|UINT32|0x0000004A
|
||||
|
||||
#
|
||||
# ARM Generic Watchdog
|
||||
|
@@ -113,7 +113,6 @@
|
||||
ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf
|
||||
ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
|
||||
ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
|
||||
ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf
|
||||
ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf
|
||||
ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf
|
||||
ArmPkg/Library/SemihostLib/SemihostLib.inf
|
||||
@@ -163,7 +162,10 @@
|
||||
ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
|
||||
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
|
||||
|
||||
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf
|
||||
|
||||
[Components.AARCH64]
|
||||
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
|
||||
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
|
||||
ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2013-2017, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2013-2023, Arm Ltd. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -8,20 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
#include "ArmGicDxe.h"
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
IrqInterruptHandler (
|
||||
IN EFI_EXCEPTION_TYPE InterruptType,
|
||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ExitBootServicesEvent (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
// Making this global saves a few bytes in image size
|
||||
EFI_HANDLE gHardwareInterruptHandle = NULL;
|
||||
|
||||
@@ -61,7 +47,7 @@ GicGetDistributorIcfgBaseAndBit (
|
||||
|
||||
RegIndex = Source / ARM_GIC_ICDICFR_F_STRIDE; // NOTE: truncation is significant
|
||||
Field = Source % ARM_GIC_ICDICFR_F_STRIDE;
|
||||
*RegAddress = PcdGet64 (PcdGicDistributorBase)
|
||||
*RegAddress = (UINTN)PcdGet64 (PcdGicDistributorBase)
|
||||
+ ARM_GIC_ICDICFR
|
||||
+ (ARM_GIC_ICDICFR_BYTES * RegIndex);
|
||||
*Config1Bit = ((Field * ARM_GIC_ICDICFR_F_WIDTH)
|
||||
@@ -137,7 +123,7 @@ CpuArchEventProtocolNotify (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Status
|
||||
));
|
||||
return;
|
||||
@@ -153,7 +139,7 @@ CpuArchEventProtocolNotify (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Status
|
||||
));
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
@@ -104,10 +104,17 @@ GicGetCpuRedistributorBase (
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINTN
|
||||
/**
|
||||
Return the GIC CPU Interrupt Interface ID.
|
||||
|
||||
@param GicInterruptInterfaceBase Base address of the GIC Interrupt Interface.
|
||||
|
||||
@retval CPU Interface Identification information.
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
ArmGicGetInterfaceIdentification (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
)
|
||||
{
|
||||
// Read the GIC Identification Register
|
||||
@@ -117,7 +124,7 @@ ArmGicGetInterfaceIdentification (
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicGetMaxNumInterrupts (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
UINTN ItLines;
|
||||
@@ -133,15 +140,17 @@ ArmGicGetMaxNumInterrupts (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSendSgiTo (
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN TargetListFilter,
|
||||
IN INTN CPUTargetList,
|
||||
IN INTN SgiId
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINT8 TargetListFilter,
|
||||
IN UINT8 CPUTargetList,
|
||||
IN UINT8 SgiId
|
||||
)
|
||||
{
|
||||
MmioWrite32 (
|
||||
GicDistributorBase + ARM_GIC_ICDSGIR,
|
||||
((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId
|
||||
((TargetListFilter & 0x3) << 24) |
|
||||
((CPUTargetList & 0xFF) << 16) |
|
||||
(SgiId & 0xF)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -167,19 +176,17 @@ ArmGicAcknowledgeInterrupt (
|
||||
)
|
||||
{
|
||||
UINTN Value;
|
||||
UINTN IntId;
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
|
||||
ASSERT (InterruptId != NULL);
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
||||
Value = ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase);
|
||||
// InterruptId is required for the caller to know if a valid or spurious
|
||||
// interrupt has been read
|
||||
ASSERT (InterruptId != NULL);
|
||||
if (InterruptId != NULL) {
|
||||
*InterruptId = Value & ARM_GIC_ICCIAR_ACKINTID;
|
||||
}
|
||||
IntId = Value & ARM_GIC_ICCIAR_ACKINTID;
|
||||
} else if (Revision == ARM_GIC_ARCH_REVISION_3) {
|
||||
Value = ArmGicV3AcknowledgeInterrupt ();
|
||||
IntId = Value;
|
||||
} else {
|
||||
ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
|
||||
// Report Spurious interrupt which is what the above controllers would
|
||||
@@ -187,6 +194,12 @@ ArmGicAcknowledgeInterrupt (
|
||||
Value = 1023;
|
||||
}
|
||||
|
||||
if (InterruptId != NULL) {
|
||||
// InterruptId is required for the caller to know if a valid or spurious
|
||||
// interrupt has been read
|
||||
*InterruptId = IntId;
|
||||
}
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
@@ -219,13 +232,13 @@ ArmGicSetInterruptPriority (
|
||||
)
|
||||
{
|
||||
UINT32 RegOffset;
|
||||
UINTN RegShift;
|
||||
UINT8 RegShift;
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINTN GicCpuRedistributorBase;
|
||||
|
||||
// Calculate register offset and bit position
|
||||
RegOffset = Source / 4;
|
||||
RegShift = (Source % 4) * 8;
|
||||
RegOffset = (UINT32)(Source / 4);
|
||||
RegShift = (UINT8)((Source % 4) * 8);
|
||||
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||
@@ -263,13 +276,13 @@ ArmGicEnableInterrupt (
|
||||
)
|
||||
{
|
||||
UINT32 RegOffset;
|
||||
UINTN RegShift;
|
||||
UINT8 RegShift;
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINTN GicCpuRedistributorBase;
|
||||
|
||||
// Calculate enable register offset and bit position
|
||||
RegOffset = Source / 32;
|
||||
RegShift = Source % 32;
|
||||
RegOffset = (UINT32)(Source / 32);
|
||||
RegShift = (UINT8)(Source % 32);
|
||||
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||
@@ -308,13 +321,13 @@ ArmGicDisableInterrupt (
|
||||
)
|
||||
{
|
||||
UINT32 RegOffset;
|
||||
UINTN RegShift;
|
||||
UINT8 RegShift;
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINTN GicCpuRedistributorBase;
|
||||
|
||||
// Calculate enable register offset and bit position
|
||||
RegOffset = Source / 32;
|
||||
RegShift = Source % 32;
|
||||
RegOffset = (UINT32)(Source / 32);
|
||||
RegShift = (UINT8)(Source % 32);
|
||||
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||
@@ -352,14 +365,14 @@ ArmGicIsInterruptEnabled (
|
||||
)
|
||||
{
|
||||
UINT32 RegOffset;
|
||||
UINTN RegShift;
|
||||
UINT8 RegShift;
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINTN GicCpuRedistributorBase;
|
||||
UINT32 Interrupts;
|
||||
|
||||
// Calculate enable register offset and bit position
|
||||
RegOffset = Source / 32;
|
||||
RegShift = Source % 32;
|
||||
RegOffset = (UINT32)(Source / 32);
|
||||
RegShift = (UINT8)(Source % 32);
|
||||
|
||||
Revision = ArmGicGetSupportedArchRevision ();
|
||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||
@@ -390,7 +403,7 @@ ArmGicIsInterruptEnabled (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
// Disable Gic Distributor
|
||||
@@ -400,7 +413,7 @@ ArmGicDisableDistributor (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
)
|
||||
{
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
@@ -418,7 +431,7 @@ ArmGicEnableInterruptInterface (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
)
|
||||
{
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2015, ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
@@ -13,10 +13,11 @@
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
)
|
||||
{
|
||||
ARM_GIC_ARCH_REVISION Revision;
|
||||
UINT32 GicDistributorCtl;
|
||||
|
||||
/*
|
||||
* Enable GIC distributor in Non-Secure world.
|
||||
@@ -26,7 +27,8 @@ ArmGicEnableDistributor (
|
||||
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
} else {
|
||||
if (MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR) & ARM_GIC_ICDDCR_ARE) {
|
||||
GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR);
|
||||
if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
||||
} else {
|
||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>
|
||||
Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011-2023, Arm Ltd. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -25,8 +25,8 @@ Abstract:
|
||||
extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol;
|
||||
extern EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V2Protocol;
|
||||
|
||||
STATIC UINT32 mGicInterruptInterfaceBase;
|
||||
STATIC UINT32 mGicDistributorBase;
|
||||
STATIC UINTN mGicInterruptInterfaceBase;
|
||||
STATIC UINTN mGicDistributorBase;
|
||||
|
||||
/**
|
||||
Enable interrupt source Source.
|
||||
@@ -162,7 +162,7 @@ GicV2IrqInterruptHandler (
|
||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||
)
|
||||
{
|
||||
UINT32 GicInterrupt;
|
||||
UINTN GicInterrupt;
|
||||
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
||||
|
||||
GicInterrupt = ArmGicV2AcknowledgeInterrupt (mGicInterruptInterfaceBase);
|
||||
@@ -179,7 +179,7 @@ GicV2IrqInterruptHandler (
|
||||
// Call the registered interrupt handler.
|
||||
InterruptHandler (GicInterrupt, SystemContext);
|
||||
} else {
|
||||
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
|
||||
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", (UINT32)GicInterrupt));
|
||||
GicV2EndOfInterrupt (&gHardwareInterruptV2Protocol, GicInterrupt);
|
||||
}
|
||||
}
|
||||
@@ -349,8 +349,8 @@ GicV2ExitBootServicesEvent (
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
UINT32 GicInterrupt;
|
||||
UINTN Index;
|
||||
UINTN GicInterrupt;
|
||||
|
||||
// Disable all the interrupts
|
||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||
@@ -393,23 +393,26 @@ GicV2DxeInitialize (
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
UINT32 RegOffset;
|
||||
UINTN RegShift;
|
||||
UINT8 RegShift;
|
||||
UINT32 CpuTarget;
|
||||
|
||||
// Make sure the Interrupt Controller Protocol is not already installed in
|
||||
// the system.
|
||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||
|
||||
mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase);
|
||||
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
||||
ASSERT (PcdGet64 (PcdGicInterruptInterfaceBase) <= MAX_UINTN);
|
||||
ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN);
|
||||
|
||||
mGicInterruptInterfaceBase = (UINTN)PcdGet64 (PcdGicInterruptInterfaceBase);
|
||||
mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
|
||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||
|
||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||
GicV2DisableInterruptSource (&gHardwareInterruptV2Protocol, Index);
|
||||
|
||||
// Set Priority
|
||||
RegOffset = Index / 4;
|
||||
RegShift = (Index % 4) * 8;
|
||||
RegOffset = (UINT32)(Index / 4);
|
||||
RegShift = (UINT8)((Index % 4) * 8);
|
||||
MmioAndThenOr32 (
|
||||
mGicDistributorBase + ARM_GIC_ICDIPR + (4 * RegOffset),
|
||||
~(0xff << RegShift),
|
||||
|
@@ -1,12 +1,13 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2013-2014, ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2013-2023, ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
**/
|
||||
|
||||
#include <Library/ArmGicLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/IoLib.h>
|
||||
|
||||
UINTN
|
||||
@@ -26,5 +27,6 @@ ArmGicV2EndOfInterrupt (
|
||||
IN UINTN Source
|
||||
)
|
||||
{
|
||||
MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, Source);
|
||||
ASSERT (Source <= MAX_UINT32);
|
||||
MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, (UINT32)Source);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
@@ -13,7 +13,7 @@
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2EnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
)
|
||||
{
|
||||
/*
|
||||
@@ -26,7 +26,7 @@ ArmGicV2EnableInterruptInterface (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2DisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
)
|
||||
{
|
||||
// Disable Gic Interface
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2018, ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
@@ -156,7 +156,7 @@ GicV3IrqInterruptHandler (
|
||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||
)
|
||||
{
|
||||
UINT32 GicInterrupt;
|
||||
UINTN GicInterrupt;
|
||||
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
||||
|
||||
GicInterrupt = ArmGicV3AcknowledgeInterrupt ();
|
||||
@@ -173,7 +173,7 @@ GicV3IrqInterruptHandler (
|
||||
// Call the registered interrupt handler.
|
||||
InterruptHandler (GicInterrupt, SystemContext);
|
||||
} else {
|
||||
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
|
||||
DEBUG ((DEBUG_ERROR, "Spurious GIC interrupt: 0x%x\n", (UINT32)GicInterrupt));
|
||||
GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, GicInterrupt);
|
||||
}
|
||||
}
|
||||
@@ -381,7 +381,7 @@ GicV3DxeInitialize (
|
||||
// the system.
|
||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||
|
||||
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
||||
mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
|
||||
mGicRedistributorsBase = PcdGet64 (PcdGicRedistributorsBase);
|
||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||
|
||||
|
1861
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c
Normal file
1861
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c
Normal file
File diff suppressed because it is too large
Load Diff
56
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
Normal file
56
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
Normal file
@@ -0,0 +1,56 @@
|
||||
## @file
|
||||
# ARM MP services protocol driver
|
||||
#
|
||||
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 1.27
|
||||
BASE_NAME = ArmPsciMpServicesDxe
|
||||
FILE_GUID = 007ab472-dc4a-4df8-a5c2-abb4a327278c
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
|
||||
ENTRY_POINT = ArmPsciMpServicesDxeInitialize
|
||||
|
||||
[Sources.Common]
|
||||
ArmPsciMpServicesDxe.c
|
||||
MpFuncs.S
|
||||
MpServicesInternal.h
|
||||
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
ArmPlatformPkg/ArmPlatformPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
ArmLib
|
||||
ArmMmuLib
|
||||
ArmSmcLib
|
||||
BaseMemoryLib
|
||||
CacheMaintenanceLib
|
||||
CpuExceptionHandlerLib
|
||||
DebugLib
|
||||
HobLib
|
||||
MemoryAllocationLib
|
||||
UefiBootServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
UefiLib
|
||||
|
||||
[Protocols]
|
||||
gEfiMpServiceProtocolGuid ## PRODUCES
|
||||
gEfiLoadedImageProtocolGuid ## CONSUMES
|
||||
|
||||
[Guids]
|
||||
gArmMpCoreInfoGuid
|
||||
|
||||
[Depex]
|
||||
TRUE
|
||||
|
||||
[BuildOptions]
|
||||
GCC:*_*_*_CC_FLAGS = -mstrict-align
|
74
ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S
Normal file
74
ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S
Normal file
@@ -0,0 +1,74 @@
|
||||
#===============================================================================
|
||||
# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#===============================================================================
|
||||
|
||||
.text
|
||||
.align 3
|
||||
|
||||
#include <AsmMacroIoLibV8.h>
|
||||
#include <IndustryStandard/ArmStdSmc.h>
|
||||
#include <Library/ArmLib.h>
|
||||
|
||||
#include "MpServicesInternal.h"
|
||||
|
||||
GCC_ASM_IMPORT (gApStacksBase)
|
||||
GCC_ASM_IMPORT (gProcessorIDs)
|
||||
GCC_ASM_IMPORT (ApProcedure)
|
||||
GCC_ASM_IMPORT (gApStackSize)
|
||||
GCC_ASM_IMPORT (gTcr)
|
||||
GCC_ASM_IMPORT (gTtbr0)
|
||||
GCC_ASM_IMPORT (gMair)
|
||||
|
||||
GCC_ASM_EXPORT (ApEntryPoint)
|
||||
|
||||
// Entry-point for the AP
|
||||
// VOID
|
||||
// ApEntryPoint (
|
||||
// VOID
|
||||
// );
|
||||
ASM_PFX(ApEntryPoint):
|
||||
// Configure the MMU and caches
|
||||
ldr x0, gTcr
|
||||
bl ArmSetTCR
|
||||
ldr x0, gTtbr0
|
||||
bl ArmSetTTBR0
|
||||
ldr x0, gMair
|
||||
bl ArmSetMAIR
|
||||
bl ArmDisableAlignmentCheck
|
||||
bl ArmEnableStackAlignmentCheck
|
||||
bl ArmEnableInstructionCache
|
||||
bl ArmEnableDataCache
|
||||
bl ArmEnableMmu
|
||||
|
||||
mrs x0, mpidr_el1
|
||||
// Mask the non-affinity bits
|
||||
bic x0, x0, 0x00ff000000
|
||||
and x0, x0, 0xffffffffff
|
||||
ldr x1, gProcessorIDs
|
||||
mov x2, 0 // x2 = processor index
|
||||
|
||||
// Find index in gProcessorIDs for current processor
|
||||
1:
|
||||
ldr x3, [x1, x2, lsl #3] // x4 = gProcessorIDs + x2 * 8
|
||||
cmp x3, #-1 // check if we've reached the end of gProcessorIDs
|
||||
beq ProcessorNotFound
|
||||
add x2, x2, 1 // x2++
|
||||
cmp x0, x3 // if mpidr_el1 != gProcessorIDs[x] then loop
|
||||
bne 1b
|
||||
|
||||
// Calculate stack address
|
||||
// x2 contains the index for the current processor plus 1
|
||||
ldr x0, gApStacksBase
|
||||
ldr x1, gApStackSize
|
||||
mul x3, x2, x1 // x3 = (ProcessorIndex + 1) * gApStackSize
|
||||
add sp, x0, x3 // sp = gApStacksBase + x3
|
||||
mov x29, xzr
|
||||
bl ApProcedure // doesn't return
|
||||
|
||||
ProcessorNotFound:
|
||||
// Turn off the processor
|
||||
MOV32 (w0, ARM_SMC_ID_PSCI_CPU_OFF)
|
||||
smc #0
|
||||
b .
|
345
ArmPkg/Drivers/ArmPsciMpServicesDxe/MpServicesInternal.h
Normal file
345
ArmPkg/Drivers/ArmPsciMpServicesDxe/MpServicesInternal.h
Normal file
@@ -0,0 +1,345 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011, Apple Inc. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef MP_SERVICES_INTERNAL_H_
|
||||
#define MP_SERVICES_INTERNAL_H_
|
||||
|
||||
#include <Protocol/Cpu.h>
|
||||
#include <Protocol/MpService.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
|
||||
#define AP_STACK_SIZE 0x1000
|
||||
|
||||
//
|
||||
// Internal Data Structures
|
||||
//
|
||||
|
||||
//
|
||||
// AP state
|
||||
//
|
||||
// The state transitions for an AP when it processes a procedure are:
|
||||
// Idle ----> Ready ----> Busy ----> Finished ----> Idle
|
||||
// [BSP] [BSP] [AP] [BSP]
|
||||
//
|
||||
typedef enum {
|
||||
CpuStateIdle,
|
||||
CpuStateReady,
|
||||
CpuStateBlocked,
|
||||
CpuStateBusy,
|
||||
CpuStateFinished,
|
||||
CpuStateDisabled
|
||||
} CPU_STATE;
|
||||
|
||||
//
|
||||
// Define Individual Processor Data block.
|
||||
//
|
||||
typedef struct {
|
||||
EFI_PROCESSOR_INFORMATION Info;
|
||||
EFI_AP_PROCEDURE Procedure;
|
||||
VOID *Parameter;
|
||||
CPU_STATE State;
|
||||
EFI_EVENT CheckThisAPEvent;
|
||||
EFI_EVENT WaitEvent;
|
||||
UINTN Timeout;
|
||||
UINTN TimeTaken;
|
||||
BOOLEAN TimeoutActive;
|
||||
BOOLEAN *SingleApFinished;
|
||||
} CPU_AP_DATA;
|
||||
|
||||
//
|
||||
// Define MP data block which consumes individual processor block.
|
||||
//
|
||||
typedef struct {
|
||||
UINTN NumberOfProcessors;
|
||||
UINTN NumberOfEnabledProcessors;
|
||||
EFI_EVENT CheckAllAPsEvent;
|
||||
EFI_EVENT AllWaitEvent;
|
||||
UINTN FinishCount;
|
||||
UINTN StartCount;
|
||||
EFI_AP_PROCEDURE Procedure;
|
||||
VOID *ProcedureArgument;
|
||||
BOOLEAN SingleThread;
|
||||
UINTN StartedNumber;
|
||||
CPU_AP_DATA *CpuData;
|
||||
UINTN *FailedList;
|
||||
UINTN FailedListIndex;
|
||||
UINTN AllTimeout;
|
||||
UINTN AllTimeTaken;
|
||||
BOOLEAN AllTimeoutActive;
|
||||
} CPU_MP_DATA;
|
||||
|
||||
/** Secondary core entry point.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ApEntryPoint (
|
||||
VOID
|
||||
);
|
||||
|
||||
/** C entry-point for the AP.
|
||||
This function gets called from the assembly function ApEntryPoint.
|
||||
**/
|
||||
VOID
|
||||
ApProcedure (
|
||||
VOID
|
||||
);
|
||||
|
||||
/** Turns on the specified core using PSCI and executes the user-supplied
|
||||
function that's been configured via a previous call to SetApProcedure.
|
||||
|
||||
@param ProcessorIndex The index of the core to turn on.
|
||||
|
||||
@retval EFI_SUCCESS The processor was successfully turned on.
|
||||
@retval EFI_DEVICE_ERROR An error occurred turning the processor on.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DispatchCpu (
|
||||
IN UINTN ProcessorIndex
|
||||
);
|
||||
|
||||
/** Returns whether the specified processor is the BSP.
|
||||
|
||||
@param[in] ProcessorIndex The index the processor to check.
|
||||
|
||||
@return TRUE if the processor is the BSP, FALSE otherwise.
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsProcessorBSP (
|
||||
UINTN ProcessorIndex
|
||||
);
|
||||
|
||||
/** Returns whether the processor executing this function is the BSP.
|
||||
|
||||
@return Whether the current processor is the BSP.
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsCurrentProcessorBSP (
|
||||
VOID
|
||||
);
|
||||
|
||||
/** Returns whether the specified processor is enabled.
|
||||
|
||||
@param[in] ProcessorIndex The index of the processor to check.
|
||||
|
||||
@return TRUE if the processor is enabled, FALSE otherwise.
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsProcessorEnabled (
|
||||
UINTN ProcessorIndex
|
||||
);
|
||||
|
||||
/** Configures the processor context with the user-supplied procedure and
|
||||
argument.
|
||||
|
||||
@param CpuData The processor context.
|
||||
@param Procedure The user-supplied procedure.
|
||||
@param ProcedureArgument The user-supplied procedure argument.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
SetApProcedure (
|
||||
IN CPU_AP_DATA *CpuData,
|
||||
IN EFI_AP_PROCEDURE Procedure,
|
||||
IN VOID *ProcedureArgument
|
||||
);
|
||||
|
||||
/**
|
||||
Get the Application Processors state.
|
||||
|
||||
@param[in] CpuData The pointer to CPU_AP_DATA of specified AP
|
||||
|
||||
@return The AP status
|
||||
**/
|
||||
CPU_STATE
|
||||
GetApState (
|
||||
IN CPU_AP_DATA *CpuData
|
||||
);
|
||||
|
||||
/** Returns the index of the next processor that is blocked.
|
||||
|
||||
@param[out] NextNumber The index of the next blocked processor.
|
||||
|
||||
@retval EFI_SUCCESS Successfully found the next blocked processor.
|
||||
@retval EFI_NOT_FOUND There are no blocked processors.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
GetNextBlockedNumber (
|
||||
OUT UINTN *NextNumber
|
||||
);
|
||||
|
||||
/** Stalls the BSP for the minimum of gPollInterval and Timeout.
|
||||
|
||||
@param[in] Timeout The time limit in microseconds remaining for
|
||||
APs to return from Procedure.
|
||||
|
||||
@retval StallTime Time of execution stall.
|
||||
**/
|
||||
STATIC
|
||||
UINTN
|
||||
CalculateAndStallInterval (
|
||||
IN UINTN Timeout
|
||||
);
|
||||
|
||||
/** Sets up the state for the StartupAllAPs function.
|
||||
|
||||
@param SingleThread Whether the APs will execute sequentially.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
StartupAllAPsPrepareState (
|
||||
IN BOOLEAN SingleThread
|
||||
);
|
||||
|
||||
/** Handles execution of StartupAllAPs when a WaitEvent has been specified.
|
||||
|
||||
@param Procedure The user-supplied procedure.
|
||||
@param ProcedureArgument The user-supplied procedure argument.
|
||||
@param WaitEvent The wait event to be signaled when the work is
|
||||
complete or a timeout has occurred.
|
||||
@param TimeoutInMicroseconds The timeout for the work to be completed. Zero
|
||||
indicates an infinite timeout.
|
||||
@param SingleThread Whether the APs will execute sequentially.
|
||||
@param FailedCpuList User-supplied pointer for list of failed CPUs.
|
||||
|
||||
@return EFI_SUCCESS on success.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
StartupAllAPsWithWaitEvent (
|
||||
IN EFI_AP_PROCEDURE Procedure,
|
||||
IN VOID *ProcedureArgument,
|
||||
IN EFI_EVENT WaitEvent,
|
||||
IN UINTN TimeoutInMicroseconds,
|
||||
IN BOOLEAN SingleThread,
|
||||
IN UINTN **FailedCpuList
|
||||
);
|
||||
|
||||
/** Handles execution of StartupAllAPs when no wait event has been specified.
|
||||
|
||||
@param Procedure The user-supplied procedure.
|
||||
@param ProcedureArgument The user-supplied procedure argument.
|
||||
@param TimeoutInMicroseconds The timeout for the work to be completed. Zero
|
||||
indicates an infinite timeout.
|
||||
@param SingleThread Whether the APs will execute sequentially.
|
||||
@param FailedCpuList User-supplied pointer for list of failed CPUs.
|
||||
|
||||
@return EFI_SUCCESS on success.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
StartupAllAPsNoWaitEvent (
|
||||
IN EFI_AP_PROCEDURE Procedure,
|
||||
IN VOID *ProcedureArgument,
|
||||
IN UINTN TimeoutInMicroseconds,
|
||||
IN BOOLEAN SingleThread,
|
||||
IN UINTN **FailedCpuList
|
||||
);
|
||||
|
||||
/** Adds the specified processor the list of failed processors.
|
||||
|
||||
@param ProcessorIndex The processor index to add.
|
||||
@param ApState Processor state.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
AddProcessorToFailedList (
|
||||
UINTN ProcessorIndex,
|
||||
CPU_STATE ApState
|
||||
);
|
||||
|
||||
/** Handles the StartupAllAPs case where the timeout has occurred.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
ProcessStartupAllAPsTimeout (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
If a timeout is specified in StartupAllAps(), a timer is set, which invokes
|
||||
this procedure periodically to check whether all APs have finished.
|
||||
|
||||
@param[in] Event The WaitEvent the user supplied.
|
||||
@param[in] Context The event context.
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
CheckAllAPsStatus (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/** Invoked periodically via a timer to check the state of the processor.
|
||||
|
||||
@param Event The event supplied by the timer expiration.
|
||||
@param Context The processor context.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
CheckThisAPStatus (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
This function is called by all processors (both BSP and AP) once and collects
|
||||
MP related data.
|
||||
|
||||
@param BSP TRUE if the processor is the BSP.
|
||||
@param Mpidr The MPIDR for the specified processor. This should be
|
||||
the full MPIDR and not only the affinity bits.
|
||||
@param ProcessorIndex The index of the processor.
|
||||
|
||||
@return EFI_SUCCESS if the data for the processor collected and filled in.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
FillInProcessorInformation (
|
||||
IN BOOLEAN BSP,
|
||||
IN UINTN Mpidr,
|
||||
IN UINTN ProcessorIndex
|
||||
);
|
||||
|
||||
/**
|
||||
Event notification function called when the EFI_EVENT_GROUP_READY_TO_BOOT is
|
||||
signaled. After this point, non-blocking mode is no longer allowed.
|
||||
|
||||
@param Event Event whose notification function is being invoked.
|
||||
@param Context The pointer to the notification function's context,
|
||||
which is implementation-dependent.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
ReadyToBootSignaled (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
#endif /* MP_SERVICES_INTERNAL_H_ */
|
@@ -236,12 +236,7 @@ ClockDescribeRates (
|
||||
*TotalRates = NUM_RATES (DescribeRates->NumRatesFlags)
|
||||
+ NUM_REMAIN_RATES (DescribeRates->NumRatesFlags);
|
||||
|
||||
if (*Format == ScmiClockRateFormatDiscrete) {
|
||||
RequiredArraySize = (*TotalRates) * sizeof (UINT64);
|
||||
} else {
|
||||
// We need to return triplet of 64 bit value for each rate
|
||||
RequiredArraySize = (*TotalRates) * 3 * sizeof (UINT64);
|
||||
}
|
||||
RequiredArraySize = (*TotalRates) * sizeof (UINT64);
|
||||
|
||||
if (RequiredArraySize > (*RateArraySize)) {
|
||||
*RateArraySize = RequiredArraySize;
|
||||
@@ -259,23 +254,21 @@ ClockDescribeRates (
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
}
|
||||
} else {
|
||||
for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {
|
||||
// Linear clock rates from minimum to maximum in steps
|
||||
// Minimum clock rate.
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
RateArray[RateIndex].ContinuousRate.Min =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
// Linear clock rates from minimum to maximum in steps
|
||||
// Minimum clock rate.
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
RateArray[RateIndex].ContinuousRate.Min =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
// Maximum clock rate.
|
||||
RateArray[RateIndex].ContinuousRate.Max =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
// Maximum clock rate.
|
||||
RateArray[RateIndex].ContinuousRate.Max =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
// Step.
|
||||
RateArray[RateIndex++].ContinuousRate.Step =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
}
|
||||
Rate = &DescribeRates->Rates[RateOffset++];
|
||||
// Step.
|
||||
RateArray[RateIndex++].ContinuousRate.Step =
|
||||
ConvertTo64Bit (Rate->Low, Rate->High);
|
||||
}
|
||||
} while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2017-2023, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
System Control and Management Interface V1.0
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
||||
System Control and Management Interface V3.2, latest version at:
|
||||
- https://developer.arm.com/documentation/den0056/latest/
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
@@ -416,6 +416,75 @@ PerformanceLevelGet (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/** Discover the attributes of the FastChannel for the specified
|
||||
performance domain and the specified message.
|
||||
|
||||
@param[in] This A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance.
|
||||
@param[in] DomainId Identifier for the performance domain.
|
||||
@param[in] MessageId Message Id of the FastChannel to discover.
|
||||
Must be one of:
|
||||
- PERFORMANCE_LIMITS_SET
|
||||
- PERFORMANCE_LIMITS_GET
|
||||
- PERFORMANCE_LEVEL_SET
|
||||
- PERFORMANCE_LEVEL_GET
|
||||
@param[out] FastChannel If success, contains the FastChannel description.
|
||||
|
||||
@retval EFI_SUCCESS Performance level got successfully.
|
||||
@retval EFI_DEVICE_ERROR SCP returns an SCMI error.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@retval EFI_TIMEOUT Time out.
|
||||
@retval EFI_UNSUPPORTED Unsupported.
|
||||
**/
|
||||
EFI_STATUS
|
||||
DescribeFastchannel (
|
||||
IN SCMI_PERFORMANCE_PROTOCOL *This,
|
||||
IN UINT32 DomainId,
|
||||
IN SCMI_MESSAGE_ID_PERFORMANCE MessageId,
|
||||
OUT SCMI_PERFORMANCE_FASTCHANNEL *FastChannel
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
SCMI_COMMAND Cmd;
|
||||
UINT32 PayloadLength;
|
||||
UINT32 *ReturnValues;
|
||||
UINT32 *MessageParams;
|
||||
|
||||
if ((This == NULL) ||
|
||||
(FastChannel == NULL))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = ScmiCommandGetPayload (&MessageParams);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
*MessageParams++ = DomainId;
|
||||
*MessageParams = MessageId;
|
||||
|
||||
Cmd.ProtocolId = ScmiProtocolIdPerformance;
|
||||
Cmd.MessageId = ScmiMessageIdPerformanceDescribeFastchannel;
|
||||
PayloadLength = sizeof (DomainId) + sizeof (MessageId);
|
||||
|
||||
Status = ScmiCommandExecute (
|
||||
&Cmd,
|
||||
&PayloadLength,
|
||||
&ReturnValues
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
CopyMem (
|
||||
FastChannel,
|
||||
ReturnValues,
|
||||
sizeof (SCMI_PERFORMANCE_FASTCHANNEL)
|
||||
);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Instance of the SCMI performance management protocol.
|
||||
STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol = {
|
||||
PerformanceGetVersion,
|
||||
@@ -425,7 +494,8 @@ STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol = {
|
||||
PerformanceLimitsSet,
|
||||
PerformanceLimitsGet,
|
||||
PerformanceLevelSet,
|
||||
PerformanceLevelGet
|
||||
PerformanceLevelGet,
|
||||
DescribeFastchannel,
|
||||
};
|
||||
|
||||
/** Initialize performance management protocol and install on a given Handle.
|
||||
|
@@ -13,11 +13,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include "CpuDxe.h"
|
||||
|
||||
#define INVALID_ENTRY ((UINT32)~0)
|
||||
#define INVALID_ENTRY ((UINT64)~0)
|
||||
|
||||
#define MIN_T0SZ 16
|
||||
#define BITS_PER_LEVEL 9
|
||||
|
||||
/**
|
||||
Parses T0SZ to determine the level and number of entries at the root
|
||||
of the translation table.
|
||||
|
||||
@param T0SZ The T0SZ value to be parsed.
|
||||
@param RootTableLevel The level of the root table.
|
||||
@param RootTableEntryCount The number of entries in the root table.
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
GetRootTranslationTableInfo (
|
||||
@@ -30,6 +38,13 @@ GetRootTranslationTableInfo (
|
||||
*RootTableEntryCount = TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;
|
||||
}
|
||||
|
||||
/**
|
||||
Converts ARM translation table attributes to GCD attributes.
|
||||
|
||||
@param PageAttributes The translation table attributes to be converted.
|
||||
|
||||
@retval The analogous GCD attributes.
|
||||
**/
|
||||
STATIC
|
||||
UINT64
|
||||
PageAttributeToGcdAttribute (
|
||||
@@ -64,6 +79,10 @@ PageAttributeToGcdAttribute (
|
||||
}
|
||||
|
||||
// Determine protection attributes
|
||||
if ((PageAttributes & TT_AF) == 0) {
|
||||
GcdAttributes |= EFI_MEMORY_RP;
|
||||
}
|
||||
|
||||
if (((PageAttributes & TT_AP_MASK) == TT_AP_NO_RO) ||
|
||||
((PageAttributes & TT_AP_MASK) == TT_AP_RO_RO))
|
||||
{
|
||||
@@ -79,6 +98,31 @@ PageAttributeToGcdAttribute (
|
||||
return GcdAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert an arch specific set of page attributes into a mask
|
||||
of EFI_MEMORY_xx constants.
|
||||
|
||||
@param PageAttributes The set of page attributes.
|
||||
|
||||
@retval The mask of EFI_MEMORY_xx constants.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
RegionAttributeToGcdAttribute (
|
||||
IN UINTN PageAttributes
|
||||
)
|
||||
{
|
||||
return PageAttributeToGcdAttribute (PageAttributes);
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieves the attribute of the first page entry in the translation table.
|
||||
|
||||
@param[in] FirstLevelTableAddress The base address of the translation table.
|
||||
@param[in] TableLevel The current level being traversed.
|
||||
|
||||
@retval The attributes of the first page entry found, or INVALID_ENTRY.
|
||||
**/
|
||||
STATIC
|
||||
UINT64
|
||||
GetFirstPageAttribute (
|
||||
@@ -99,12 +143,25 @@ GetFirstPageAttribute (
|
||||
} else if (((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY) ||
|
||||
((TableLevel == 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY_LEVEL3)))
|
||||
{
|
||||
return FirstEntry & TT_ATTR_INDX_MASK;
|
||||
return FirstEntry & TT_ATTRIBUTES_MASK;
|
||||
} else {
|
||||
return INVALID_ENTRY;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This function recursively traverses the translation table heirarchy to
|
||||
synchronise the GCD with the translation table.
|
||||
|
||||
@param[in] TableAddress The address of the table being processed.
|
||||
@param[in] EntryCount The number of entries in the current level of the table.
|
||||
@param[in] TableLevel The current level of the memory table being processed.
|
||||
@param[in] BaseAddress The starting address of the region.
|
||||
@param[in, out] PrevEntryAttribute The attributes of the previous region.
|
||||
@param[in, out] StartGcdRegion The start of the GCD region.
|
||||
|
||||
@retval The address at the end of the last region processed.
|
||||
**/
|
||||
STATIC
|
||||
UINT64
|
||||
GetNextEntryAttribute (
|
||||
@@ -112,14 +169,14 @@ GetNextEntryAttribute (
|
||||
IN UINTN EntryCount,
|
||||
IN UINTN TableLevel,
|
||||
IN UINT64 BaseAddress,
|
||||
IN OUT UINT32 *PrevEntryAttribute,
|
||||
IN OUT UINT64 *PrevEntryAttribute,
|
||||
IN OUT UINT64 *StartGcdRegion
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
UINT64 Entry;
|
||||
UINT32 EntryAttribute;
|
||||
UINT32 EntryType;
|
||||
UINT64 EntryAttribute;
|
||||
UINT64 EntryType;
|
||||
EFI_STATUS Status;
|
||||
UINTN NumberOfDescriptors;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
||||
@@ -127,17 +184,19 @@ GetNextEntryAttribute (
|
||||
// Get the memory space map from GCD
|
||||
MemorySpaceMap = NULL;
|
||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
// We cannot get more than 3-level page table
|
||||
ASSERT (TableLevel <= 3);
|
||||
if (EFI_ERROR (Status) || (TableLevel > 3)) {
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ASSERT (TableLevel <= 3);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// While the top level table might not contain TT_ENTRY_COUNT entries;
|
||||
// the subsequent ones should be filled up
|
||||
for (Index = 0; Index < EntryCount; Index++) {
|
||||
Entry = TableAddress[Index];
|
||||
EntryType = Entry & TT_TYPE_MASK;
|
||||
EntryAttribute = Entry & TT_ATTR_INDX_MASK;
|
||||
EntryAttribute = Entry & TT_ATTRIBUTES_MASK;
|
||||
|
||||
// If Entry is a Table Descriptor type entry then go through the sub-level table
|
||||
if ((EntryType == TT_TYPE_BLOCK_ENTRY) ||
|
||||
@@ -197,13 +256,22 @@ GetNextEntryAttribute (
|
||||
return BaseAddress + (EntryCount * TT_ADDRESS_AT_LEVEL (TableLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
Sync the GCD memory space attributes with the translation table.
|
||||
|
||||
@param[in] CpuProtocol The CPU architectural protocol instance.
|
||||
|
||||
@retval EFI_SUCCESS The GCD memory space attributes are synced with
|
||||
the MMU page table.
|
||||
@retval Others The return value of GetMemorySpaceMap().
|
||||
**/
|
||||
EFI_STATUS
|
||||
SyncCacheConfig (
|
||||
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 PageAttribute;
|
||||
UINT64 PageAttribute;
|
||||
UINT64 *FirstLevelTableAddress;
|
||||
UINTN TableLevel;
|
||||
UINTN TableCount;
|
||||
@@ -222,7 +290,11 @@ SyncCacheConfig (
|
||||
//
|
||||
MemorySpaceMap = NULL;
|
||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// The GCD implementation maintains its own copy of the state of memory space attributes. GCD needs
|
||||
// to know what the initial memory space attributes are. The CPU Arch. Protocol does not provide a
|
||||
@@ -256,7 +328,7 @@ SyncCacheConfig (
|
||||
);
|
||||
|
||||
// Update GCD with the last region if valid
|
||||
if (PageAttribute != INVALID_ENTRY) {
|
||||
if ((PageAttribute != INVALID_ENTRY) && (EndAddressGcdRegion > BaseAddressGcdRegion)) {
|
||||
SetGcdMemorySpaceAttributes (
|
||||
MemorySpaceMap,
|
||||
NumberOfDescriptors,
|
||||
@@ -271,6 +343,13 @@ SyncCacheConfig (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert EFI memory attributes to ARM translation table attributes.
|
||||
|
||||
@param[in] EfiAttributes EFI memory attributes.
|
||||
|
||||
@retval The analogous translation table attributes.
|
||||
**/
|
||||
UINT64
|
||||
EfiAttributeToArmAttribute (
|
||||
IN UINT64 EfiAttributes
|
||||
@@ -301,7 +380,9 @@ EfiAttributeToArmAttribute (
|
||||
}
|
||||
|
||||
// Set the access flag to match the block attributes
|
||||
ArmAttributes |= TT_AF;
|
||||
if ((EfiAttributes & EFI_MEMORY_RP) == 0) {
|
||||
ArmAttributes |= TT_AF;
|
||||
}
|
||||
|
||||
// Determine protection attributes
|
||||
if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
|
||||
@@ -316,8 +397,25 @@ EfiAttributeToArmAttribute (
|
||||
return ArmAttributes;
|
||||
}
|
||||
|
||||
// This function will recursively go down the page table to find the first block address linked to 'BaseAddress'.
|
||||
// And then the function will identify the size of the region that has the same page table attribute.
|
||||
/**
|
||||
This function returns the attributes of the memory region containing the
|
||||
specified address.
|
||||
|
||||
RegionLength and RegionAttributes are only valid if the result is EFI_SUCCESS.
|
||||
|
||||
@param[in] TranslationTable The translation table base address.
|
||||
@param[in] TableLevel The level of the translation table.
|
||||
@param[in] LastBlockEntry The last block address of the table level.
|
||||
@param[in, out] BaseAddress The base address of the memory region.
|
||||
@param[out] RegionLength The length of the memory region.
|
||||
@param[out] RegionAttributes The attributes of the memory region.
|
||||
|
||||
@retval EFI_SUCCESS The attributes of the memory region were
|
||||
returned successfully.
|
||||
@retval EFI_NOT_FOUND The memory region was not found.
|
||||
@retval EFI_NO_MAPPING The translation table entry associated with
|
||||
BaseAddress is invalid.
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetMemoryRegionRec (
|
||||
IN UINT64 *TranslationTable,
|
||||
@@ -357,10 +455,10 @@ GetMemoryRegionRec (
|
||||
RegionAttributes
|
||||
);
|
||||
|
||||
// In case of 'Success', it means the end of the block region has been found into the upper
|
||||
// level translation table
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return EFI_SUCCESS;
|
||||
// EFI_SUCCESS: The end of the end of the region was found.
|
||||
// EFI_NO_MAPPING: The translation entry associated with BaseAddress is invalid.
|
||||
if (Status != EFI_NOT_FOUND) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
// Now we processed the table move to the next entry
|
||||
@@ -372,12 +470,13 @@ GetMemoryRegionRec (
|
||||
*RegionLength = 0;
|
||||
*RegionAttributes = *BlockEntry & TT_ATTRIBUTES_MASK;
|
||||
} else {
|
||||
// We have an 'Invalid' entry
|
||||
return EFI_UNSUPPORTED;
|
||||
return EFI_NO_MAPPING;
|
||||
}
|
||||
|
||||
while (BlockEntry <= LastBlockEntry) {
|
||||
if ((*BlockEntry & TT_ATTRIBUTES_MASK) == *RegionAttributes) {
|
||||
if (((*BlockEntry & TT_TYPE_MASK) == BlockEntryType) &&
|
||||
((*BlockEntry & TT_ATTRIBUTES_MASK) == *RegionAttributes))
|
||||
{
|
||||
*RegionLength = *RegionLength + TT_BLOCK_ENTRY_SIZE_AT_LEVEL (TableLevel);
|
||||
} else {
|
||||
// In case we have found the end of the region we return success
|
||||
@@ -389,10 +488,29 @@ GetMemoryRegionRec (
|
||||
|
||||
// If we have reached the end of the TranslationTable and we have not found the end of the region then
|
||||
// we return EFI_NOT_FOUND.
|
||||
// The caller will continue to look for the memory region at its level
|
||||
// The caller will continue to look for the memory region at its level.
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieves a memory region from a given base address.
|
||||
|
||||
This function retrieves a memory region starting from a given base address.
|
||||
|
||||
@param[in, out] BaseAddress The base address from which to retrieve
|
||||
the memory region. On successful return, this is
|
||||
updated to the end address of the retrieved region.
|
||||
@param[out] RegionLength The length of the retrieved memory region.
|
||||
@param[out] RegionAttributes The attributes of the retrieved memory region.
|
||||
|
||||
@retval EFI_STATUS Returns EFI_SUCCESS if the memory region is
|
||||
retrieved successfully, or the status of the
|
||||
recursive call to GetMemoryRegionRec.
|
||||
@retval EFI_NOT_FOUND The memory region was not found.
|
||||
@retval EFI_NO_MAPPING The translation table entry associated with
|
||||
BaseAddress is invalid.
|
||||
@retval EFI_INVALID_PARAMETER One of the input parameters was NULL.
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetMemoryRegion (
|
||||
IN OUT UINTN *BaseAddress,
|
||||
@@ -406,10 +524,18 @@ GetMemoryRegion (
|
||||
UINTN EntryCount;
|
||||
UINTN T0SZ;
|
||||
|
||||
ASSERT ((BaseAddress != NULL) && (RegionLength != NULL) && (RegionAttributes != NULL));
|
||||
if ((BaseAddress == NULL) || (RegionLength == NULL) || (RegionAttributes == NULL)) {
|
||||
ASSERT ((BaseAddress != NULL) && (RegionLength != NULL) && (RegionAttributes != NULL));
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
TranslationTable = ArmGetTTBR0BaseAddress ();
|
||||
|
||||
// Initialize the output parameters. These paramaters are only valid if the
|
||||
// result is EFI_SUCCESS.
|
||||
*RegionLength = 0;
|
||||
*RegionAttributes = 0;
|
||||
|
||||
T0SZ = ArmGetTCR () & TCR_T0SZ_MASK;
|
||||
// Get the Table info from T0SZ
|
||||
GetRootTranslationTableInfo (T0SZ, &TableLevel, &EntryCount);
|
||||
@@ -424,10 +550,10 @@ GetMemoryRegion (
|
||||
);
|
||||
|
||||
// If the region continues up to the end of the root table then GetMemoryRegionRec()
|
||||
// will return EFI_NOT_FOUND
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
// will return EFI_NOT_FOUND. Check if the region length was updated.
|
||||
if ((Status == EFI_NOT_FOUND) && (*RegionLength > 0)) {
|
||||
return EFI_SUCCESS;
|
||||
} else {
|
||||
return Status;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@@ -13,6 +13,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include "CpuDxe.h"
|
||||
|
||||
/**
|
||||
Convert a set of ARM short descriptor section attributes into a mask
|
||||
of EFI_MEMORY_xx constants.
|
||||
|
||||
@param[in] SectionAttributes The set of page attributes.
|
||||
@param[out] GcdAttributes Pointer to the return value.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were converted successfully.
|
||||
@retval EFI_UNSUPPORTED The section attributes did not have a
|
||||
GCD transation.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
SectionToGcdAttributes (
|
||||
IN UINT32 SectionAttributes,
|
||||
@@ -50,33 +62,62 @@ SectionToGcdAttributes (
|
||||
|
||||
// determine protection attributes
|
||||
switch (SectionAttributes & TT_DESCRIPTOR_SECTION_AP_MASK) {
|
||||
case TT_DESCRIPTOR_SECTION_AP_NO_NO: // no read, no write
|
||||
// *GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;
|
||||
break;
|
||||
|
||||
case TT_DESCRIPTOR_SECTION_AP_RW_NO:
|
||||
case TT_DESCRIPTOR_SECTION_AP_NO_RW:
|
||||
case TT_DESCRIPTOR_SECTION_AP_RW_RW:
|
||||
// normal read/write access, do not add additional attributes
|
||||
break;
|
||||
|
||||
// read only cases map to write-protect
|
||||
case TT_DESCRIPTOR_SECTION_AP_RO_NO:
|
||||
case TT_DESCRIPTOR_SECTION_AP_NO_RO:
|
||||
case TT_DESCRIPTOR_SECTION_AP_RO_RO:
|
||||
*GcdAttributes |= EFI_MEMORY_RO;
|
||||
break;
|
||||
|
||||
default:
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// now process eXectue Never attribute
|
||||
if ((SectionAttributes & TT_DESCRIPTOR_SECTION_XN_MASK) != 0 ) {
|
||||
if ((SectionAttributes & TT_DESCRIPTOR_SECTION_XN_MASK) != 0) {
|
||||
*GcdAttributes |= EFI_MEMORY_XP;
|
||||
}
|
||||
|
||||
if ((SectionAttributes & TT_DESCRIPTOR_SECTION_AF) == 0) {
|
||||
*GcdAttributes |= EFI_MEMORY_RP;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert an arch specific set of page attributes into a mask
|
||||
of EFI_MEMORY_xx constants.
|
||||
|
||||
@param[in] PageAttributes The set of page attributes.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were converted successfully.
|
||||
@retval EFI_UNSUPPORTED The section attributes did not have a
|
||||
GCD transation.
|
||||
**/
|
||||
UINT64
|
||||
RegionAttributeToGcdAttribute (
|
||||
IN UINTN PageAttributes
|
||||
)
|
||||
{
|
||||
UINT64 Result;
|
||||
|
||||
SectionToGcdAttributes (PageAttributes, &Result);
|
||||
return Result;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert a set of ARM short descriptor page attributes into a mask
|
||||
of EFI_MEMORY_xx constants.
|
||||
|
||||
@param[in] PageAttributes The set of page attributes.
|
||||
@param[out] GcdAttributes Pointer to the return value.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were converted successfully.
|
||||
@retval EFI_UNSUPPORTED The page attributes did not have a GCD transation.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
PageToGcdAttributes (
|
||||
IN UINT32 PageAttributes,
|
||||
@@ -114,33 +155,47 @@ PageToGcdAttributes (
|
||||
|
||||
// determine protection attributes
|
||||
switch (PageAttributes & TT_DESCRIPTOR_PAGE_AP_MASK) {
|
||||
case TT_DESCRIPTOR_PAGE_AP_NO_NO: // no read, no write
|
||||
// *GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;
|
||||
break;
|
||||
|
||||
case TT_DESCRIPTOR_PAGE_AP_RW_NO:
|
||||
case TT_DESCRIPTOR_PAGE_AP_NO_RW:
|
||||
case TT_DESCRIPTOR_PAGE_AP_RW_RW:
|
||||
// normal read/write access, do not add additional attributes
|
||||
break;
|
||||
|
||||
// read only cases map to write-protect
|
||||
case TT_DESCRIPTOR_PAGE_AP_RO_NO:
|
||||
case TT_DESCRIPTOR_PAGE_AP_NO_RO:
|
||||
case TT_DESCRIPTOR_PAGE_AP_RO_RO:
|
||||
*GcdAttributes |= EFI_MEMORY_RO;
|
||||
break;
|
||||
|
||||
default:
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// now process eXectue Never attribute
|
||||
if ((PageAttributes & TT_DESCRIPTOR_PAGE_XN_MASK) != 0 ) {
|
||||
if ((PageAttributes & TT_DESCRIPTOR_PAGE_XN_MASK) != 0) {
|
||||
*GcdAttributes |= EFI_MEMORY_XP;
|
||||
}
|
||||
|
||||
if ((PageAttributes & TT_DESCRIPTOR_PAGE_AF) == 0) {
|
||||
*GcdAttributes |= EFI_MEMORY_RP;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Synchronizes the GCD with the translation table for a specified page.
|
||||
|
||||
This function synchronizes cache configuration for a given page based on its section index
|
||||
and the first level descriptor. It traverses the second level table entries of the page and
|
||||
updates the GCD attributes accordingly for each entry.
|
||||
|
||||
@param[in] SectionIndex The index of the section where the page resides.
|
||||
@param[in] FirstLevelDescriptor The first translation table level of the page.
|
||||
@param[in] NumberOfDescriptors The number of descriptors in the GCD memory space map.
|
||||
@param[in] MemorySpaceMap The GCD memory space descriptor.
|
||||
@param[in, out] NextRegionBase The next region base address.
|
||||
@param[in, out] NextRegionLength The next region length.
|
||||
@param[in, out] NextSectionAttributes The next section attributes.
|
||||
|
||||
@retval EFI_STATUS Always return success
|
||||
**/
|
||||
EFI_STATUS
|
||||
SyncCacheConfigPage (
|
||||
IN UINT32 SectionIndex,
|
||||
@@ -165,7 +220,8 @@ SyncCacheConfigPage (
|
||||
|
||||
// Convert SectionAttributes into PageAttributes
|
||||
NextPageAttributes =
|
||||
TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY (*NextSectionAttributes, 0) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY (*NextSectionAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_PAGE_AF (*NextSectionAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_PAGE_AP (*NextSectionAttributes);
|
||||
|
||||
// obtain page table base
|
||||
@@ -174,7 +230,7 @@ SyncCacheConfigPage (
|
||||
for (i = 0; i < TRANSLATION_TABLE_PAGE_COUNT; i++) {
|
||||
if ((SecondLevelTable[i] & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
||||
// extract attributes (cacheability and permissions)
|
||||
PageAttributes = SecondLevelTable[i] & (TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK | TT_DESCRIPTOR_PAGE_AP_MASK);
|
||||
PageAttributes = SecondLevelTable[i] & (TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK | TT_DESCRIPTOR_PAGE_AP_MASK | TT_DESCRIPTOR_PAGE_AF);
|
||||
|
||||
if (NextPageAttributes == 0) {
|
||||
// start on a new region
|
||||
@@ -184,7 +240,10 @@ SyncCacheConfigPage (
|
||||
} else if (PageAttributes != NextPageAttributes) {
|
||||
// Convert Section Attributes into GCD Attributes
|
||||
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
GcdAttributes = 0;
|
||||
}
|
||||
|
||||
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
||||
@@ -197,7 +256,10 @@ SyncCacheConfigPage (
|
||||
} else if (NextPageAttributes != 0) {
|
||||
// Convert Page Attributes into GCD Attributes
|
||||
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
GcdAttributes = 0;
|
||||
}
|
||||
|
||||
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
||||
@@ -212,12 +274,21 @@ SyncCacheConfigPage (
|
||||
|
||||
// Convert back PageAttributes into SectionAttributes
|
||||
*NextSectionAttributes =
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY (NextPageAttributes, 0) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY (NextPageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_AF (NextPageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_AP (NextPageAttributes);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Sync the GCD memory space attributes with the translation table.
|
||||
|
||||
@param[in] CpuProtocol The CPU architectural protocol instance.
|
||||
|
||||
@retval EFI_SUCCESS The GCD memory space attributes are synced with the MMU page table.
|
||||
@retval Others The return value of GetMemorySpaceMap().
|
||||
**/
|
||||
EFI_STATUS
|
||||
SyncCacheConfig (
|
||||
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
||||
@@ -244,7 +315,12 @@ SyncCacheConfig (
|
||||
//
|
||||
MemorySpaceMap = NULL;
|
||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - GetMemorySpaceMap() failed! Status: %r\n", Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
// The GCD implementation maintains its own copy of the state of memory space attributes. GCD needs
|
||||
// to know what the initial memory space attributes are. The CPU Arch. Protocol does not provide a
|
||||
@@ -256,14 +332,14 @@ SyncCacheConfig (
|
||||
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)(ArmGetTTBR0BaseAddress ());
|
||||
|
||||
// Get the first region
|
||||
NextSectionAttributes = FirstLevelTable[0] & (TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK | TT_DESCRIPTOR_SECTION_AP_MASK);
|
||||
NextSectionAttributes = FirstLevelTable[0] & (TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK | TT_DESCRIPTOR_SECTION_AP_MASK | TT_DESCRIPTOR_SECTION_AF);
|
||||
|
||||
// iterate through each 1MB descriptor
|
||||
NextRegionBase = NextRegionLength = 0;
|
||||
for (i = 0; i < TRANSLATION_TABLE_SECTION_COUNT; i++) {
|
||||
if ((FirstLevelTable[i] & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) {
|
||||
// extract attributes (cacheability and permissions)
|
||||
SectionAttributes = FirstLevelTable[i] & (TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK | TT_DESCRIPTOR_SECTION_AP_MASK);
|
||||
SectionAttributes = FirstLevelTable[i] & (TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK | TT_DESCRIPTOR_SECTION_AP_MASK | TT_DESCRIPTOR_SECTION_AF);
|
||||
|
||||
if (NextSectionAttributes == 0) {
|
||||
// start on a new region
|
||||
@@ -273,7 +349,12 @@ SyncCacheConfig (
|
||||
} else if (SectionAttributes != NextSectionAttributes) {
|
||||
// Convert Section Attributes into GCD Attributes
|
||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
GcdAttributes = 0;
|
||||
}
|
||||
|
||||
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||
@@ -309,7 +390,11 @@ SyncCacheConfig (
|
||||
if (NextSectionAttributes != 0) {
|
||||
// Convert Section Attributes into GCD Attributes
|
||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
GcdAttributes = 0;
|
||||
}
|
||||
|
||||
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||
@@ -326,7 +411,11 @@ SyncCacheConfig (
|
||||
if (NextSectionAttributes != 0) {
|
||||
// Convert Section Attributes into GCD Attributes
|
||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
GcdAttributes = 0;
|
||||
}
|
||||
|
||||
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||
@@ -337,6 +426,13 @@ SyncCacheConfig (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Convert EFI memory attributes to ARM translation table attributes.
|
||||
|
||||
@param[in] EfiAttributes EFI memory attributes.
|
||||
|
||||
@retval The analogous translation table attributes.
|
||||
**/
|
||||
UINT64
|
||||
EfiAttributeToArmAttribute (
|
||||
IN UINT64 EfiAttributes
|
||||
@@ -383,23 +479,46 @@ EfiAttributeToArmAttribute (
|
||||
ArmAttributes |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||
}
|
||||
|
||||
if ((EfiAttributes & EFI_MEMORY_RP) == 0) {
|
||||
ArmAttributes |= TT_DESCRIPTOR_SECTION_AF;
|
||||
}
|
||||
|
||||
return ArmAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
This function finds the end of a memory region in a translation table. A
|
||||
memory region is defined as a contiguous set of pages with the same attributes.
|
||||
|
||||
@param[in] PageTable The translation table to traverse.
|
||||
@param[in] BaseAddress The address from which to start the search
|
||||
@param[in] RegionAttributes The attributes of the start of the region.
|
||||
@param[out] RegionLength The length of the region found.
|
||||
|
||||
@retval EFI_SUCCESS The region was found.
|
||||
@retval EFI_NOT_FOUND The end of the region was not found.
|
||||
@retval EFI_NO_MAPPING The region specified by BaseAddress is not mapped
|
||||
in the input translation table.
|
||||
@retval EFI_UNSUPPORTED Large pages are not supported.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
GetMemoryRegionPage (
|
||||
IN UINT32 *PageTable,
|
||||
IN OUT UINTN *BaseAddress,
|
||||
OUT UINTN *RegionLength,
|
||||
OUT UINTN *RegionAttributes
|
||||
IN UINTN *BaseAddress,
|
||||
IN UINTN *RegionAttributes,
|
||||
OUT UINTN *RegionLength
|
||||
)
|
||||
{
|
||||
UINT32 PageAttributes;
|
||||
UINT32 TableIndex;
|
||||
UINT32 PageDescriptor;
|
||||
UINT32 PageAttributes;
|
||||
UINT32 TableIndex;
|
||||
UINT32 PageDescriptor;
|
||||
EFI_STATUS Status;
|
||||
|
||||
// Convert the section attributes into page attributes
|
||||
PageAttributes = ConvertSectionAttributesToPageAttributes (*RegionAttributes, 0);
|
||||
PageAttributes = ConvertSectionAttributesToPageAttributes (*RegionAttributes);
|
||||
Status = EFI_NOT_FOUND;
|
||||
*RegionLength = 0;
|
||||
|
||||
// Calculate index into first level translation table for start of modification
|
||||
TableIndex = ((*BaseAddress) & TT_DESCRIPTOR_PAGE_INDEX_MASK) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||
@@ -411,25 +530,44 @@ GetMemoryRegionPage (
|
||||
PageDescriptor = PageTable[TableIndex];
|
||||
|
||||
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_FAULT) {
|
||||
// Case: End of the boundary of the region
|
||||
return EFI_SUCCESS;
|
||||
Status = (*RegionLength > 0) ? EFI_SUCCESS : EFI_NO_MAPPING;
|
||||
break;
|
||||
} else if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_PAGE) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
||||
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK) == PageAttributes) {
|
||||
*RegionLength = *RegionLength + TT_DESCRIPTOR_PAGE_SIZE;
|
||||
} else {
|
||||
// Case: End of the boundary of the region
|
||||
return EFI_SUCCESS;
|
||||
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK) != PageAttributes) {
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
*RegionLength += TT_DESCRIPTOR_PAGE_SIZE;
|
||||
} else {
|
||||
// We do not support Large Page yet. We return EFI_SUCCESS that means end of the region.
|
||||
// Large pages are unsupported.
|
||||
Status = EFI_UNSUPPORTED;
|
||||
ASSERT (0);
|
||||
return EFI_SUCCESS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Get the memory region that contains the specified address. A memory region is defined
|
||||
as a contiguous set of pages with the same attributes.
|
||||
|
||||
RegionLength and RegionAttributes are only valid if EFI_SUCCESS is returned.
|
||||
|
||||
@param[in, out] BaseAddress On input, the address to search for.
|
||||
On output, the base address of the region found.
|
||||
@param[out] RegionLength The length of the region found.
|
||||
@param[out] RegionAttributes The attributes of the region found.
|
||||
|
||||
@retval EFI_SUCCESS Region found
|
||||
@retval EFI_NOT_FOUND Region not found
|
||||
@retval EFI_UNSUPPORTED Large pages are unsupported
|
||||
@retval EFI_NO_MAPPING The page specified by BaseAddress is unmapped
|
||||
@retval EFI_INVALID_PARAMETER The BaseAddress exceeds the addressable range of
|
||||
the translation table.
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetMemoryRegion (
|
||||
IN OUT UINTN *BaseAddress,
|
||||
@@ -444,6 +582,7 @@ GetMemoryRegion (
|
||||
UINT32 SectionDescriptor;
|
||||
ARM_FIRST_LEVEL_DESCRIPTOR *FirstLevelTable;
|
||||
UINT32 *PageTable;
|
||||
UINTN Length;
|
||||
|
||||
// Initialize the arguments
|
||||
*RegionLength = 0;
|
||||
@@ -453,7 +592,11 @@ GetMemoryRegion (
|
||||
|
||||
// Calculate index into first level translation table for start of modification
|
||||
TableIndex = TT_DESCRIPTOR_SECTION_BASE_ADDRESS (*BaseAddress) >> TT_DESCRIPTOR_SECTION_BASE_SHIFT;
|
||||
ASSERT (TableIndex < TRANSLATION_TABLE_SECTION_COUNT);
|
||||
|
||||
if (TableIndex >= TRANSLATION_TABLE_SECTION_COUNT) {
|
||||
ASSERT (TableIndex < TRANSLATION_TABLE_SECTION_COUNT);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Get the section at the given index
|
||||
SectionDescriptor = FirstLevelTable[TableIndex];
|
||||
@@ -479,10 +622,15 @@ GetMemoryRegion (
|
||||
ASSERT (PageTableIndex < TRANSLATION_TABLE_PAGE_COUNT);
|
||||
|
||||
PageAttributes = PageTable[PageTableIndex] & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK;
|
||||
*RegionAttributes = TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY (PageAttributes, 0) |
|
||||
*RegionAttributes = TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY (PageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_S (PageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_XN (PageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_AF (PageAttributes) |
|
||||
TT_DESCRIPTOR_CONVERT_TO_SECTION_AP (PageAttributes);
|
||||
}
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
|
||||
for ( ; TableIndex < TRANSLATION_TABLE_SECTION_COUNT; TableIndex++) {
|
||||
// Get the section at the given index
|
||||
SectionDescriptor = FirstLevelTable[TableIndex];
|
||||
@@ -491,14 +639,18 @@ GetMemoryRegion (
|
||||
if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE (SectionDescriptor)) {
|
||||
// Extract the page table location from the descriptor
|
||||
PageTable = (UINT32 *)(SectionDescriptor & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK);
|
||||
Length = 0;
|
||||
|
||||
// Scan the page table to find the end of the region.
|
||||
Status = GetMemoryRegionPage (PageTable, BaseAddress, RegionLength, RegionAttributes);
|
||||
Status = GetMemoryRegionPage (PageTable, BaseAddress, RegionAttributes, &Length);
|
||||
*RegionLength += Length;
|
||||
|
||||
// If we have found the end of the region (Status == EFI_SUCCESS) then we exit the for-loop
|
||||
if (Status == EFI_SUCCESS) {
|
||||
break;
|
||||
// Status == EFI_NOT_FOUND implies we have not reached the end of the region.
|
||||
if ((Status == EFI_NOT_FOUND) && (Length > 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
} else if (((SectionDescriptor & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) ||
|
||||
((SectionDescriptor & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SUPERSECTION))
|
||||
{
|
||||
@@ -514,5 +666,10 @@ GetMemoryRegion (
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
// Check if the region length was updated.
|
||||
if (*RegionLength > 0) {
|
||||
Status = EFI_SUCCESS;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <Guid/IdleLoopEvent.h>
|
||||
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
|
||||
BOOLEAN mIsFlushingGCD;
|
||||
|
||||
/**
|
||||
@@ -227,6 +229,77 @@ InitializeDma (
|
||||
CpuArchProtocol->DmaBufferAlignment = ArmCacheWritebackGranule ();
|
||||
}
|
||||
|
||||
/**
|
||||
Map all EfiConventionalMemory regions in the memory map with NX
|
||||
attributes so that allocating or freeing EfiBootServicesData regions
|
||||
does not result in changes to memory permission attributes.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
RemapUnusedMemoryNx (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT64 TestBit;
|
||||
UINTN MemoryMapSize;
|
||||
UINTN MapKey;
|
||||
UINTN DescriptorSize;
|
||||
UINT32 DescriptorVersion;
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMap;
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMapEntry;
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMapEnd;
|
||||
EFI_STATUS Status;
|
||||
|
||||
TestBit = LShiftU64 (1, EfiBootServicesData);
|
||||
if ((PcdGet64 (PcdDxeNxMemoryProtectionPolicy) & TestBit) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
MemoryMapSize = 0;
|
||||
MemoryMap = NULL;
|
||||
|
||||
Status = gBS->GetMemoryMap (
|
||||
&MemoryMapSize,
|
||||
MemoryMap,
|
||||
&MapKey,
|
||||
&DescriptorSize,
|
||||
&DescriptorVersion
|
||||
);
|
||||
ASSERT (Status == EFI_BUFFER_TOO_SMALL);
|
||||
do {
|
||||
MemoryMap = (EFI_MEMORY_DESCRIPTOR *)AllocatePool (MemoryMapSize);
|
||||
ASSERT (MemoryMap != NULL);
|
||||
Status = gBS->GetMemoryMap (
|
||||
&MemoryMapSize,
|
||||
MemoryMap,
|
||||
&MapKey,
|
||||
&DescriptorSize,
|
||||
&DescriptorVersion
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (MemoryMap);
|
||||
}
|
||||
} while (Status == EFI_BUFFER_TOO_SMALL);
|
||||
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
MemoryMapEntry = MemoryMap;
|
||||
MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)MemoryMap + MemoryMapSize);
|
||||
while ((UINTN)MemoryMapEntry < (UINTN)MemoryMapEnd) {
|
||||
if (MemoryMapEntry->Type == EfiConventionalMemory) {
|
||||
ArmSetMemoryAttributes (
|
||||
MemoryMapEntry->PhysicalStart,
|
||||
EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages),
|
||||
EFI_MEMORY_XP,
|
||||
EFI_MEMORY_XP
|
||||
);
|
||||
}
|
||||
|
||||
MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize);
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
CpuDxeInitialize (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
@@ -240,10 +313,26 @@ CpuDxeInitialize (
|
||||
|
||||
InitializeDma (&mCpu);
|
||||
|
||||
//
|
||||
// Once we install the CPU arch protocol, the DXE core's memory
|
||||
// protection routines will invoke them to manage the permissions of page
|
||||
// allocations as they are created. Given that this includes pages
|
||||
// allocated for page tables by this driver, we must ensure that unused
|
||||
// memory is mapped with the same permissions as boot services data
|
||||
// regions. Otherwise, we may end up with unbounded recursion, due to the
|
||||
// fact that updating permissions on a newly allocated page table may trigger
|
||||
// a block entry split, which triggers a page table allocation, etc etc
|
||||
//
|
||||
if (FeaturePcdGet (PcdRemapUnusedMemoryNx)) {
|
||||
RemapUnusedMemoryNx ();
|
||||
}
|
||||
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&mCpuHandle,
|
||||
&gEfiCpuArchProtocolGuid,
|
||||
&mCpu,
|
||||
&gEfiMemoryAttributeProtocolGuid,
|
||||
&mMemoryAttribute,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
@@ -30,9 +30,12 @@
|
||||
#include <Protocol/Cpu.h>
|
||||
#include <Protocol/DebugSupport.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/MemoryAttribute.h>
|
||||
|
||||
extern BOOLEAN mIsFlushingGCD;
|
||||
|
||||
extern EFI_MEMORY_ATTRIBUTE_PROTOCOL mMemoryAttribute;
|
||||
|
||||
/**
|
||||
This function registers and enables the handler specified by InterruptHandler for a processor
|
||||
interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
|
||||
@@ -126,4 +129,18 @@ SetGcdMemorySpaceAttributes (
|
||||
IN UINT64 Attributes
|
||||
);
|
||||
|
||||
/**
|
||||
Convert an arch specific set of page attributes into a mask
|
||||
of EFI_MEMORY_xx constants.
|
||||
|
||||
@param PageAttributes The set of page attributes.
|
||||
|
||||
@retval The mask of EFI_MEMORY_xx constants.
|
||||
|
||||
**/
|
||||
UINT64
|
||||
RegionAttributeToGcdAttribute (
|
||||
IN UINTN PageAttributes
|
||||
);
|
||||
|
||||
#endif // CPU_DXE_H_
|
||||
|
@@ -23,6 +23,7 @@
|
||||
CpuDxe.h
|
||||
CpuMmuCommon.c
|
||||
Exception.c
|
||||
MemoryAttribute.c
|
||||
|
||||
[Sources.ARM]
|
||||
Arm/Mmu.c
|
||||
@@ -47,12 +48,14 @@
|
||||
DefaultExceptionHandlerLib
|
||||
DxeServicesTableLib
|
||||
HobLib
|
||||
MemoryAllocationLib
|
||||
PeCoffGetEntryPointLib
|
||||
UefiDriverEntryPoint
|
||||
UefiLib
|
||||
|
||||
[Protocols]
|
||||
gEfiCpuArchProtocolGuid
|
||||
gEfiMemoryAttributeProtocolGuid
|
||||
|
||||
[Guids]
|
||||
gEfiDebugImageInfoTableGuid
|
||||
@@ -62,9 +65,11 @@
|
||||
|
||||
[Pcd.common]
|
||||
gArmTokenSpaceGuid.PcdVFPEnabled
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy
|
||||
|
||||
[FeaturePcd.common]
|
||||
gArmTokenSpaceGuid.PcdDebuggerExceptionSupport
|
||||
gArmTokenSpaceGuid.PcdRemapUnusedMemoryNx
|
||||
|
||||
[Depex]
|
||||
gHardwareInterruptProtocolGuid OR gHardwareInterrupt2ProtocolGuid
|
||||
|
@@ -217,7 +217,7 @@ CpuSetMemoryAttributes (
|
||||
if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) ||
|
||||
((BaseAddress + Length) > (RegionBaseAddress + RegionLength)))
|
||||
{
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes);
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes, 0);
|
||||
} else {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
273
ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
Normal file
273
ArmPkg/Drivers/CpuDxe/MemoryAttribute.c
Normal file
@@ -0,0 +1,273 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2023, Google LLC. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "CpuDxe.h"
|
||||
|
||||
/**
|
||||
Check whether the provided memory range is covered by a single entry of type
|
||||
EfiGcdSystemMemory in the GCD memory map.
|
||||
|
||||
@param BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param Length The size in bytes of the memory region.
|
||||
|
||||
@return Whether the region is system memory or not.
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
RegionIsSystemMemory (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;
|
||||
EFI_PHYSICAL_ADDRESS GcdEndAddress;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &GcdDescriptor);
|
||||
if (EFI_ERROR (Status) ||
|
||||
(GcdDescriptor.GcdMemoryType != EfiGcdMemoryTypeSystemMemory))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GcdEndAddress = GcdDescriptor.BaseAddress + GcdDescriptor.Length;
|
||||
|
||||
//
|
||||
// Return TRUE if the GCD descriptor covers the range entirely
|
||||
//
|
||||
return GcdEndAddress >= (BaseAddress + Length);
|
||||
}
|
||||
|
||||
/**
|
||||
This function retrieves the attributes of the memory region specified by
|
||||
BaseAddress and Length. If different attributes are obtained from different
|
||||
parts of the memory region, EFI_NO_MAPPING will be returned.
|
||||
|
||||
@param This The EFI_MEMORY_ATTRIBUTE_PROTOCOL instance.
|
||||
@param BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param Length The size in bytes of the memory region.
|
||||
@param Attributes Pointer to attributes returned.
|
||||
|
||||
@retval EFI_SUCCESS The attributes got for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
Attributes is NULL.
|
||||
@retval EFI_NO_MAPPING Attributes are not consistent cross the memory
|
||||
region.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more
|
||||
bytes of the memory resource range specified
|
||||
by BaseAddress and Length.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
GetMemoryAttributes (
|
||||
IN EFI_MEMORY_ATTRIBUTE_PROTOCOL *This,
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
OUT UINT64 *Attributes
|
||||
)
|
||||
{
|
||||
UINTN RegionAddress;
|
||||
UINTN RegionLength;
|
||||
UINTN RegionAttributes;
|
||||
UINTN Union;
|
||||
UINTN Intersection;
|
||||
EFI_STATUS Status;
|
||||
|
||||
if ((Length == 0) || (Attributes == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!RegionIsSystemMemory (BaseAddress, Length)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: BaseAddress == 0x%lx, Length == 0x%lx\n",
|
||||
__func__,
|
||||
BaseAddress,
|
||||
Length
|
||||
));
|
||||
|
||||
Union = 0;
|
||||
Intersection = MAX_UINTN;
|
||||
|
||||
for (RegionAddress = (UINTN)BaseAddress;
|
||||
RegionAddress < (UINTN)(BaseAddress + Length);
|
||||
RegionAddress += RegionLength)
|
||||
{
|
||||
Status = GetMemoryRegion (
|
||||
&RegionAddress,
|
||||
&RegionLength,
|
||||
&RegionAttributes
|
||||
);
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: RegionAddress == 0x%lx, RegionLength == 0x%lx, RegionAttributes == 0x%lx\n",
|
||||
__func__,
|
||||
(UINT64)RegionAddress,
|
||||
(UINT64)RegionLength,
|
||||
(UINT64)RegionAttributes
|
||||
));
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_NO_MAPPING;
|
||||
}
|
||||
|
||||
Union |= RegionAttributes;
|
||||
Intersection &= RegionAttributes;
|
||||
}
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: Union == %lx, Intersection == %lx\n",
|
||||
__func__,
|
||||
(UINT64)Union,
|
||||
(UINT64)Intersection
|
||||
));
|
||||
|
||||
if (Union != Intersection) {
|
||||
return EFI_NO_MAPPING;
|
||||
}
|
||||
|
||||
*Attributes = RegionAttributeToGcdAttribute (Union);
|
||||
*Attributes &= EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
This function set given attributes of the memory region specified by
|
||||
BaseAddress and Length.
|
||||
|
||||
The valid Attributes is EFI_MEMORY_RP, EFI_MEMORY_XP, and EFI_MEMORY_RO.
|
||||
|
||||
@param This The EFI_MEMORY_ATTRIBUTE_PROTOCOL instance.
|
||||
@param BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param Length The size in bytes of the memory region.
|
||||
@param Attributes The bit mask of attributes to set for the memory
|
||||
region.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
Attributes specified an illegal combination of
|
||||
attributes that cannot be set together.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more
|
||||
bytes of the memory resource range specified
|
||||
by BaseAddress and Length.
|
||||
The bit mask of attributes is not supported for
|
||||
the memory resource range specified by
|
||||
BaseAddress and Length.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
@retval EFI_ACCESS_DENIED Attributes for the requested memory region are
|
||||
controlled by system firmware and cannot be
|
||||
updated via the protocol.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
SetMemoryAttributes (
|
||||
IN EFI_MEMORY_ATTRIBUTE_PROTOCOL *This,
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
)
|
||||
{
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
|
||||
__func__,
|
||||
(UINTN)BaseAddress,
|
||||
(UINTN)Length,
|
||||
(UINTN)Attributes
|
||||
));
|
||||
|
||||
if ((Length == 0) ||
|
||||
((Attributes & ~(EFI_MEMORY_RO | EFI_MEMORY_RP | EFI_MEMORY_XP)) != 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!RegionIsSystemMemory (BaseAddress, Length)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, Attributes, Attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
This function clears given attributes of the memory region specified by
|
||||
BaseAddress and Length.
|
||||
|
||||
The valid Attributes is EFI_MEMORY_RP, EFI_MEMORY_XP, and EFI_MEMORY_RO.
|
||||
|
||||
@param This The EFI_MEMORY_ATTRIBUTE_PROTOCOL instance.
|
||||
@param BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param Length The size in bytes of the memory region.
|
||||
@param Attributes The bit mask of attributes to clear for the memory
|
||||
region.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were cleared for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
Attributes specified an illegal combination of
|
||||
attributes that cannot be cleared together.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more
|
||||
bytes of the memory resource range specified
|
||||
by BaseAddress and Length.
|
||||
The bit mask of attributes is not supported for
|
||||
the memory resource range specified by
|
||||
BaseAddress and Length.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
@retval EFI_ACCESS_DENIED Attributes for the requested memory region are
|
||||
controlled by system firmware and cannot be
|
||||
updated via the protocol.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
ClearMemoryAttributes (
|
||||
IN EFI_MEMORY_ATTRIBUTE_PROTOCOL *This,
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
)
|
||||
{
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a: BaseAddress == 0x%lx, Length == 0x%lx, Attributes == 0x%lx\n",
|
||||
__func__,
|
||||
(UINTN)BaseAddress,
|
||||
(UINTN)Length,
|
||||
(UINTN)Attributes
|
||||
));
|
||||
|
||||
if ((Length == 0) ||
|
||||
((Attributes & ~(EFI_MEMORY_RO | EFI_MEMORY_RP | EFI_MEMORY_XP)) != 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!RegionIsSystemMemory (BaseAddress, Length)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, 0, Attributes);
|
||||
}
|
||||
|
||||
EFI_MEMORY_ATTRIBUTE_PROTOCOL mMemoryAttribute = {
|
||||
GetMemoryAttributes,
|
||||
SetMemoryAttributes,
|
||||
ClearMemoryAttributes
|
||||
};
|
@@ -3,6 +3,7 @@
|
||||
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011 Hewlett Packard Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2011-2013, ARM Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2023, Google, LLC. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -24,6 +25,7 @@ Abstract:
|
||||
// The protocols, PPI and GUID definitions for this module
|
||||
//
|
||||
#include <Ppi/ArmMpCoreInfo.h>
|
||||
#include <Ppi/MemoryAttribute.h>
|
||||
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
@@ -34,6 +36,77 @@ Abstract:
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include <Library/ArmLib.h>
|
||||
#include <Library/ArmMmuLib.h>
|
||||
|
||||
/**
|
||||
Set the requested memory permission attributes on a region of memory.
|
||||
|
||||
BaseAddress and Length must be aligned to EFI_PAGE_SIZE.
|
||||
|
||||
Attributes must contain a combination of EFI_MEMORY_RP, EFI_MEMORY_RO and
|
||||
EFI_MEMORY_XP, and specifies the attributes that must be set for the
|
||||
region in question. Attributes that are omitted will be cleared from the
|
||||
region only if they are set in AttributeMask.
|
||||
|
||||
AttributeMask must contain a combination of EFI_MEMORY_RP, EFI_MEMORY_RO and
|
||||
EFI_MEMORY_XP, and specifies the attributes that the call will operate on.
|
||||
AttributeMask must not be 0x0, and must contain at least the bits set in
|
||||
Attributes.
|
||||
|
||||
@param[in] This The protocol instance pointer.
|
||||
@param[in] BaseAddress The physical address that is the start address
|
||||
of a memory region.
|
||||
@param[in] Length The size in bytes of the memory region.
|
||||
@param[in] Attributes Memory attributes to set or clear.
|
||||
@param[in] AttributeMask Mask of memory attributes to operate on.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER Length is zero.
|
||||
AttributeMask is zero.
|
||||
AttributeMask lacks bits set in Attributes.
|
||||
BaseAddress or Length is not suitably aligned.
|
||||
@retval EFI_UNSUPPORTED The processor does not support one or more
|
||||
bytes of the memory resource range specified
|
||||
by BaseAddress and Length.
|
||||
The bit mask of attributes is not supported for
|
||||
the memory resource range specified by
|
||||
BaseAddress and Length.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SetMemoryPermissions (
|
||||
IN EDKII_MEMORY_ATTRIBUTE_PPI *This,
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes,
|
||||
IN UINT64 AttributeMask
|
||||
)
|
||||
{
|
||||
if ((Length == 0) ||
|
||||
(AttributeMask == 0) ||
|
||||
((AttributeMask & (EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP)) == 0) ||
|
||||
((Attributes & ~AttributeMask) != 0) ||
|
||||
(((BaseAddress | Length) & EFI_PAGE_MASK) != 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, Attributes, AttributeMask);
|
||||
}
|
||||
|
||||
STATIC CONST EDKII_MEMORY_ATTRIBUTE_PPI mMemoryAttributePpi = {
|
||||
SetMemoryPermissions
|
||||
};
|
||||
|
||||
STATIC CONST EFI_PEI_PPI_DESCRIPTOR mMemoryAttributePpiDesc = {
|
||||
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||
&gEdkiiMemoryAttributePpiGuid,
|
||||
(VOID *)&mMemoryAttributePpi
|
||||
};
|
||||
|
||||
/*++
|
||||
|
||||
@@ -79,5 +152,8 @@ InitializeCpuPeim (
|
||||
}
|
||||
}
|
||||
|
||||
Status = PeiServicesInstallPpi (&mMemoryAttributePpiDesc);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#
|
||||
# This module provides platform specific function to detect boot mode.
|
||||
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2023, Google, LLC. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
@@ -28,6 +29,7 @@
|
||||
CpuPei.c
|
||||
|
||||
[Packages]
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
@@ -37,9 +39,11 @@
|
||||
DebugLib
|
||||
HobLib
|
||||
ArmLib
|
||||
ArmMmuLib
|
||||
|
||||
[Ppis]
|
||||
gArmMpCoreInfoPpiGuid
|
||||
gEdkiiMemoryAttributePpiGuid
|
||||
|
||||
[Guids]
|
||||
gArmMpCoreInfoGuid
|
||||
|
@@ -1,9 +1,13 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||
* Copyright (c) 2013-2017, ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
* @par Reference(s):
|
||||
* - Generic Watchdog specification in Arm Base System Architecture 1.0C:
|
||||
* https://developer.arm.com/documentation/den0094/c/
|
||||
**/
|
||||
|
||||
#ifndef GENERIC_WATCHDOG_H_
|
||||
@@ -14,12 +18,17 @@
|
||||
|
||||
// Control Frame:
|
||||
#define GENERIC_WDOG_CONTROL_STATUS_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x000)
|
||||
#define GENERIC_WDOG_OFFSET_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x008)
|
||||
#define GENERIC_WDOG_OFFSET_REG_LOW ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x008)
|
||||
#define GENERIC_WDOG_OFFSET_REG_HIGH ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x00C)
|
||||
#define GENERIC_WDOG_COMPARE_VALUE_REG_LOW ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x010)
|
||||
#define GENERIC_WDOG_COMPARE_VALUE_REG_HIGH ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x014)
|
||||
#define GENERIC_WDOG_IID_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0xFCC)
|
||||
|
||||
// Values of bit 0 of the Control/Status Register
|
||||
#define GENERIC_WDOG_ENABLED 1
|
||||
#define GENERIC_WDOG_DISABLED 0
|
||||
|
||||
#define GENERIC_WDOG_IID_ARCH_REV_SHIFT 16
|
||||
#define GENERIC_WDOG_IID_ARCH_REV_MASK 0xF
|
||||
|
||||
#endif // GENERIC_WATCHDOG_H_
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||
* Copyright (c) 2013-2018, ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
@@ -27,24 +28,58 @@
|
||||
in a second */
|
||||
#define TIME_UNITS_PER_SECOND 10000000
|
||||
|
||||
// Tick frequency of the generic timer basis of the generic watchdog.
|
||||
STATIC UINTN mTimerFrequencyHz = 0;
|
||||
|
||||
/* In cases where the compare register was set manually, information about
|
||||
how long the watchdog was asked to wait cannot be retrieved from hardware.
|
||||
It is therefore stored here. 0 means the timer is not running. */
|
||||
STATIC UINT64 mNumTimerTicks = 0;
|
||||
STATIC UINT64 mTimerPeriod = 0;
|
||||
|
||||
/* disables watchdog interaction after Exit Boot Services */
|
||||
STATIC BOOLEAN mExitedBootServices = FALSE;
|
||||
|
||||
#define MAX_UINT48 0xFFFFFFFFFFFFULL
|
||||
|
||||
STATIC EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;
|
||||
STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify;
|
||||
STATIC EFI_EVENT mEfiExitBootServicesEvent;
|
||||
|
||||
/**
|
||||
This function returns the maximum watchdog offset register value.
|
||||
|
||||
@retval MAX_UINT32 The watchdog offset register holds a 32-bit value.
|
||||
@retval MAX_UINT48 The watchdog offset register holds a 48-bit value.
|
||||
**/
|
||||
STATIC
|
||||
UINT64
|
||||
GetMaxWatchdogOffsetRegisterValue (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT64 MaxWatchdogOffsetValue;
|
||||
UINT32 WatchdogIId;
|
||||
UINT8 WatchdogArchRevision;
|
||||
|
||||
WatchdogIId = MmioRead32 (GENERIC_WDOG_IID_REG);
|
||||
WatchdogArchRevision = (WatchdogIId >> GENERIC_WDOG_IID_ARCH_REV_SHIFT) & GENERIC_WDOG_IID_ARCH_REV_MASK;
|
||||
|
||||
if (WatchdogArchRevision == 0) {
|
||||
MaxWatchdogOffsetValue = MAX_UINT32;
|
||||
} else {
|
||||
MaxWatchdogOffsetValue = MAX_UINT48;
|
||||
}
|
||||
|
||||
return MaxWatchdogOffsetValue;
|
||||
}
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
WatchdogWriteOffsetRegister (
|
||||
UINT32 Value
|
||||
UINT64 Value
|
||||
)
|
||||
{
|
||||
MmioWrite32 (GENERIC_WDOG_OFFSET_REG, Value);
|
||||
MmioWrite32 (GENERIC_WDOG_OFFSET_REG_LOW, Value & MAX_UINT32);
|
||||
if (GetMaxWatchdogOffsetRegisterValue () == MAX_UINT48) {
|
||||
MmioWrite32 (GENERIC_WDOG_OFFSET_REG_HIGH, (Value >> 32) & MAX_UINT16);
|
||||
}
|
||||
}
|
||||
|
||||
STATIC
|
||||
@@ -87,7 +122,8 @@ WatchdogExitBootServicesEvent (
|
||||
)
|
||||
{
|
||||
WatchdogDisable ();
|
||||
mNumTimerTicks = 0;
|
||||
mTimerPeriod = 0;
|
||||
mExitedBootServices = TRUE;
|
||||
}
|
||||
|
||||
/* This function is called when the watchdog's first signal (WS0) goes high.
|
||||
@@ -102,7 +138,6 @@ WatchdogInterruptHandler (
|
||||
)
|
||||
{
|
||||
STATIC CONST CHAR16 ResetString[] = L"The generic watchdog timer ran out.";
|
||||
UINT64 TimerPeriod;
|
||||
|
||||
WatchdogDisable ();
|
||||
|
||||
@@ -115,8 +150,7 @@ WatchdogInterruptHandler (
|
||||
// the timer period plus 1.
|
||||
//
|
||||
if (mWatchdogNotify != NULL) {
|
||||
TimerPeriod = ((TIME_UNITS_PER_SECOND / mTimerFrequencyHz) * mNumTimerTicks);
|
||||
mWatchdogNotify (TimerPeriod + 1);
|
||||
mWatchdogNotify (mTimerPeriod + 1);
|
||||
}
|
||||
|
||||
gRT->ResetSystem (
|
||||
@@ -186,6 +220,8 @@ WatchdogRegisterHandler (
|
||||
|
||||
@retval EFI_SUCCESS The watchdog timer has been programmed to fire
|
||||
in TimerPeriod 100ns units.
|
||||
@retval EFI_DEVICE_ERROR Boot Services has been exited but TimerPeriod
|
||||
is not zero.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
@@ -196,32 +232,47 @@ WatchdogSetTimerPeriod (
|
||||
IN UINT64 TimerPeriod // In 100ns units
|
||||
)
|
||||
{
|
||||
UINTN SystemCount;
|
||||
UINTN SystemCount;
|
||||
UINT64 MaxWatchdogOffsetValue;
|
||||
UINT64 TimerFrequencyHz;
|
||||
UINT64 NumTimerTicks;
|
||||
|
||||
// if TimerPeriod is 0, this is a request to stop the watchdog.
|
||||
// If we've exited Boot Services but TimerPeriod isn't zero, this
|
||||
// indicates that the caller is doing something wrong.
|
||||
if (mExitedBootServices && (TimerPeriod != 0)) {
|
||||
mTimerPeriod = 0;
|
||||
WatchdogDisable ();
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
// If TimerPeriod is 0 this is a request to stop the watchdog.
|
||||
if (TimerPeriod == 0) {
|
||||
mNumTimerTicks = 0;
|
||||
mTimerPeriod = 0;
|
||||
WatchdogDisable ();
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
// Work out how many timer ticks will equate to TimerPeriod
|
||||
mNumTimerTicks = (mTimerFrequencyHz * TimerPeriod) / TIME_UNITS_PER_SECOND;
|
||||
TimerFrequencyHz = ArmGenericTimerGetTimerFreq ();
|
||||
ASSERT (TimerFrequencyHz != 0);
|
||||
mTimerPeriod = TimerPeriod;
|
||||
NumTimerTicks = (TimerFrequencyHz * TimerPeriod) / TIME_UNITS_PER_SECOND;
|
||||
|
||||
/* If the number of required ticks is greater than the max the watchdog's
|
||||
offset register (WOR) can hold, we need to manually compute and set
|
||||
the compare register (WCV) */
|
||||
if (mNumTimerTicks > MAX_UINT32) {
|
||||
MaxWatchdogOffsetValue = GetMaxWatchdogOffsetRegisterValue ();
|
||||
if (NumTimerTicks > MaxWatchdogOffsetValue) {
|
||||
/* We need to enable the watchdog *before* writing to the compare register,
|
||||
because enabling the watchdog causes an "explicit refresh", which
|
||||
clobbers the compare register (WCV). In order to make sure this doesn't
|
||||
trigger an interrupt, set the offset to max. */
|
||||
WatchdogWriteOffsetRegister (MAX_UINT32);
|
||||
WatchdogWriteOffsetRegister (MaxWatchdogOffsetValue);
|
||||
WatchdogEnable ();
|
||||
SystemCount = ArmGenericTimerGetSystemCount ();
|
||||
WatchdogWriteCompareRegister (SystemCount + mNumTimerTicks);
|
||||
WatchdogWriteCompareRegister (SystemCount + NumTimerTicks);
|
||||
} else {
|
||||
WatchdogWriteOffsetRegister ((UINT32)mNumTimerTicks);
|
||||
WatchdogWriteOffsetRegister (NumTimerTicks);
|
||||
WatchdogEnable ();
|
||||
}
|
||||
|
||||
@@ -256,7 +307,7 @@ WatchdogGetTimerPeriod (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*TimerPeriod = ((TIME_UNITS_PER_SECOND / mTimerFrequencyHz) * mNumTimerTicks);
|
||||
*TimerPeriod = mTimerPeriod;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -299,8 +350,6 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {
|
||||
WatchdogGetTimerPeriod
|
||||
};
|
||||
|
||||
STATIC EFI_EVENT mEfiExitBootServicesEvent;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GenericWatchdogEntry (
|
||||
@@ -323,9 +372,6 @@ GenericWatchdogEntry (
|
||||
This will avoid conflicts with the universal watchdog */
|
||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiWatchdogTimerArchProtocolGuid);
|
||||
|
||||
mTimerFrequencyHz = ArmGenericTimerGetTimerFreq ();
|
||||
ASSERT (mTimerFrequencyHz != 0);
|
||||
|
||||
// Install interrupt handler
|
||||
Status = mInterruptProtocol->RegisterInterruptSource (
|
||||
mInterruptProtocol,
|
||||
@@ -367,7 +413,6 @@ GenericWatchdogEntry (
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
mNumTimerTicks = 0;
|
||||
WatchdogDisable ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
221
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.c
Normal file
221
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.c
Normal file
@@ -0,0 +1,221 @@
|
||||
/** @file -- MmCommunicationPei.c
|
||||
Provides an interface to send MM request in PEI
|
||||
|
||||
Copyright (c) 2016-2021, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) Microsoft Corporation.
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
#include <IndustryStandard/ArmStdSmc.h>
|
||||
|
||||
#include <Protocol/MmCommunication.h>
|
||||
#include <Ppi/MmCommunication.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/ArmSmcLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/PeimEntryPoint.h>
|
||||
#include <Library/PeiServicesLib.h>
|
||||
|
||||
/**
|
||||
MmCommunicationPeim
|
||||
Communicates with a registered handler.
|
||||
This function provides a service to send and receive messages from a registered UEFI service during PEI.
|
||||
|
||||
@param[in] This The EFI_PEI_MM_COMMUNICATION_PPI instance.
|
||||
@param[in, out] CommBuffer Pointer to the data buffer
|
||||
@param[in, out] CommSize The size of the data buffer being passed in. On exit, the
|
||||
size of data being returned. Zero if the handler does not
|
||||
wish to reply with any data.
|
||||
|
||||
@retval EFI_SUCCESS The message was successfully posted.
|
||||
@retval EFI_INVALID_PARAMETER CommBuffer or CommSize was NULL, or *CommSize does not
|
||||
match MessageLength + sizeof (EFI_MM_COMMUNICATE_HEADER).
|
||||
@retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation.
|
||||
If this error is returned, the MessageLength field
|
||||
in the CommBuffer header or the integer pointed by
|
||||
CommSize, are updated to reflect the maximum payload
|
||||
size the implementation can accommodate.
|
||||
@retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter,
|
||||
if not omitted, are in address range that cannot be
|
||||
accessed by the MM environment.
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MmCommunicationPeim (
|
||||
IN CONST EFI_PEI_MM_COMMUNICATION_PPI *This,
|
||||
IN OUT VOID *CommBuffer,
|
||||
IN OUT UINTN *CommSize
|
||||
)
|
||||
{
|
||||
EFI_MM_COMMUNICATE_HEADER *CommunicateHeader;
|
||||
EFI_MM_COMMUNICATE_HEADER *TempCommHeader;
|
||||
ARM_SMC_ARGS CommunicateSmcArgs;
|
||||
EFI_STATUS Status;
|
||||
UINTN BufferSize;
|
||||
|
||||
ZeroMem (&CommunicateSmcArgs, sizeof (ARM_SMC_ARGS));
|
||||
|
||||
// Check that our static buffer is looking good.
|
||||
// We are using PcdMmBufferBase to transfer variable data.
|
||||
// We are not using the full size of the buffer since there is a cost
|
||||
// of copying data between Normal and Secure World.
|
||||
if ((PcdGet64 (PcdMmBufferBase) == 0) || (PcdGet64 (PcdMmBufferSize) == 0)) {
|
||||
ASSERT (PcdGet64 (PcdMmBufferSize) > 0);
|
||||
ASSERT (PcdGet64 (PcdMmBufferBase) != 0);
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Check parameters
|
||||
//
|
||||
if ((CommBuffer == NULL) || (CommSize == NULL)) {
|
||||
ASSERT (CommBuffer != NULL);
|
||||
ASSERT (CommSize != NULL);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// If the length of the CommBuffer is 0 then return the expected length.
|
||||
// This case can be used by the consumer of this driver to find out the
|
||||
// max size that can be used for allocating CommBuffer.
|
||||
if ((*CommSize == 0) || (*CommSize > (UINTN)PcdGet64 (PcdMmBufferSize))) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a Invalid CommSize value 0x%llx!\n",
|
||||
__func__,
|
||||
*CommSize
|
||||
));
|
||||
*CommSize = (UINTN)PcdGet64 (PcdMmBufferSize);
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
// Given CommBuffer is not NULL here, we use it to test the legitimacy of CommSize.
|
||||
TempCommHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)CommBuffer;
|
||||
|
||||
// CommBuffer is a mandatory parameter. Hence, Rely on
|
||||
// MessageLength + Header to ascertain the
|
||||
// total size of the communication payload rather than
|
||||
// rely on optional CommSize parameter
|
||||
BufferSize = TempCommHeader->MessageLength +
|
||||
sizeof (TempCommHeader->HeaderGuid) +
|
||||
sizeof (TempCommHeader->MessageLength);
|
||||
|
||||
//
|
||||
// If CommSize is supplied it must match MessageLength + sizeof (EFI_MM_COMMUNICATE_HEADER);
|
||||
//
|
||||
if (*CommSize != BufferSize) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a Unexpected CommSize value, has: 0x%llx vs. expected: 0x%llx!\n",
|
||||
__func__,
|
||||
*CommSize,
|
||||
BufferSize
|
||||
));
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Now we know that the size is something we can handle, copy it over to the designated comm buffer.
|
||||
CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)(PcdGet64 (PcdMmBufferBase));
|
||||
|
||||
CopyMem (CommunicateHeader, CommBuffer, *CommSize);
|
||||
|
||||
// SMC Function ID
|
||||
CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE_AARCH64;
|
||||
|
||||
// Cookie
|
||||
CommunicateSmcArgs.Arg1 = 0;
|
||||
|
||||
// comm_buffer_address (64-bit physical address)
|
||||
CommunicateSmcArgs.Arg2 = (UINTN)CommunicateHeader;
|
||||
|
||||
// comm_size_address (not used, indicated by setting to zero)
|
||||
CommunicateSmcArgs.Arg3 = 0;
|
||||
|
||||
// Call the Standalone MM environment.
|
||||
ArmCallSmc (&CommunicateSmcArgs);
|
||||
|
||||
switch (CommunicateSmcArgs.Arg0) {
|
||||
case ARM_SMC_MM_RET_SUCCESS:
|
||||
// On successful return, the size of data being returned is inferred from
|
||||
// MessageLength + Header.
|
||||
BufferSize = CommunicateHeader->MessageLength +
|
||||
sizeof (CommunicateHeader->HeaderGuid) +
|
||||
sizeof (CommunicateHeader->MessageLength);
|
||||
if (BufferSize > (UINTN)PcdGet64 (PcdMmBufferSize)) {
|
||||
// Something bad has happened, we should have landed in ARM_SMC_MM_RET_NO_MEMORY
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a Returned buffer exceeds communication buffer limit. Has: 0x%llx vs. max: 0x%llx!\n",
|
||||
__func__,
|
||||
BufferSize,
|
||||
(UINTN)PcdGet64 (PcdMmBufferSize)
|
||||
));
|
||||
Status = EFI_BAD_BUFFER_SIZE;
|
||||
break;
|
||||
}
|
||||
|
||||
CopyMem (CommBuffer, CommunicateHeader, BufferSize);
|
||||
*CommSize = BufferSize;
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
|
||||
case ARM_SMC_MM_RET_INVALID_PARAMS:
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
|
||||
case ARM_SMC_MM_RET_DENIED:
|
||||
Status = EFI_ACCESS_DENIED;
|
||||
break;
|
||||
|
||||
case ARM_SMC_MM_RET_NO_MEMORY:
|
||||
// Unexpected error since the CommSize was checked for zero length
|
||||
// prior to issuing the SMC
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
ASSERT (0);
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = EFI_ACCESS_DENIED;
|
||||
ASSERT (0);
|
||||
break;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Module globals for the MM Communication PPI
|
||||
//
|
||||
STATIC CONST EFI_PEI_MM_COMMUNICATION_PPI mPeiMmCommunication = {
|
||||
MmCommunicationPeim
|
||||
};
|
||||
|
||||
STATIC CONST EFI_PEI_PPI_DESCRIPTOR mPeiMmCommunicationPpi = {
|
||||
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||
&gEfiPeiMmCommunicationPpiGuid,
|
||||
(VOID *)&mPeiMmCommunication
|
||||
};
|
||||
|
||||
/**
|
||||
Entry point of PEI MM Communication driver
|
||||
|
||||
@param FileHandle Handle of the file being invoked.
|
||||
Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextFile().
|
||||
@param PeiServices General purpose services available to every PEIM.
|
||||
|
||||
@retval EFI_SUCCESS If the interface could be successfully installed
|
||||
@retval Others Returned from PeiServicesInstallPpi()
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MmCommunicationPeiInitialize (
|
||||
IN EFI_PEI_FILE_HANDLE FileHandle,
|
||||
IN CONST EFI_PEI_SERVICES **PeiServices
|
||||
)
|
||||
{
|
||||
return PeiServicesInstallPpi (&mPeiMmCommunicationPpi);
|
||||
}
|
40
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf
Normal file
40
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf
Normal file
@@ -0,0 +1,40 @@
|
||||
## @file -- MmCommunicationPei.inf
|
||||
# PEI MM Communicate driver
|
||||
#
|
||||
# Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x0001001B
|
||||
BASE_NAME = MmCommunicationPei
|
||||
FILE_GUID = 58FFB346-1B75-42C7-AD69-37C652423C1A
|
||||
MODULE_TYPE = PEIM
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = MmCommunicationPeiInitialize
|
||||
|
||||
[Sources]
|
||||
MmCommunicationPei.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
ArmSmcLib
|
||||
PeimEntryPoint
|
||||
PeiServicesLib
|
||||
HobLib
|
||||
|
||||
[Pcd]
|
||||
gArmTokenSpaceGuid.PcdMmBufferBase
|
||||
gArmTokenSpaceGuid.PcdMmBufferSize
|
||||
|
||||
[Ppis]
|
||||
gEfiPeiMmCommunicationPpiGuid ## PRODUCES
|
||||
|
||||
[Depex]
|
||||
TRUE
|
@@ -574,7 +574,7 @@ ExtendFile (
|
||||
}
|
||||
|
||||
Remaining = Size;
|
||||
SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
|
||||
ZeroMem (WriteBuffer, sizeof (WriteBuffer));
|
||||
while (Remaining > 0) {
|
||||
WriteNb = MIN (Remaining, sizeof (WriteBuffer));
|
||||
WriteSize = WriteNb;
|
||||
|
@@ -38,10 +38,22 @@
|
||||
.global Name ; \
|
||||
.section #Section, "ax" ; \
|
||||
.type Name, %function ; \
|
||||
Name:
|
||||
Name: ; \
|
||||
AARCH64_BTI(c)
|
||||
|
||||
#define _ASM_FUNC_ALIGN(Name, Section, Align) \
|
||||
.global Name ; \
|
||||
.section #Section, "ax" ; \
|
||||
.type Name, %function ; \
|
||||
.balign Align ; \
|
||||
Name: ; \
|
||||
AARCH64_BTI(c)
|
||||
|
||||
#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
|
||||
|
||||
#define ASM_FUNC_ALIGN(Name, Align) \
|
||||
_ASM_FUNC_ALIGN(ASM_PFX(Name), .text. ## Name, Align)
|
||||
|
||||
#define MOV32(Reg, Val) \
|
||||
movz Reg, (Val) >> 16, lsl #16 ; \
|
||||
movk Reg, (Val) & 0xffff
|
||||
|
@@ -24,10 +24,17 @@
|
||||
// Coprocessor Trap Register (CPTR)
|
||||
#define AARCH64_CPTR_TFP (1 << 10)
|
||||
|
||||
// ID_AA64MMFR1 - AArch64 Memory Model Feature Register 0 definitions
|
||||
#define AARCH64_MMFR1_VH (0xF << 8)
|
||||
|
||||
// ID_AA64PFR0 - AArch64 Processor Feature Register 0 definitions
|
||||
#define AARCH64_PFR0_FP (0xF << 16)
|
||||
#define AARCH64_PFR0_GIC (0xF << 24)
|
||||
|
||||
// ID_AA64DFR0 - AArch64 Debug Feature Register 0 definitions
|
||||
#define AARCH64_DFR0_TRACEVER (0xFULL << 4)
|
||||
#define AARCH64_DFR0_TRBE (0xFULL << 44)
|
||||
|
||||
// SCR - Secure Configuration Register definitions
|
||||
#define SCR_NS (1 << 0)
|
||||
#define SCR_IRQ (1 << 1)
|
||||
@@ -112,6 +119,10 @@
|
||||
#define ARM_VECTOR_LOW_A32_FIQ 0x700
|
||||
#define ARM_VECTOR_LOW_A32_SERR 0x780
|
||||
|
||||
// The ID_AA64ISAR2_EL1 register is not recognized by older
|
||||
// assemblers, we need to define it here.
|
||||
#define ID_AA64ISAR2_EL1 S3_0_C0_C6_2
|
||||
|
||||
// The ID_AA64MMFR2_EL1 register was added in ARMv8.2. Since we
|
||||
// build for ARMv8.0, we need to define the register here.
|
||||
#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2
|
||||
|
@@ -1,44 +0,0 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2012 - 2021, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef ARM_CORTEX_A5X_H_
|
||||
#define ARM_CORTEX_A5X_H_
|
||||
|
||||
//
|
||||
// Cortex A5x feature bit definitions
|
||||
//
|
||||
#define A5X_FEATURE_SMP (1 << 6)
|
||||
|
||||
//
|
||||
// Helper functions to access CPU Extended Control Register
|
||||
//
|
||||
UINT64
|
||||
EFIAPI
|
||||
ArmReadCpuExCr (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmWriteCpuExCr (
|
||||
IN UINT64 Val
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmSetCpuExCrBit (
|
||||
IN UINT64 Bits
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmUnsetCpuExCrBit (
|
||||
IN UINT64 Bits
|
||||
);
|
||||
|
||||
#endif // ARM_CORTEX_A5X_H_
|
@@ -1,57 +0,0 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef ARM_CORTEX_A9_H_
|
||||
#define ARM_CORTEX_A9_H_
|
||||
|
||||
#include <Chipset/ArmV7.h>
|
||||
|
||||
//
|
||||
// Cortex A9 feature bit definitions
|
||||
//
|
||||
#define A9_FEATURE_PARITY (1<<9)
|
||||
#define A9_FEATURE_AOW (1<<8)
|
||||
#define A9_FEATURE_EXCL (1<<7)
|
||||
#define A9_FEATURE_SMP (1<<6)
|
||||
#define A9_FEATURE_FOZ (1<<3)
|
||||
#define A9_FEATURE_DPREF (1<<2)
|
||||
#define A9_FEATURE_HINT (1<<1)
|
||||
#define A9_FEATURE_FWD (1<<0)
|
||||
|
||||
//
|
||||
// Cortex A9 Watchdog
|
||||
//
|
||||
#define ARM_A9_WATCHDOG_REGION 0x600
|
||||
|
||||
#define ARM_A9_WATCHDOG_LOAD_REGISTER 0x20
|
||||
#define ARM_A9_WATCHDOG_CONTROL_REGISTER 0x28
|
||||
|
||||
#define ARM_A9_WATCHDOG_WATCHDOG_MODE (1 << 3)
|
||||
#define ARM_A9_WATCHDOG_TIMER_MODE (0 << 3)
|
||||
#define ARM_A9_WATCHDOG_SINGLE_SHOT (0 << 1)
|
||||
#define ARM_A9_WATCHDOG_AUTORELOAD (1 << 1)
|
||||
#define ARM_A9_WATCHDOG_ENABLE 1
|
||||
|
||||
//
|
||||
// SCU register offsets & masks
|
||||
//
|
||||
#define A9_SCU_CONTROL_OFFSET 0x0
|
||||
#define A9_SCU_CONFIG_OFFSET 0x4
|
||||
#define A9_SCU_INVALL_OFFSET 0xC
|
||||
#define A9_SCU_FILT_START_OFFSET 0x40
|
||||
#define A9_SCU_FILT_END_OFFSET 0x44
|
||||
#define A9_SCU_SACR_OFFSET 0x50
|
||||
#define A9_SCU_SSACR_OFFSET 0x54
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGetScuBaseAddress (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // ARM_CORTEX_A9_H_
|
@@ -54,11 +54,9 @@
|
||||
#define TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(Desc) (((Desc) & 3UL) == TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE)
|
||||
|
||||
// Translation table descriptor types
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_MASK (3UL << 0)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 0)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (2UL << 0)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE_XN (3UL << 0)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE (1UL << 0)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_MASK (1UL << 1)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 1)
|
||||
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (1UL << 1)
|
||||
|
||||
// Section descriptor definitions
|
||||
#define TT_DESCRIPTOR_SECTION_SIZE (0x00100000)
|
||||
@@ -82,25 +80,24 @@
|
||||
#define TT_DESCRIPTOR_PAGE_S_NOT_SHARED (0UL << 10)
|
||||
#define TT_DESCRIPTOR_PAGE_S_SHARED (1UL << 10)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_AP_MASK ((1UL << 15) | (3UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_NO_NO ((0UL << 15) | (0UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RW_NO ((0UL << 15) | (1UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RW_RO ((0UL << 15) | (2UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RW_RW ((0UL << 15) | (3UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RO_NO ((1UL << 15) | (1UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RO_RO ((1UL << 15) | (3UL << 10))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_MASK ((1UL << 15) | (1UL << 11))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_NO_RW ((0UL << 15) | (0UL << 11))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RW_RW ((0UL << 15) | (1UL << 11))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_NO_RO ((1UL << 15) | (0UL << 11))
|
||||
#define TT_DESCRIPTOR_SECTION_AP_RO_RO ((1UL << 15) | (1UL << 11))
|
||||
|
||||
#define TT_DESCRIPTOR_PAGE_AP_MASK ((1UL << 9) | (3UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_NO_NO ((0UL << 9) | (0UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RW_NO ((0UL << 9) | (1UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RW_RO ((0UL << 9) | (2UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RW_RW ((0UL << 9) | (3UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RO_NO ((1UL << 9) | (1UL << 4))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RO_RO ((1UL << 9) | (3UL << 4))
|
||||
#define TT_DESCRIPTOR_SECTION_AF (1UL << 10)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_XN_MASK (0x1UL << 4)
|
||||
#define TT_DESCRIPTOR_PAGE_XN_MASK (0x1UL << 0)
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_XN_MASK (0x1UL << 15)
|
||||
#define TT_DESCRIPTOR_PAGE_AP_MASK ((1UL << 9) | (1UL << 5))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_NO_RW ((0UL << 9) | (0UL << 5))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RW_RW ((0UL << 9) | (1UL << 5))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_NO_RO ((1UL << 9) | (0UL << 5))
|
||||
#define TT_DESCRIPTOR_PAGE_AP_RO_RO ((1UL << 9) | (1UL << 5))
|
||||
|
||||
#define TT_DESCRIPTOR_PAGE_AF (1UL << 4)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_XN_MASK (0x1UL << 4)
|
||||
#define TT_DESCRIPTOR_PAGE_XN_MASK (0x1UL << 0)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK ((3UL << 12) | (1UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_SECTION_CACHEABLE_MASK (1UL << 3)
|
||||
@@ -124,37 +121,27 @@
|
||||
#define TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_BACK_ALLOC ((1UL << 6) | (1UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_SHAREABLE_DEVICE ((2UL << 6) | (0UL << 3) | (0UL << 2))
|
||||
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_MASK ((3UL << 12) | (1UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_STRONGLY_ORDERED ((0UL << 12) | (0UL << 3) | (0UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_SHAREABLE_DEVICE ((0UL << 12) | (0UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC ((0UL << 12) | (1UL << 3) | (0UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_WRITE_BACK_NO_ALLOC ((0UL << 12) | (1UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_NON_CACHEABLE ((1UL << 12) | (0UL << 3) | (0UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_WRITE_BACK_ALLOC ((1UL << 12) | (1UL << 3) | (1UL << 2))
|
||||
#define TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_NON_SHAREABLE_DEVICE ((2UL << 12) | (0UL << 3) | (0UL << 2))
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_AP(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_AP_MASK) >> 6) & TT_DESCRIPTOR_PAGE_AP_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_NG(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_NG_MASK) >> 6) & TT_DESCRIPTOR_PAGE_NG_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_S(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_S_MASK) >> 6) & TT_DESCRIPTOR_PAGE_S_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_AF(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_AF) >> 6) & TT_DESCRIPTOR_PAGE_AF)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_XN(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_XN_MASK) >> 4) & TT_DESCRIPTOR_PAGE_XN_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY(Desc) ((((Desc) & (0x3 << 12)) >> 6) | (Desc & (0x3 << 2)))
|
||||
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_AP(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_AP_MASK) >> 6) & TT_DESCRIPTOR_PAGE_AP_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_NG(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_NG_MASK) >> 6) & TT_DESCRIPTOR_PAGE_NG_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_S(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_S_MASK) >> 6) & TT_DESCRIPTOR_PAGE_S_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_XN(Desc, IsLargePage) ((IsLargePage)?\
|
||||
((((Desc) & TT_DESCRIPTOR_SECTION_XN_MASK) << 11) & TT_DESCRIPTOR_LARGEPAGE_XN_MASK): \
|
||||
((((Desc) & TT_DESCRIPTOR_SECTION_XN_MASK) >> 4) & TT_DESCRIPTOR_PAGE_XN_MASK))
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY(Desc, IsLargePage) (IsLargePage? \
|
||||
(((Desc) & TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK) & TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_MASK): \
|
||||
(((((Desc) & (0x3 << 12)) >> 6) | (Desc & (0x3 << 2)))))
|
||||
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_AP(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_AP_MASK) << 6) & TT_DESCRIPTOR_SECTION_AP_MASK)
|
||||
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY(Desc, IsLargePage) (IsLargePage? \
|
||||
(((Desc) & TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_MASK) & TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK): \
|
||||
(((((Desc) & (0x3 << 6)) << 6) | (Desc & (0x3 << 2)))))
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_AP(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_AP_MASK) << 6) & TT_DESCRIPTOR_SECTION_AP_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_S(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_S_MASK) << 6) & TT_DESCRIPTOR_SECTION_S_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_AF(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_AF) << 6) & TT_DESCRIPTOR_SECTION_AF)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_XN(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_XN_MASK) << 4) & TT_DESCRIPTOR_SECTION_XN_MASK)
|
||||
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_CACHE_POLICY(Desc) ((((Desc) & (0x3 << 6)) << 6) | (Desc & (0x3 << 2)))
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_ATTRIBUTE_MASK (TT_DESCRIPTOR_SECTION_NS_MASK | TT_DESCRIPTOR_SECTION_NG_MASK | \
|
||||
TT_DESCRIPTOR_SECTION_S_MASK | TT_DESCRIPTOR_SECTION_AP_MASK | \
|
||||
TT_DESCRIPTOR_SECTION_AF | \
|
||||
TT_DESCRIPTOR_SECTION_XN_MASK | TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK)
|
||||
|
||||
#define TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK (TT_DESCRIPTOR_PAGE_NG_MASK | TT_DESCRIPTOR_PAGE_S_MASK | \
|
||||
TT_DESCRIPTOR_PAGE_AP_MASK | TT_DESCRIPTOR_PAGE_XN_MASK | \
|
||||
TT_DESCRIPTOR_PAGE_AF | \
|
||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_DOMAIN_MASK (0x0FUL << 5)
|
||||
@@ -170,56 +157,49 @@
|
||||
#define TT_DESCRIPTOR_PAGE_BASE_ADDRESS(a) ((a) & TT_DESCRIPTOR_PAGE_BASE_ADDRESS_MASK)
|
||||
#define TT_DESCRIPTOR_PAGE_BASE_SHIFT 12
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_WRITE_BACK(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_SECTION_S_SHARED | \
|
||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK_ALLOC)
|
||||
#define TT_DESCRIPTOR_SECTION_WRITE_THROUGH(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_SECTION_S_SHARED | \
|
||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)
|
||||
#define TT_DESCRIPTOR_SECTION_DEVICE(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_SECTION_S_NOT_SHARED | \
|
||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_SECTION_XN_MASK | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_SHAREABLE_DEVICE)
|
||||
#define TT_DESCRIPTOR_SECTION_UNCACHED(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_SECTION_S_NOT_SHARED | \
|
||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE)
|
||||
#define TT_DESCRIPTOR_SECTION_DEFAULT (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_SECTION_S_SHARED | \
|
||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_SECTION_AF)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_WRITE_BACK (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK_ALLOC)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_WRITE_THROUGH (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_DEVICE (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_SHAREABLE_DEVICE)
|
||||
|
||||
#define TT_DESCRIPTOR_SECTION_UNCACHED (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||
TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE)
|
||||
|
||||
#define TT_DESCRIPTOR_PAGE_WRITE_BACK (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_PAGE_AF | \
|
||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_BACK_ALLOC)
|
||||
#define TT_DESCRIPTOR_PAGE_WRITE_THROUGH (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_PAGE_AF | \
|
||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)
|
||||
#define TT_DESCRIPTOR_PAGE_DEVICE (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_PAGE_AF | \
|
||||
TT_DESCRIPTOR_PAGE_XN_MASK | \
|
||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_SHAREABLE_DEVICE)
|
||||
#define TT_DESCRIPTOR_PAGE_UNCACHED (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||
TT_DESCRIPTOR_PAGE_AF | \
|
||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_CACHEABLE)
|
||||
|
||||
// First Level Descriptors
|
||||
@@ -230,8 +210,7 @@ typedef UINT32 ARM_PAGE_TABLE_ENTRY;
|
||||
|
||||
UINT32
|
||||
ConvertSectionAttributesToPageAttributes (
|
||||
IN UINT32 SectionAttributes,
|
||||
IN BOOLEAN IsLargePage
|
||||
IN UINT32 SectionAttributes
|
||||
);
|
||||
|
||||
#endif // ARMV7_MMU_H_
|
||||
|
@@ -244,4 +244,13 @@
|
||||
#define TRNG_STATUS_INVALID_PARAMETER (INT32)(-2)
|
||||
#define TRNG_STATUS_NO_ENTROPY (INT32)(-3)
|
||||
|
||||
/*
|
||||
* SMC64 SiP Service Calls
|
||||
*/
|
||||
|
||||
#define SMC_FASTCALL 0x80000000
|
||||
#define SMC64_FUNCTION (SMC_FASTCALL | 0x40000000)
|
||||
#define SMC_SIP_FUNCTION (SMC64_FUNCTION | 0x02000000)
|
||||
#define SMC_SIP_FUNCTION_ID(n) (SMC_SIP_FUNCTION | (n))
|
||||
|
||||
#endif // ARM_STD_SMC_H_
|
||||
|
@@ -1,9 +1,15 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2015, Linaro Ltd. All rights reserved.
|
||||
* Copyright (c) 2024, Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
* @par Reference(s):
|
||||
* - Arm Generic Interrupt Controller Architecture Specification,
|
||||
* Issue H, January 2022.
|
||||
* (https://developer.arm.com/documentation/ihi0069/)
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ARM_GIC_ARCH_LIB_H_
|
||||
@@ -23,4 +29,12 @@ ArmGicGetSupportedArchRevision (
|
||||
VOID
|
||||
);
|
||||
|
||||
//
|
||||
// GIC SPI and extended SPI ranges
|
||||
//
|
||||
#define ARM_GIC_ARCH_SPI_MIN 32
|
||||
#define ARM_GIC_ARCH_SPI_MAX 1019
|
||||
#define ARM_GIC_ARCH_EXT_SPI_MIN 4096
|
||||
#define ARM_GIC_ARCH_EXT_SPI_MAX 5119
|
||||
|
||||
#endif // ARM_GIC_ARCH_LIB_H_
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011-2021, Arm Limited. All rights reserved.<BR>
|
||||
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.<BR>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
*
|
||||
@@ -110,10 +110,10 @@
|
||||
// Bit Mask for
|
||||
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
||||
|
||||
UINTN
|
||||
UINT32
|
||||
EFIAPI
|
||||
ArmGicGetInterfaceIdentification (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
// GIC Secure interfaces
|
||||
@@ -121,8 +121,8 @@ VOID
|
||||
EFIAPI
|
||||
ArmGicSetupNonSecure (
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -136,40 +136,40 @@ ArmGicSetSecureInterrupts (
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicEnableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicDisableDistributor (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicGetMaxNumInterrupts (
|
||||
IN INTN GicDistributorBase
|
||||
IN UINTN GicDistributorBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicSendSgiTo (
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN TargetListFilter,
|
||||
IN INTN CPUTargetList,
|
||||
IN INTN SgiId
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINT8 TargetListFilter,
|
||||
IN UINT8 CPUTargetList,
|
||||
IN UINT8 SgiId
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -203,8 +203,8 @@ ArmGicEndOfInterrupt (
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmGicSetPriorityMask (
|
||||
IN INTN GicInterruptInterfaceBase,
|
||||
IN INTN PriorityMask
|
||||
IN UINTN GicInterruptInterfaceBase,
|
||||
IN INTN PriorityMask
|
||||
);
|
||||
|
||||
VOID
|
||||
@@ -251,20 +251,20 @@ VOID
|
||||
EFIAPI
|
||||
ArmGicV2SetupNonSecure (
|
||||
IN UINTN MpId,
|
||||
IN INTN GicDistributorBase,
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicDistributorBase,
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2EnableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmGicV2DisableInterruptInterface (
|
||||
IN INTN GicInterruptInterfaceBase
|
||||
IN UINTN GicInterruptInterfaceBase
|
||||
);
|
||||
|
||||
UINTN
|
||||
|
@@ -25,33 +25,26 @@
|
||||
EFI_MEMORY_WT | EFI_MEMORY_WB | \
|
||||
EFI_MEMORY_UCE)
|
||||
|
||||
/**
|
||||
* The UEFI firmware must not use the ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_* attributes.
|
||||
*
|
||||
* The Non Secure memory attribute (ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_*) should only
|
||||
* be used in Secure World to distinguished Secure to Non-Secure memory.
|
||||
*/
|
||||
typedef enum {
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED = 0,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK,
|
||||
|
||||
// On some platforms, memory mapped flash region is designed as not supporting
|
||||
// shareable attribute, so WRITE_BACK_NONSHAREABLE is added for such special
|
||||
// need.
|
||||
// Do NOT use below two attributes if you are not sure.
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE,
|
||||
|
||||
// Special region types for memory that must be mapped with read-only or
|
||||
// non-execute permissions from the very start, e.g., to support the use
|
||||
// of the WXN virtual memory control.
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP,
|
||||
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE,
|
||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE
|
||||
} ARM_MEMORY_REGION_ATTRIBUTES;
|
||||
|
||||
#define IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE(attr) ((UINT32)(attr) & 1)
|
||||
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS PhysicalBase;
|
||||
EFI_VIRTUAL_ADDRESS VirtualBase;
|
||||
@@ -108,14 +101,16 @@ typedef enum {
|
||||
|
||||
#define ARM_CORE_MASK ARM_CORE_AFF0
|
||||
#define ARM_CLUSTER_MASK ARM_CORE_AFF1
|
||||
#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
|
||||
#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
|
||||
#define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId))
|
||||
#define GET_MPIDR_AFF0(MpId) ((MpId) & ARM_CORE_AFF0)
|
||||
#define GET_MPIDR_AFF1(MpId) (((MpId) & ARM_CORE_AFF1) >> 8)
|
||||
#define GET_MPIDR_AFF2(MpId) (((MpId) & ARM_CORE_AFF2) >> 16)
|
||||
#define GET_MPIDR_AFF3(MpId) (((MpId) & ARM_CORE_AFF3) >> 32)
|
||||
#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
|
||||
#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
|
||||
#define GET_MPID(ClusterId, CoreId) (((ClusterId) << 8) | (CoreId))
|
||||
#define GET_MPIDR_AFF0(MpId) ((MpId) & ARM_CORE_AFF0)
|
||||
#define GET_MPIDR_AFF1(MpId) (((MpId) & ARM_CORE_AFF1) >> 8)
|
||||
#define GET_MPIDR_AFF2(MpId) (((MpId) & ARM_CORE_AFF2) >> 16)
|
||||
#define GET_MPIDR_AFF3(MpId) (((MpId) & ARM_CORE_AFF3) >> 32)
|
||||
#define GET_MPIDR_AFFINITY_BITS(MpId) ((MpId) & 0xFF00FFFFFF)
|
||||
#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK)
|
||||
#define MPIDR_MT_BIT BIT24
|
||||
|
||||
/** Reads the CCSIDR register for the specified cache.
|
||||
|
||||
@@ -769,6 +764,49 @@ ArmHasCcidx (
|
||||
VOID
|
||||
);
|
||||
|
||||
#ifdef MDE_CPU_AARCH64
|
||||
///
|
||||
/// AArch64-only ID Register Helper functions
|
||||
///
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Virtualization Host Extensions.
|
||||
|
||||
@retval TRUE FEAT_VHE is implemented.
|
||||
@retval FALSE FEAT_VHE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasVhe (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Trace Buffer Extension.
|
||||
|
||||
@retval TRUE FEAT_TRBE is implemented.
|
||||
@retval FALSE FEAT_TRBE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasTrbe (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Embedded Trace Extension.
|
||||
|
||||
@retval TRUE FEAT_ETE is implemented.
|
||||
@retval FALSE FEAT_ETE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasEte (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // MDE_CPU_AARCH64
|
||||
|
||||
#ifdef MDE_CPU_ARM
|
||||
///
|
||||
/// AArch32-only ID Register Helper functions
|
||||
|
@@ -21,34 +21,6 @@ ArmConfigureMmu (
|
||||
OUT UINTN *TranslationTableSize OPTIONAL
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmSetMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmClearMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmSetMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmClearMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ArmReplaceLiveTranslationEntry (
|
||||
@@ -58,11 +30,45 @@ ArmReplaceLiveTranslationEntry (
|
||||
IN BOOLEAN DisableMmu
|
||||
);
|
||||
|
||||
/**
|
||||
Set the requested memory permission attributes on a region of memory.
|
||||
|
||||
BaseAddress and Length must be aligned to EFI_PAGE_SIZE.
|
||||
|
||||
If Attributes contains a memory type attribute (EFI_MEMORY_UC/WC/WT/WB), the
|
||||
region is mapped according to this memory type, and additional memory
|
||||
permission attributes (EFI_MEMORY_RP/RO/XP) are taken into account as well,
|
||||
discarding any permission attributes that are currently set for the region.
|
||||
AttributeMask is ignored in this case, and must be set to 0x0.
|
||||
|
||||
If Attributes contains only a combination of memory permission attributes
|
||||
(EFI_MEMORY_RP/RO/XP), each page in the region will retain its existing
|
||||
memory type, even if it is not uniformly set across the region. In this case,
|
||||
AttributesMask may be set to a mask of permission attributes, and memory
|
||||
permissions omitted from this mask will not be updated for any page in the
|
||||
region. All attributes appearing in Attributes must appear in AttributeMask
|
||||
as well. (Attributes & ~AttributeMask must produce 0x0)
|
||||
|
||||
@param[in] BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param[in] Length The size in bytes of the memory region.
|
||||
@param[in] Attributes Mask of memory attributes to set.
|
||||
@param[in] AttributeMask Mask of memory attributes to take into account.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER BaseAddress or Length is not suitably aligned.
|
||||
Invalid combination of Attributes and
|
||||
AttributeMask.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ArmSetMemoryAttributes (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
IN UINT64 Attributes,
|
||||
IN UINT64 AttributeMask
|
||||
);
|
||||
|
||||
#endif // ARM_MMU_LIB_H_
|
||||
|
@@ -1,12 +1,12 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2017-2021, Arm Limited. All rights reserved.
|
||||
Copyright (c) 2017-2023, Arm Limited. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
System Control and Management Interface V1.0
|
||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
||||
System Control and Management Interface V3.2, latest version at:
|
||||
- https://developer.arm.com/documentation/den0056/latest/
|
||||
|
||||
**/
|
||||
|
||||
#ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_
|
||||
@@ -14,7 +14,10 @@
|
||||
|
||||
#include <Protocol/ArmScmi.h>
|
||||
|
||||
#define PERFORMANCE_PROTOCOL_VERSION 0x10000
|
||||
/// Arm Scmi performance protocol versions.
|
||||
#define PERFORMANCE_PROTOCOL_VERSION_V1 0x10000
|
||||
#define PERFORMANCE_PROTOCOL_VERSION_V2 0x20000
|
||||
#define PERFORMANCE_PROTOCOL_VERSION_V3 0x30000
|
||||
|
||||
#define ARM_SCMI_PERFORMANCE_PROTOCOL_GUID { \
|
||||
0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad} \
|
||||
@@ -76,8 +79,58 @@ typedef struct {
|
||||
UINT32 RangeMin;
|
||||
} SCMI_PERFORMANCE_LIMITS;
|
||||
|
||||
/// Doorbell Support bit.
|
||||
#define SCMI_PERF_FC_ATTRIB_HAS_DOORBELL BIT0
|
||||
|
||||
/// Performance protocol describe fastchannel
|
||||
typedef struct {
|
||||
/// Attributes.
|
||||
UINT32 Attributes;
|
||||
|
||||
/// Rate limit.
|
||||
UINT32 RateLimit;
|
||||
|
||||
/// Lower 32 bits of the FastChannel address.
|
||||
UINT32 ChanAddrLow;
|
||||
|
||||
/// Higher 32 bits of the FastChannel address.
|
||||
UINT32 ChanAddrHigh;
|
||||
|
||||
/// Size of the FastChannel in bytes.
|
||||
UINT32 ChanSize;
|
||||
|
||||
/// Lower 32 bits of the doorbell address.
|
||||
UINT32 DoorbellAddrLow;
|
||||
|
||||
/// Higher 32 bits of the doorbell address.
|
||||
UINT32 DoorbellAddrHigh;
|
||||
|
||||
/// Mask of lower 32 bits to set when writing to the doorbell register.
|
||||
UINT32 DoorbellSetMaskLow;
|
||||
|
||||
/// Mask of higher 32 bits to set when writing to the doorbell register.
|
||||
UINT32 DoorbellSetMaskHigh;
|
||||
|
||||
/// Mask of lower 32 bits to preserve when writing to the doorbell register.
|
||||
UINT32 DoorbellPreserveMaskLow;
|
||||
|
||||
/// Mask of higher 32 bits to preserve when writing to the doorbell register.
|
||||
UINT32 DoorbellPreserveMaskHigh;
|
||||
} SCMI_PERFORMANCE_FASTCHANNEL;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/// SCMI Message Ids for the Performance Protocol.
|
||||
typedef enum {
|
||||
ScmiMessageIdPerformanceDomainAttributes = 0x3,
|
||||
ScmiMessageIdPerformanceDescribeLevels = 0x4,
|
||||
ScmiMessageIdPerformanceLimitsSet = 0x5,
|
||||
ScmiMessageIdPerformanceLimitsGet = 0x6,
|
||||
ScmiMessageIdPerformanceLevelSet = 0x7,
|
||||
ScmiMessageIdPerformanceLevelGet = 0x8,
|
||||
ScmiMessageIdPerformanceDescribeFastchannel = 0xB,
|
||||
} SCMI_MESSAGE_ID_PERFORMANCE;
|
||||
|
||||
/** Return version of the performance management protocol supported by SCP.
|
||||
firmware.
|
||||
|
||||
@@ -235,6 +288,34 @@ EFI_STATUS
|
||||
OUT UINT32 *Level
|
||||
);
|
||||
|
||||
/** Discover the attributes of the FastChannel for the specified
|
||||
performance domain and the specified message.
|
||||
|
||||
@param[in] This A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance.
|
||||
@param[in] DomainId Identifier for the performance domain.
|
||||
@param[in] MessageId Message Id of the FastChannel to discover.
|
||||
Must be one of:
|
||||
- PERFORMANCE_LIMITS_SET
|
||||
- PERFORMANCE_LIMITS_GET
|
||||
- PERFORMANCE_LEVEL_SET
|
||||
- PERFORMANCE_LEVEL_GET
|
||||
@param[out] FastChannel If success, contains the FastChannel description.
|
||||
|
||||
@retval EFI_SUCCESS Performance level got successfully.
|
||||
@retval EFI_DEVICE_ERROR SCP returns an SCMI error.
|
||||
@retval EFI_INVALID_PARAMETER Invalid parameter.
|
||||
@retval EFI_TIMEOUT Time out.
|
||||
@retval EFI_UNSUPPORTED Unsupported.
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL)(
|
||||
IN SCMI_PERFORMANCE_PROTOCOL *This,
|
||||
IN UINT32 DomainId,
|
||||
IN SCMI_MESSAGE_ID_PERFORMANCE MessageId,
|
||||
OUT SCMI_PERFORMANCE_FASTCHANNEL *FastChannel
|
||||
);
|
||||
|
||||
typedef struct _SCMI_PERFORMANCE_PROTOCOL {
|
||||
SCMI_PERFORMANCE_GET_VERSION GetVersion;
|
||||
SCMI_PERFORMANCE_GET_ATTRIBUTES GetProtocolAttributes;
|
||||
@@ -244,15 +325,7 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL {
|
||||
SCMI_PERFORMANCE_LIMITS_GET LimitsGet;
|
||||
SCMI_PERFORMANCE_LEVEL_SET LevelSet;
|
||||
SCMI_PERFORMANCE_LEVEL_GET LevelGet;
|
||||
SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL DescribeFastchannel;
|
||||
} SCMI_PERFORMANCE_PROTOCOL;
|
||||
|
||||
typedef enum {
|
||||
ScmiMessageIdPerformanceDomainAttributes = 0x3,
|
||||
ScmiMessageIdPerformanceDescribeLevels = 0x4,
|
||||
ScmiMessageIdPerformanceLimitsSet = 0x5,
|
||||
ScmiMessageIdPerformanceLimitsGet = 0x6,
|
||||
ScmiMessageIdPerformanceLevelSet = 0x7,
|
||||
ScmiMessageIdPerformanceLevelGet = 0x8,
|
||||
} SCMI_MESSAGE_ID_PERFORMANCE;
|
||||
|
||||
#endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
|
||||
|
@@ -94,7 +94,6 @@
|
||||
|
||||
GCC_ASM_EXPORT(ExceptionHandlersEnd)
|
||||
GCC_ASM_EXPORT(CommonCExceptionHandler)
|
||||
GCC_ASM_EXPORT(RegisterEl0Stack)
|
||||
|
||||
.text
|
||||
|
||||
@@ -387,6 +386,6 @@ ASM_PFX(CommonExceptionEntry):
|
||||
|
||||
eret
|
||||
|
||||
ASM_PFX(RegisterEl0Stack):
|
||||
ASM_FUNC(RegisterEl0Stack)
|
||||
msr sp_el0, x0
|
||||
ret
|
||||
|
@@ -104,3 +104,49 @@ ArmHasCcidx (
|
||||
Mmfr2 = ArmReadIdAA64Mmfr2 ();
|
||||
return (((Mmfr2 >> 20) & 0xF) == 1) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Virtualization Host Extensions.
|
||||
|
||||
@retval TRUE FEAT_VHE is implemented.
|
||||
@retval FALSE FEAT_VHE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasVhe (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return ((ArmReadIdAA64Mmfr1 () & AARCH64_MMFR1_VH) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Trace Buffer Extension.
|
||||
|
||||
@retval TRUE FEAT_TRBE is implemented.
|
||||
@retval FALSE FEAT_TRBE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasTrbe (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRBE) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether the CPU implements the Embedded Trace Extension.
|
||||
|
||||
@retval TRUE FEAT_ETE is implemented.
|
||||
@retval FALSE FEAT_ETE is not mplemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasEte (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
// The ID_AA64DFR0_EL1.TraceVer field identifies the presence of FEAT_ETE.
|
||||
return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRACEVER) != 0);
|
||||
}
|
||||
|
@@ -40,7 +40,43 @@ ArmCleanInvalidateDataCacheEntryBySetWay (
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Pfr0 (
|
||||
ArmReadIdAA64Dfr0 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Dfr1 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Isar0 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Isar1 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Isar2 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Mmfr0 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Mmfr1 (
|
||||
VOID
|
||||
);
|
||||
|
||||
@@ -54,4 +90,16 @@ ArmReadIdAA64Mmfr2 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Pfr0 (
|
||||
VOID
|
||||
);
|
||||
|
||||
UINTN
|
||||
EFIAPI
|
||||
ArmReadIdAA64Pfr1 (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif // AARCH64_LIB_H_
|
||||
|
@@ -425,10 +425,6 @@ ASM_FUNC(ArmCallWFI)
|
||||
wfi
|
||||
ret
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Mmfr2)
|
||||
mrs x0, ID_AA64MMFR2_EL1 // read EL1 MMFR2
|
||||
ret
|
||||
|
||||
ASM_FUNC(ArmReadMpidr)
|
||||
mrs x0, mpidr_el1 // read EL1 MPIDR
|
||||
ret
|
||||
@@ -452,10 +448,6 @@ ASM_FUNC(ArmIsArchTimerImplemented)
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Pfr0)
|
||||
mrs x0, id_aa64pfr0_el1 // Read ID_AA64PFR0 Register
|
||||
ret
|
||||
|
||||
|
||||
// VOID ArmWriteHcr(UINTN Hcr)
|
||||
ASM_FUNC(ArmWriteHcr)
|
||||
@@ -482,4 +474,54 @@ ASM_FUNC(ArmWriteCntHctl)
|
||||
msr cnthctl_el2, x0
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Dfr0)
|
||||
mrs x0, ID_AA64DFR0_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Dfr1)
|
||||
mrs x0, ID_AA64DFR1_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Isar0)
|
||||
mrs x0, ID_AA64ISAR0_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Isar1)
|
||||
mrs x0, ID_AA64ISAR1_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Isar2)
|
||||
mrs x0, ID_AA64ISAR2_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Mmfr0)
|
||||
mrs x0, ID_AA64MMFR0_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Mmfr1)
|
||||
mrs x0, ID_AA64MMFR1_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Mmfr2)
|
||||
mrs x0, ID_AA64MMFR2_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Pfr0)
|
||||
mrs x0, ID_AA64PFR0_EL1
|
||||
ret
|
||||
|
||||
|
||||
ASM_FUNC(ArmReadIdAA64Pfr1)
|
||||
mrs x0, ID_AA64PFR1_EL1
|
||||
ret
|
||||
|
||||
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
|
||||
|
@@ -16,6 +16,7 @@
|
||||
.set CTRL_C_BIT, (1 << 2)
|
||||
.set CTRL_B_BIT, (1 << 7)
|
||||
.set CTRL_I_BIT, (1 << 12)
|
||||
.set CTRL_AFE_BIT,(1 << 29)
|
||||
|
||||
|
||||
ASM_FUNC(ArmInvalidateDataCacheEntryByMVA)
|
||||
@@ -64,6 +65,7 @@ ASM_FUNC(ArmInvalidateInstructionCache)
|
||||
ASM_FUNC(ArmEnableMmu)
|
||||
mrc p15,0,R0,c1,c0,0
|
||||
orr R0,R0,#1
|
||||
orr R0,R0,#CTRL_AFE_BIT
|
||||
mcr p15,0,R0,c1,c0,0
|
||||
dsb
|
||||
isb
|
||||
|
@@ -20,16 +20,9 @@
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include "ArmMmuLibInternal.h"
|
||||
|
||||
STATIC
|
||||
VOID (
|
||||
EFIAPI *mReplaceLiveEntryFunc
|
||||
)(
|
||||
IN UINT64 *Entry,
|
||||
IN UINT64 Value,
|
||||
IN UINT64 RegionStart,
|
||||
IN BOOLEAN DisableMmu
|
||||
) = ArmReplaceLiveTranslationEntry;
|
||||
STATIC ARM_REPLACE_LIVE_TRANSLATION_ENTRY mReplaceLiveEntryFunc = ArmReplaceLiveTranslationEntry;
|
||||
|
||||
STATIC
|
||||
UINT64
|
||||
@@ -37,33 +30,47 @@ ArmMemoryAttributeToPageAttribute (
|
||||
IN ARM_MEMORY_REGION_ATTRIBUTES Attributes
|
||||
)
|
||||
{
|
||||
UINT64 Permissions;
|
||||
|
||||
switch (Attributes) {
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO:
|
||||
Permissions = TT_AP_NO_RO;
|
||||
break;
|
||||
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||
if (ArmReadCurrentEL () == AARCH64_EL2) {
|
||||
Permissions = TT_XN_MASK;
|
||||
} else {
|
||||
Permissions = TT_UXN_MASK | TT_PXN_MASK;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
Permissions = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (Attributes) {
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE:
|
||||
return TT_ATTR_INDX_MEMORY_WRITE_BACK;
|
||||
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK:
|
||||
return TT_ATTR_INDX_MEMORY_WRITE_BACK | TT_SH_INNER_SHAREABLE;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP:
|
||||
return TT_ATTR_INDX_MEMORY_WRITE_BACK | TT_SH_INNER_SHAREABLE | Permissions;
|
||||
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH:
|
||||
return TT_ATTR_INDX_MEMORY_WRITE_THROUGH | TT_SH_INNER_SHAREABLE;
|
||||
|
||||
// Uncached and device mappings are treated as outer shareable by default,
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED:
|
||||
return TT_ATTR_INDX_MEMORY_NON_CACHEABLE;
|
||||
|
||||
default:
|
||||
ASSERT (0);
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
|
||||
if (ArmReadCurrentEL () == AARCH64_EL2) {
|
||||
return TT_ATTR_INDX_DEVICE_MEMORY | TT_XN_MASK;
|
||||
} else {
|
||||
return TT_ATTR_INDX_DEVICE_MEMORY | TT_UXN_MASK | TT_PXN_MASK;
|
||||
}
|
||||
return TT_ATTR_INDX_DEVICE_MEMORY | Permissions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +132,7 @@ ReplaceTableEntry (
|
||||
(((RegionStart ^ (UINTN)Entry) & ~BlockMask) == 0))
|
||||
{
|
||||
DisableMmu = TRUE;
|
||||
DEBUG ((DEBUG_WARN, "%a: splitting block entry with MMU disabled\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_WARN, "%a: splitting block entry with MMU disabled\n", __func__));
|
||||
}
|
||||
|
||||
mReplaceLiveEntryFunc (Entry, Value, RegionStart, DisableMmu);
|
||||
@@ -219,7 +226,7 @@ UpdateRegionMappingRecursive (
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a(%d): %llx - %llx set %lx clr %lx\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
Level,
|
||||
RegionStart,
|
||||
RegionEnd,
|
||||
@@ -251,6 +258,16 @@ UpdateRegionMappingRecursive (
|
||||
ASSERT (Level < 3);
|
||||
|
||||
if (!IsTableEntry (*Entry, Level)) {
|
||||
//
|
||||
// If the region we are trying to map is already covered by a block
|
||||
// entry with the right attributes, don't bother splitting it up.
|
||||
//
|
||||
if (IsBlockEntry (*Entry, Level) &&
|
||||
((*Entry & TT_ATTRIBUTES_MASK & ~AttributeClearMask) == AttributeSetMask))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// No table entry exists yet, so we need to allocate a page table
|
||||
// for the next level.
|
||||
@@ -438,14 +455,52 @@ GcdAttributeToPageAttribute (
|
||||
PageAttributes |= TT_AP_NO_RO;
|
||||
}
|
||||
|
||||
return PageAttributes | TT_AF;
|
||||
if ((GcdAttributes & EFI_MEMORY_RP) == 0) {
|
||||
PageAttributes |= TT_AF;
|
||||
}
|
||||
|
||||
return PageAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
Set the requested memory permission attributes on a region of memory.
|
||||
|
||||
BaseAddress and Length must be aligned to EFI_PAGE_SIZE.
|
||||
|
||||
If Attributes contains a memory type attribute (EFI_MEMORY_UC/WC/WT/WB), the
|
||||
region is mapped according to this memory type, and additional memory
|
||||
permission attributes (EFI_MEMORY_RP/RO/XP) are taken into account as well,
|
||||
discarding any permission attributes that are currently set for the region.
|
||||
AttributeMask is ignored in this case, and must be set to 0x0.
|
||||
|
||||
If Attributes contains only a combination of memory permission attributes
|
||||
(EFI_MEMORY_RP/RO/XP), each page in the region will retain its existing
|
||||
memory type, even if it is not uniformly set across the region. In this case,
|
||||
AttributesMask may be set to a mask of permission attributes, and memory
|
||||
permissions omitted from this mask will not be updated for any page in the
|
||||
region. All attributes appearing in Attributes must appear in AttributeMask
|
||||
as well. (Attributes & ~AttributeMask must produce 0x0)
|
||||
|
||||
@param[in] BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param[in] Length The size in bytes of the memory region.
|
||||
@param[in] Attributes Mask of memory attributes to set.
|
||||
@param[in] AttributeMask Mask of memory attributes to take into account.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER BaseAddress or Length is not suitably aligned.
|
||||
Invalid combination of Attributes and
|
||||
AttributeMask.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ArmSetMemoryAttributes (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
IN UINT64 Attributes,
|
||||
IN UINT64 AttributeMask
|
||||
)
|
||||
{
|
||||
UINT64 PageAttributes;
|
||||
@@ -459,9 +514,25 @@ ArmSetMemoryAttributes (
|
||||
// No memory type was set in Attributes, so we are going to update the
|
||||
// permissions only.
|
||||
//
|
||||
PageAttributes &= TT_AP_MASK | TT_UXN_MASK | TT_PXN_MASK;
|
||||
PageAttributes &= TT_AP_MASK | TT_UXN_MASK | TT_PXN_MASK | TT_AF;
|
||||
PageAttributeMask = ~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_AP_MASK |
|
||||
TT_PXN_MASK | TT_XN_MASK);
|
||||
TT_PXN_MASK | TT_XN_MASK | TT_AF);
|
||||
if (AttributeMask != 0) {
|
||||
if (((AttributeMask & ~(UINT64)(EFI_MEMORY_RP|EFI_MEMORY_RO|EFI_MEMORY_XP)) != 0) ||
|
||||
((Attributes & ~AttributeMask) != 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
// Add attributes omitted from AttributeMask to the set of attributes to preserve
|
||||
PageAttributeMask |= GcdAttributeToPageAttribute (~AttributeMask) &
|
||||
(TT_AP_MASK | TT_UXN_MASK | TT_PXN_MASK | TT_AF);
|
||||
}
|
||||
} else {
|
||||
ASSERT (AttributeMask == 0);
|
||||
if (AttributeMask != 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
return UpdateRegionMapping (
|
||||
@@ -474,94 +545,6 @@ ArmSetMemoryAttributes (
|
||||
);
|
||||
}
|
||||
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
SetMemoryRegionAttribute (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes,
|
||||
IN UINT64 BlockEntryMask
|
||||
)
|
||||
{
|
||||
return UpdateRegionMapping (
|
||||
BaseAddress,
|
||||
Length,
|
||||
Attributes,
|
||||
BlockEntryMask,
|
||||
ArmGetTTBR0BaseAddress (),
|
||||
TRUE
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
UINT64 Val;
|
||||
|
||||
if (ArmReadCurrentEL () == AARCH64_EL1) {
|
||||
Val = TT_PXN_MASK | TT_UXN_MASK;
|
||||
} else {
|
||||
Val = TT_XN_MASK;
|
||||
}
|
||||
|
||||
return SetMemoryRegionAttribute (
|
||||
BaseAddress,
|
||||
Length,
|
||||
Val,
|
||||
~TT_ADDRESS_MASK_BLOCK_ENTRY
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
UINT64 Mask;
|
||||
|
||||
// XN maps to UXN in the EL1&0 translation regime
|
||||
Mask = ~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_PXN_MASK | TT_XN_MASK);
|
||||
|
||||
return SetMemoryRegionAttribute (
|
||||
BaseAddress,
|
||||
Length,
|
||||
0,
|
||||
Mask
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
return SetMemoryRegionAttribute (
|
||||
BaseAddress,
|
||||
Length,
|
||||
TT_AP_NO_RO,
|
||||
~TT_ADDRESS_MASK_BLOCK_ENTRY
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
return SetMemoryRegionAttribute (
|
||||
BaseAddress,
|
||||
Length,
|
||||
TT_AP_NO_RW,
|
||||
~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_AP_MASK)
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArmConfigureMmu (
|
||||
@@ -752,7 +735,7 @@ ArmMmuBaseLibConstructor (
|
||||
|
||||
Hob = GetFirstGuidHob (&gArmMmuReplaceLiveTranslationEntryFuncGuid);
|
||||
if (Hob != NULL) {
|
||||
mReplaceLiveEntryFunc = *(VOID **)GET_GUID_HOB_DATA (Hob);
|
||||
mReplaceLiveEntryFunc = *(ARM_REPLACE_LIVE_TRANSLATION_ENTRY *)GET_GUID_HOB_DATA (Hob);
|
||||
} else {
|
||||
//
|
||||
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
|
||||
|
@@ -65,21 +65,21 @@
|
||||
// write updated entry
|
||||
str x1, [x0]
|
||||
dsb nshst
|
||||
isb
|
||||
|
||||
.L2_\@:
|
||||
.endm
|
||||
|
||||
// Align this routine to a log2 upper bound of its size, so that it is
|
||||
// guaranteed not to cross a page or block boundary.
|
||||
.balign 0x200
|
||||
|
||||
//VOID
|
||||
//ArmReplaceLiveTranslationEntry (
|
||||
// IN UINT64 *Entry,
|
||||
// IN UINT64 Value,
|
||||
// IN UINT64 Address
|
||||
// )
|
||||
ASM_FUNC(ArmReplaceLiveTranslationEntry)
|
||||
//
|
||||
// Align this routine to a log2 upper bound of its size, so that it is
|
||||
// guaranteed not to cross a page or block boundary.
|
||||
ASM_FUNC_ALIGN(ArmReplaceLiveTranslationEntry, 0x200)
|
||||
|
||||
// disable interrupts
|
||||
mrs x4, daif
|
||||
@@ -101,5 +101,8 @@ ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)
|
||||
ASM_PFX(ArmReplaceLiveTranslationEntrySize):
|
||||
.long . - ArmReplaceLiveTranslationEntry
|
||||
|
||||
// Double check that we did not overrun the assumed maximum size
|
||||
// Double check that we did not overrun the assumed maximum size or cross a
|
||||
// 0x200 boundary (and thus implicitly not any larger power of two, including
|
||||
// the page size).
|
||||
.balign 0x200
|
||||
.org ArmReplaceLiveTranslationEntry + 0x200
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include <Library/CacheMaintenanceLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
#include "ArmMmuLibInternal.h"
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -21,9 +22,9 @@ ArmMmuPeiLibConstructor (
|
||||
IN CONST EFI_PEI_SERVICES **PeiServices
|
||||
)
|
||||
{
|
||||
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
||||
VOID *ArmReplaceLiveTranslationEntryFunc;
|
||||
VOID *Hob;
|
||||
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
||||
ARM_REPLACE_LIVE_TRANSLATION_ENTRY ArmReplaceLiveTranslationEntryFunc;
|
||||
VOID *Hob;
|
||||
|
||||
EFI_FV_FILE_INFO FileInfo;
|
||||
EFI_STATUS Status;
|
||||
|
@@ -15,16 +15,16 @@
|
||||
|
||||
UINT32
|
||||
ConvertSectionAttributesToPageAttributes (
|
||||
IN UINT32 SectionAttributes,
|
||||
IN BOOLEAN IsLargePage
|
||||
IN UINT32 SectionAttributes
|
||||
)
|
||||
{
|
||||
UINT32 PageAttributes;
|
||||
|
||||
PageAttributes = 0;
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY (SectionAttributes, IsLargePage);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_CACHE_POLICY (SectionAttributes);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_AP (SectionAttributes);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_XN (SectionAttributes, IsLargePage);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_AF (SectionAttributes);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_XN (SectionAttributes);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_NG (SectionAttributes);
|
||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_S (SectionAttributes);
|
||||
|
||||
|
@@ -100,24 +100,27 @@ PopulateLevel2PageTable (
|
||||
|
||||
switch (Attributes) {
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
||||
PageAttributes &= ~TT_DESCRIPTOR_PAGE_S_SHARED;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
||||
PageAttributes |= TT_DESCRIPTOR_PAGE_AP_NO_RO;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
||||
PageAttributes |= TT_DESCRIPTOR_PAGE_XN_MASK;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_THROUGH;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_DEVICE;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED:
|
||||
PageAttributes = TT_DESCRIPTOR_PAGE_UNCACHED;
|
||||
break;
|
||||
default:
|
||||
@@ -145,7 +148,7 @@ PopulateLevel2PageTable (
|
||||
);
|
||||
|
||||
// Translate the Section Descriptor into Page Descriptor
|
||||
SectionDescriptor = TT_DESCRIPTOR_PAGE_TYPE_PAGE | ConvertSectionAttributesToPageAttributes (*SectionEntry, FALSE);
|
||||
SectionDescriptor = TT_DESCRIPTOR_PAGE_TYPE_PAGE | ConvertSectionAttributesToPageAttributes (*SectionEntry);
|
||||
|
||||
BaseSectionAddress = TT_DESCRIPTOR_SECTION_BASE_ADDRESS (*SectionEntry);
|
||||
|
||||
@@ -166,7 +169,6 @@ PopulateLevel2PageTable (
|
||||
|
||||
// Overwrite the section entry to point to the new Level2 Translation Table
|
||||
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
||||
(IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) |
|
||||
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
||||
} else {
|
||||
// We do not support the other section type (16MB Section)
|
||||
@@ -189,7 +191,6 @@ PopulateLevel2PageTable (
|
||||
ZeroMem ((VOID *)TranslationTable, TRANSLATION_TABLE_PAGE_SIZE);
|
||||
|
||||
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
||||
(IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) |
|
||||
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
||||
}
|
||||
|
||||
@@ -239,39 +240,31 @@ FillTranslationTable (
|
||||
|
||||
switch (MemoryRegion->Attributes) {
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK (0);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK (0);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;
|
||||
Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;
|
||||
Attributes |= TT_DESCRIPTOR_SECTION_AP_NO_RO;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_XP:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;
|
||||
Attributes |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH (0);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_DEVICE (0);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_DEVICE;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED (0);
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK (1);
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK (1);
|
||||
Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED;
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH (1);
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_DEVICE (1);
|
||||
break;
|
||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED (1);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED;
|
||||
break;
|
||||
default:
|
||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED (0);
|
||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Library/ArmLib.h>
|
||||
#include <Library/ArmMmuLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@@ -53,7 +54,7 @@ ConvertSectionToPages (
|
||||
|
||||
// Get section attributes and convert to page attributes
|
||||
SectionDescriptor = FirstLevelTable[FirstLevelIdx];
|
||||
PageDescriptor = TT_DESCRIPTOR_PAGE_TYPE_PAGE | ConvertSectionAttributesToPageAttributes (SectionDescriptor, FALSE);
|
||||
PageDescriptor = TT_DESCRIPTOR_PAGE_TYPE_PAGE | ConvertSectionAttributesToPageAttributes (SectionDescriptor);
|
||||
|
||||
// Allocate a page table for the 4KB entries (we use up a full page even though we only need 1KB)
|
||||
PageTable = (volatile ARM_PAGE_TABLE_ENTRY *)AllocatePages (1);
|
||||
@@ -81,12 +82,12 @@ UpdatePageEntries (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes,
|
||||
IN UINT32 EntryMask,
|
||||
OUT BOOLEAN *FlushTlbs OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 EntryValue;
|
||||
UINT32 EntryMask;
|
||||
UINT32 FirstLevelIdx;
|
||||
UINT32 Offset;
|
||||
UINT32 NumPageEntries;
|
||||
@@ -104,12 +105,7 @@ UpdatePageEntries (
|
||||
|
||||
// EntryMask: bitmask of values to change (1 = change this value, 0 = leave alone)
|
||||
// EntryValue: values at bit positions specified by EntryMask
|
||||
EntryMask = TT_DESCRIPTOR_PAGE_TYPE_MASK | TT_DESCRIPTOR_PAGE_AP_MASK;
|
||||
if ((Attributes & EFI_MEMORY_XP) != 0) {
|
||||
EntryValue = TT_DESCRIPTOR_PAGE_TYPE_PAGE_XN;
|
||||
} else {
|
||||
EntryValue = TT_DESCRIPTOR_PAGE_TYPE_PAGE;
|
||||
}
|
||||
EntryValue = TT_DESCRIPTOR_PAGE_TYPE_PAGE;
|
||||
|
||||
// Although the PI spec is unclear on this, the GCD guarantees that only
|
||||
// one Attribute bit is set at a time, so the order of the conditionals below
|
||||
@@ -142,12 +138,20 @@ UpdatePageEntries (
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
if ((Attributes & EFI_MEMORY_RP) == 0) {
|
||||
EntryValue |= TT_DESCRIPTOR_PAGE_AF;
|
||||
}
|
||||
|
||||
if ((Attributes & EFI_MEMORY_RO) != 0) {
|
||||
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RO_RO;
|
||||
} else {
|
||||
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RW_RW;
|
||||
}
|
||||
|
||||
if ((Attributes & EFI_MEMORY_XP) != 0) {
|
||||
EntryValue |= TT_DESCRIPTOR_PAGE_XN_MASK;
|
||||
}
|
||||
|
||||
// Obtain page table base
|
||||
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
||||
|
||||
@@ -167,6 +171,17 @@ UpdatePageEntries (
|
||||
|
||||
// Does this descriptor need to be converted from section entry to 4K pages?
|
||||
if (!TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE (Descriptor)) {
|
||||
//
|
||||
// If the section mapping covers the requested region with the expected
|
||||
// attributes, splitting it is unnecessary, and should be avoided as it
|
||||
// may result in unbounded recursion when using a strict NX policy.
|
||||
//
|
||||
if ((EntryValue & ~TT_DESCRIPTOR_PAGE_TYPE_MASK & EntryMask) ==
|
||||
(ConvertSectionAttributesToPageAttributes (Descriptor) & EntryMask))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Status = ConvertSectionToPages (FirstLevelIdx << TT_DESCRIPTOR_SECTION_BASE_SHIFT);
|
||||
if (EFI_ERROR (Status)) {
|
||||
// Exit for loop
|
||||
@@ -216,11 +231,11 @@ EFI_STATUS
|
||||
UpdateSectionEntries (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
IN UINT64 Attributes,
|
||||
IN UINT32 EntryMask
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 EntryMask;
|
||||
UINT32 EntryValue;
|
||||
UINT32 FirstLevelIdx;
|
||||
UINT32 NumSections;
|
||||
@@ -236,8 +251,6 @@ UpdateSectionEntries (
|
||||
// EntryValue: values at bit positions specified by EntryMask
|
||||
|
||||
// Make sure we handle a section range that is unmapped
|
||||
EntryMask = TT_DESCRIPTOR_SECTION_TYPE_MASK | TT_DESCRIPTOR_SECTION_XN_MASK |
|
||||
TT_DESCRIPTOR_SECTION_AP_MASK;
|
||||
EntryValue = TT_DESCRIPTOR_SECTION_TYPE_SECTION;
|
||||
|
||||
// Although the PI spec is unclear on this, the GCD guarantees that only
|
||||
@@ -281,6 +294,10 @@ UpdateSectionEntries (
|
||||
EntryValue |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||
}
|
||||
|
||||
if ((Attributes & EFI_MEMORY_RP) == 0) {
|
||||
EntryValue |= TT_DESCRIPTOR_SECTION_AF;
|
||||
}
|
||||
|
||||
// obtain page table base
|
||||
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
||||
|
||||
@@ -302,6 +319,7 @@ UpdateSectionEntries (
|
||||
(FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT,
|
||||
TT_DESCRIPTOR_SECTION_SIZE,
|
||||
Attributes,
|
||||
ConvertSectionAttributesToPageAttributes (EntryMask),
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
@@ -332,11 +350,26 @@ UpdateSectionEntries (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Update the permission or memory type attributes on a range of memory.
|
||||
|
||||
@param BaseAddress The start of the region.
|
||||
@param Length The size of the region.
|
||||
@param Attributes A mask of EFI_MEMORY_xx constants.
|
||||
@param SectionMask A mask of short descriptor section attributes
|
||||
describing which descriptor bits to update.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set successfully.
|
||||
@retval EFI_OUT_OF_RESOURCES The operation failed due to insufficient memory.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
ArmSetMemoryAttributes (
|
||||
SetMemoryAttributes (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes
|
||||
IN UINT64 Attributes,
|
||||
IN UINT32 SectionMask
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@@ -367,7 +400,12 @@ ArmSetMemoryAttributes (
|
||||
Attributes
|
||||
));
|
||||
|
||||
Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes);
|
||||
Status = UpdateSectionEntries (
|
||||
BaseAddress,
|
||||
ChunkLength,
|
||||
Attributes,
|
||||
SectionMask
|
||||
);
|
||||
|
||||
FlushTlbs = TRUE;
|
||||
} else {
|
||||
@@ -393,6 +431,7 @@ ArmSetMemoryAttributes (
|
||||
BaseAddress,
|
||||
ChunkLength,
|
||||
Attributes,
|
||||
ConvertSectionAttributesToPageAttributes (SectionMask),
|
||||
&FlushTlbs
|
||||
);
|
||||
}
|
||||
@@ -412,38 +451,96 @@ ArmSetMemoryAttributes (
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, EFI_MEMORY_XP);
|
||||
}
|
||||
/**
|
||||
Set the requested memory permission attributes on a region of memory.
|
||||
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionNoExec (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, __EFI_MEMORY_RWX);
|
||||
}
|
||||
BaseAddress and Length must be aligned to EFI_PAGE_SIZE.
|
||||
|
||||
EFI_STATUS
|
||||
ArmSetMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, EFI_MEMORY_RO);
|
||||
}
|
||||
If Attributes contains a memory type attribute (EFI_MEMORY_UC/WC/WT/WB), the
|
||||
region is mapped according to this memory type, and additional memory
|
||||
permission attributes (EFI_MEMORY_RP/RO/XP) are taken into account as well,
|
||||
discarding any permission attributes that are currently set for the region.
|
||||
AttributeMask is ignored in this case, and must be set to 0x0.
|
||||
|
||||
If Attributes contains only a combination of memory permission attributes
|
||||
(EFI_MEMORY_RP/RO/XP), each page in the region will retain its existing
|
||||
memory type, even if it is not uniformly set across the region. In this case,
|
||||
AttributesMask may be set to a mask of permission attributes, and memory
|
||||
permissions omitted from this mask will not be updated for any page in the
|
||||
region. All attributes appearing in Attributes must appear in AttributeMask
|
||||
as well. (Attributes & ~AttributeMask must produce 0x0)
|
||||
|
||||
@param[in] BaseAddress The physical address that is the start address of
|
||||
a memory region.
|
||||
@param[in] Length The size in bytes of the memory region.
|
||||
@param[in] Attributes Mask of memory attributes to set.
|
||||
@param[in] AttributeMask Mask of memory attributes to take into account.
|
||||
|
||||
@retval EFI_SUCCESS The attributes were set for the memory region.
|
||||
@retval EFI_INVALID_PARAMETER BaseAddress or Length is not suitably aligned.
|
||||
Invalid combination of Attributes and
|
||||
AttributeMask.
|
||||
@retval EFI_OUT_OF_RESOURCES Requested attributes cannot be applied due to
|
||||
lack of system resources.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ArmClearMemoryRegionReadOnly (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length
|
||||
ArmSetMemoryAttributes (
|
||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Attributes,
|
||||
IN UINT64 AttributeMask
|
||||
)
|
||||
{
|
||||
return ArmSetMemoryAttributes (BaseAddress, Length, __EFI_MEMORY_RWX);
|
||||
UINT32 TtEntryMask;
|
||||
|
||||
if (((BaseAddress | Length) & EFI_PAGE_MASK) != 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((Attributes & EFI_MEMORY_CACHETYPE_MASK) == 0) {
|
||||
//
|
||||
// No memory type was set in Attributes, so we are going to update the
|
||||
// permissions only.
|
||||
//
|
||||
if (AttributeMask != 0) {
|
||||
if (((AttributeMask & ~(UINT64)(EFI_MEMORY_RP|EFI_MEMORY_RO|EFI_MEMORY_XP)) != 0) ||
|
||||
((Attributes & ~AttributeMask) != 0))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
} else {
|
||||
AttributeMask = EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP;
|
||||
}
|
||||
|
||||
TtEntryMask = 0;
|
||||
if ((AttributeMask & EFI_MEMORY_RP) != 0) {
|
||||
TtEntryMask |= TT_DESCRIPTOR_SECTION_AF;
|
||||
}
|
||||
|
||||
if ((AttributeMask & EFI_MEMORY_RO) != 0) {
|
||||
TtEntryMask |= TT_DESCRIPTOR_SECTION_AP_MASK;
|
||||
}
|
||||
|
||||
if ((AttributeMask & EFI_MEMORY_XP) != 0) {
|
||||
TtEntryMask |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||
}
|
||||
} else {
|
||||
ASSERT (AttributeMask == 0);
|
||||
if (AttributeMask != 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
TtEntryMask = TT_DESCRIPTOR_SECTION_TYPE_MASK |
|
||||
TT_DESCRIPTOR_SECTION_XN_MASK |
|
||||
TT_DESCRIPTOR_SECTION_AP_MASK |
|
||||
TT_DESCRIPTOR_SECTION_AF;
|
||||
}
|
||||
|
||||
return SetMemoryAttributes (
|
||||
BaseAddress,
|
||||
Length,
|
||||
Attributes,
|
||||
TtEntryMask
|
||||
);
|
||||
}
|
||||
|
@@ -19,10 +19,12 @@
|
||||
CONSTRUCTOR = ArmMmuBaseLibConstructor
|
||||
|
||||
[Sources.AARCH64]
|
||||
ArmMmuLibInternal.h
|
||||
AArch64/ArmMmuLibCore.c
|
||||
AArch64/ArmMmuLibReplaceEntry.S
|
||||
|
||||
[Sources.ARM]
|
||||
ArmMmuLibInternal.h
|
||||
Arm/ArmMmuLibConvert.c
|
||||
Arm/ArmMmuLibCore.c
|
||||
Arm/ArmMmuLibUpdate.c
|
||||
|
23
ArmPkg/Library/ArmMmuLib/ArmMmuLibInternal.h
Normal file
23
ArmPkg/Library/ArmMmuLib/ArmMmuLibInternal.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/** @file
|
||||
Arm MMU library instance internal header file.
|
||||
|
||||
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef ARM_MMU_LIB_INTERNAL_H_
|
||||
#define ARM_MMU_LIB_INTERNAL_H_
|
||||
|
||||
typedef
|
||||
VOID(
|
||||
EFIAPI *ARM_REPLACE_LIVE_TRANSLATION_ENTRY
|
||||
)(
|
||||
IN UINT64 *Entry,
|
||||
IN UINT64 Value,
|
||||
IN UINT64 RegionStart,
|
||||
IN BOOLEAN DisableMmu
|
||||
);
|
||||
|
||||
#endif
|
@@ -17,6 +17,7 @@
|
||||
CONSTRUCTOR = ArmMmuPeiLibConstructor
|
||||
|
||||
[Sources.AARCH64]
|
||||
ArmMmuLibInternal.h
|
||||
AArch64/ArmMmuLibCore.c
|
||||
AArch64/ArmMmuPeiLibConstructor.c
|
||||
AArch64/ArmMmuLibReplaceEntry.S
|
||||
|
@@ -26,7 +26,7 @@ ArmMonitorCall (
|
||||
IN OUT ARM_MONITOR_ARGS *Args
|
||||
)
|
||||
{
|
||||
if (FeaturePcdGet (PcdMonitorConduitHvc)) {
|
||||
if (PcdGetBool (PcdMonitorConduitHvc)) {
|
||||
ArmCallHvc ((ARM_HVC_ARGS *)Args);
|
||||
} else {
|
||||
ArmCallSmc ((ARM_SMC_ARGS *)Args);
|
||||
|
@@ -65,7 +65,7 @@ LibResetSystem (
|
||||
ArmCallSmc (&ArmSmcArgs);
|
||||
|
||||
// We should never be here
|
||||
DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __func__));
|
||||
CpuDeadLoop ();
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
@@ -5,12 +5,12 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include <AsmMacroIoLibV8.h>
|
||||
|
||||
.text
|
||||
.align 3
|
||||
|
||||
GCC_ASM_EXPORT(ArmCallSvc)
|
||||
|
||||
ASM_PFX(ArmCallSvc):
|
||||
ASM_FUNC(ArmCallSvc)
|
||||
// Push frame pointer and return address on the stack
|
||||
stp x29, x30, [sp, #-32]!
|
||||
mov x29, sp
|
||||
|
@@ -331,14 +331,12 @@ ArmTrngLibConstructor (
|
||||
ArmMonitorCall (&Parameters);
|
||||
Status = TrngStatusToReturnStatus ((INT32)Parameters.Arg0);
|
||||
if (RETURN_ERROR (Status)) {
|
||||
ASSERT_RETURN_ERROR (Status);
|
||||
goto ErrorHandler;
|
||||
}
|
||||
|
||||
// Cf [1] s2.1.3 'Caller responsibilities',
|
||||
// SMCCC version must be greater or equal than 1.1
|
||||
if ((INT32)Parameters.Arg0 < 0x10001) {
|
||||
ASSERT_RETURN_ERROR (RETURN_UNSUPPORTED);
|
||||
goto ErrorHandler;
|
||||
}
|
||||
|
||||
@@ -350,14 +348,12 @@ ArmTrngLibConstructor (
|
||||
// Check that the required features are present.
|
||||
Status = GetArmTrngFeatures (ARM_SMC_ID_TRNG_RND, NULL);
|
||||
if (RETURN_ERROR (Status)) {
|
||||
ASSERT_RETURN_ERROR (Status);
|
||||
goto ErrorHandler;
|
||||
}
|
||||
|
||||
// Check if TRNG UUID is supported and if so trace the GUID.
|
||||
Status = GetArmTrngFeatures (ARM_SMC_ID_TRNG_GET_UUID, NULL);
|
||||
if (RETURN_ERROR (Status)) {
|
||||
ASSERT_RETURN_ERROR (Status);
|
||||
goto ErrorHandler;
|
||||
}
|
||||
|
||||
@@ -365,7 +361,6 @@ ArmTrngLibConstructor (
|
||||
|
||||
Status = GetArmTrngUuid (&Guid);
|
||||
if (RETURN_ERROR (Status)) {
|
||||
ASSERT_RETURN_ERROR (Status);
|
||||
goto ErrorHandler;
|
||||
}
|
||||
|
||||
|
@@ -17,45 +17,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#include <Library/PeCoffExtraActionLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
|
||||
/**
|
||||
If the build is done on cygwin the paths are cygpaths.
|
||||
/cygdrive/c/tmp.txt vs c:\tmp.txt so we need to convert
|
||||
them to work with RVD commands
|
||||
|
||||
@param Name Path to convert if needed
|
||||
|
||||
**/
|
||||
CHAR8 *
|
||||
DeCygwinPathIfNeeded (
|
||||
IN CHAR8 *Name,
|
||||
IN CHAR8 *Temp,
|
||||
IN UINTN Size
|
||||
)
|
||||
{
|
||||
CHAR8 *Ptr;
|
||||
UINTN Index;
|
||||
UINTN Index2;
|
||||
|
||||
Ptr = AsciiStrStr (Name, "/cygdrive/");
|
||||
if (Ptr == NULL) {
|
||||
return Name;
|
||||
}
|
||||
|
||||
for (Index = 9, Index2 = 0; (Index < (Size + 9)) && (Ptr[Index] != '\0'); Index++, Index2++) {
|
||||
Temp[Index2] = Ptr[Index];
|
||||
if (Temp[Index2] == '/') {
|
||||
Temp[Index2] = '\\';
|
||||
}
|
||||
|
||||
if (Index2 == 1) {
|
||||
Temp[Index2 - 1] = Ptr[Index];
|
||||
Temp[Index2] = ':';
|
||||
}
|
||||
}
|
||||
|
||||
return Temp;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs additional actions after a PE/COFF image has been loaded and relocated.
|
||||
|
||||
@@ -71,28 +32,24 @@ PeCoffLoaderRelocateImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
#if !defined (MDEPKG_NDEBUG)
|
||||
CHAR8 Temp[512];
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
if (ImageContext->PdbPointer) {
|
||||
#ifdef __CC_ARM
|
||||
#if (__ARMCC_VERSION < 500000)
|
||||
// Print out the command for the RVD debugger to load symbols for this image
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "load /a /ni /np %a &0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
|
||||
#else
|
||||
// Print out the command for the DS-5 to load symbols for this image
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "add-symbol-file %a 0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
|
||||
#endif
|
||||
#elif __GNUC__
|
||||
// This may not work correctly if you generate PE/COFF directly as then the Offset would not be required
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "add-symbol-file %a 0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
|
||||
#else
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Loading driver at 0x%11p EntryPoint=0x%11p\n", (VOID *)(UINTN)ImageContext->ImageAddress, FUNCTION_ENTRY_POINT (ImageContext->EntryPoint)));
|
||||
#endif
|
||||
} else {
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Loading driver at 0x%11p EntryPoint=0x%11p\n", (VOID *)(UINTN)ImageContext->ImageAddress, FUNCTION_ENTRY_POINT (ImageContext->EntryPoint)));
|
||||
DEBUG ((
|
||||
DEBUG_LOAD | DEBUG_INFO,
|
||||
"add-symbol-file %a 0x%p\n",
|
||||
ImageContext->PdbPointer,
|
||||
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)
|
||||
));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_LOAD | DEBUG_INFO,
|
||||
"Loading driver at 0x%11p EntryPoint=0x%11p\n",
|
||||
(VOID *)(UINTN)ImageContext->ImageAddress,
|
||||
FUNCTION_ENTRY_POINT (ImageContext->EntryPoint)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,21 +68,21 @@ PeCoffLoaderUnloadImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
#if !defined (MDEPKG_NDEBUG)
|
||||
CHAR8 Temp[512];
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
if (ImageContext->PdbPointer) {
|
||||
#ifdef __CC_ARM
|
||||
// Print out the command for the RVD debugger to load symbols for this image
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "unload symbols_only %a\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp))));
|
||||
#elif __GNUC__
|
||||
// This may not work correctly if you generate PE/COFF directly as then the Offset would not be required
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "remove-symbol-file %a 0x%08x\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
|
||||
#else
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Unloading %a\n", ImageContext->PdbPointer));
|
||||
#endif
|
||||
} else {
|
||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "Unloading driver at 0x%11p\n", (VOID *)(UINTN)ImageContext->ImageAddress));
|
||||
DEBUG ((
|
||||
DEBUG_LOAD | DEBUG_INFO,
|
||||
"remove-symbol-file %a 0x%08x\n",
|
||||
ImageContext->PdbPointer,
|
||||
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)
|
||||
));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG ((
|
||||
DEBUG_LOAD | DEBUG_INFO,
|
||||
"Unloading driver at 0x%11p\n",
|
||||
(VOID *)(UINTN)ImageContext->ImageAddress
|
||||
));
|
||||
}
|
||||
|
@@ -22,6 +22,12 @@
|
||||
#include <Protocol/DebugSupport.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
|
||||
//
|
||||
// Maximum number of characters to print to serial (UINT8s) and to console if
|
||||
// available (as UINT16s)
|
||||
//
|
||||
#define MAX_PRINT_CHARS 100
|
||||
|
||||
STATIC CHAR8 *gExceptionTypeString[] = {
|
||||
"Synchronous",
|
||||
"IRQ",
|
||||
@@ -188,18 +194,14 @@ DefaultExceptionHandler (
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
)
|
||||
{
|
||||
CHAR8 Buffer[100];
|
||||
UINTN CharCount;
|
||||
INT32 Offset;
|
||||
CHAR8 Buffer[MAX_PRINT_CHARS];
|
||||
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
|
||||
UINTN CharCount;
|
||||
INT32 Offset;
|
||||
|
||||
if (mRecursiveException) {
|
||||
STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n";
|
||||
|
||||
SerialPortWrite ((UINT8 *)Message, sizeof Message - 1);
|
||||
if (gST->ConOut != NULL) {
|
||||
AsciiPrint (Message);
|
||||
}
|
||||
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
||||
@@ -207,9 +209,10 @@ DefaultExceptionHandler (
|
||||
|
||||
CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);
|
||||
SerialPortWrite ((UINT8 *)Buffer, CharCount);
|
||||
if (gST->ConOut != NULL) {
|
||||
AsciiPrint (Buffer);
|
||||
}
|
||||
|
||||
// Prepare a unicode buffer for ConOut, if applicable, in case the buffer
|
||||
// gets reused.
|
||||
UnicodeSPrintAsciiFormat (UnicodeBuffer, MAX_PRINT_CHARS, Buffer);
|
||||
|
||||
DEBUG_CODE_BEGIN ();
|
||||
CHAR8 *Pdb, *PrevPdb;
|
||||
@@ -330,6 +333,13 @@ DefaultExceptionHandler (
|
||||
));
|
||||
}
|
||||
|
||||
// Attempt to print that we had a synchronous exception to ConOut. We do
|
||||
// this after the serial logging as ConOut's logging is more complex and we
|
||||
// aren't guaranteed to succeed.
|
||||
if (gST->ConOut != NULL) {
|
||||
gST->ConOut->OutputString (gST->ConOut, UnicodeBuffer);
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
CpuDeadLoop ();
|
||||
}
|
||||
|
@@ -23,6 +23,12 @@
|
||||
#include <Protocol/DebugSupport.h>
|
||||
#include <Library/DefaultExceptionHandlerLib.h>
|
||||
|
||||
//
|
||||
// Maximum number of characters to print to serial (UINT8s) and to console if
|
||||
// available (as UINT16s)
|
||||
//
|
||||
#define MAX_PRINT_CHARS 100
|
||||
|
||||
//
|
||||
// The number of elements in a CHAR8 array, including the terminating NUL, that
|
||||
// is meant to hold the string rendering of the CPSR.
|
||||
@@ -198,7 +204,8 @@ DefaultExceptionHandler (
|
||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||
)
|
||||
{
|
||||
CHAR8 Buffer[100];
|
||||
CHAR8 Buffer[MAX_PRINT_CHARS];
|
||||
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
|
||||
UINTN CharCount;
|
||||
UINT32 DfsrStatus;
|
||||
UINT32 IfsrStatus;
|
||||
@@ -216,9 +223,10 @@ DefaultExceptionHandler (
|
||||
SystemContext.SystemContextArm->CPSR
|
||||
);
|
||||
SerialPortWrite ((UINT8 *)Buffer, CharCount);
|
||||
if (gST->ConOut != NULL) {
|
||||
AsciiPrint (Buffer);
|
||||
}
|
||||
|
||||
// Prepare a unicode buffer for ConOut, if applicable, as Buffer is used
|
||||
// below.
|
||||
UnicodeSPrintAsciiFormat (UnicodeBuffer, MAX_PRINT_CHARS, Buffer);
|
||||
|
||||
DEBUG_CODE_BEGIN ();
|
||||
CHAR8 *Pdb;
|
||||
@@ -289,6 +297,14 @@ DefaultExceptionHandler (
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_ERROR, "\n"));
|
||||
|
||||
// Attempt to print that we had a synchronous exception to ConOut. We do
|
||||
// this after the serial logging as ConOut's logging is more complex and we
|
||||
// aren't guaranteed to succeed.
|
||||
if (gST->ConOut != NULL) {
|
||||
gST->ConOut->OutputString (gST->ConOut, UnicodeBuffer);
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
|
||||
CpuDeadLoop (); // may return if executing under a debugger
|
||||
|
Binary file not shown.
BIN
ArmPkg/Library/GnuNoteBti.bin
Normal file
BIN
ArmPkg/Library/GnuNoteBti.bin
Normal file
Binary file not shown.
@@ -151,7 +151,7 @@ PlatformBootManagerAfterConsole (
|
||||
LOAD_OPTION_ACTIVE
|
||||
);
|
||||
} else {
|
||||
DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __func__));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -86,7 +86,12 @@ OpteeSharedMemoryRemap (
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
Status = ArmSetMemoryAttributes (PhysicalAddress, Size, EFI_MEMORY_WB);
|
||||
Status = ArmSetMemoryAttributes (
|
||||
PhysicalAddress,
|
||||
Size,
|
||||
EFI_MEMORY_WB | EFI_MEMORY_XP,
|
||||
0
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Implementation for PlatformBootManagerLib library class interfaces.
|
||||
|
||||
Copyright (C) 2015-2016, Red Hat, Inc.
|
||||
Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2014 - 2023, Arm Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2021, Semihalf All rights reserved.<BR>
|
||||
@@ -195,7 +195,7 @@ FilterAndProcess (
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: %g: %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ProtocolGuid,
|
||||
Status
|
||||
));
|
||||
@@ -266,7 +266,7 @@ IsPciDisplay (
|
||||
&Pci
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ Connect (
|
||||
DEBUG ((
|
||||
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
|
||||
"%a: %s: %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ReportText,
|
||||
Status
|
||||
));
|
||||
@@ -356,7 +356,7 @@ AddOutput (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: %s: handle %p: device path not found\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ReportText,
|
||||
Handle
|
||||
));
|
||||
@@ -368,7 +368,7 @@ AddOutput (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: %s: adding to ConOut: %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ReportText,
|
||||
Status
|
||||
));
|
||||
@@ -380,7 +380,7 @@ AddOutput (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: %s: adding to ErrOut: %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ReportText,
|
||||
Status
|
||||
));
|
||||
@@ -390,7 +390,7 @@ AddOutput (
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: %s: added to ConOut and ErrOut\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
ReportText
|
||||
));
|
||||
}
|
||||
@@ -470,6 +470,64 @@ PlatformRegisterFvBootOption (
|
||||
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
|
||||
}
|
||||
|
||||
/** Boot a Fv Boot Option.
|
||||
|
||||
This function is useful for booting the UEFI Shell as it is loaded
|
||||
as a non active boot option.
|
||||
|
||||
@param[in] FileGuid The File GUID.
|
||||
@param[in] Description String describing the Boot Option.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
PlatformBootFvBootOption (
|
||||
IN CONST EFI_GUID *FileGuid,
|
||||
IN CHAR16 *Description
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION NewOption;
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
|
||||
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
gImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// The UEFI Shell was registered in PlatformRegisterFvBootOption ()
|
||||
// previously, thus it must still be available in this FV.
|
||||
//
|
||||
EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);
|
||||
DevicePath = DevicePathFromHandle (LoadedImage->DeviceHandle);
|
||||
ASSERT (DevicePath != NULL);
|
||||
DevicePath = AppendDevicePathNode (
|
||||
DevicePath,
|
||||
(EFI_DEVICE_PATH_PROTOCOL *)&FileNode
|
||||
);
|
||||
ASSERT (DevicePath != NULL);
|
||||
|
||||
Status = EfiBootManagerInitializeLoadOption (
|
||||
&NewOption,
|
||||
LoadOptionNumberUnassigned,
|
||||
LoadOptionTypeBoot,
|
||||
LOAD_OPTION_ACTIVE,
|
||||
Description,
|
||||
DevicePath,
|
||||
NULL,
|
||||
0
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
FreePool (DevicePath);
|
||||
|
||||
EfiBootManagerBoot (&NewOption);
|
||||
}
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
GetPlatformOptions (
|
||||
@@ -547,7 +605,7 @@ GetPlatformOptions (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: failed to register \"%s\": %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
BootOptions[Index].Description,
|
||||
Status
|
||||
));
|
||||
@@ -575,7 +633,7 @@ GetPlatformOptions (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: failed to register hotkey for \"%s\": %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
BootOptions[Index].Description,
|
||||
Status
|
||||
));
|
||||
@@ -757,7 +815,7 @@ HandleCapsules (
|
||||
BOOLEAN NeedReset;
|
||||
EFI_STATUS Status;
|
||||
|
||||
DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __FUNCTION__));
|
||||
DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __func__));
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEsrtManagementProtocolGuid,
|
||||
@@ -785,7 +843,7 @@ HandleCapsules (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"%a: failed to process capsule %p - %r\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
CapsuleHeader,
|
||||
Status
|
||||
));
|
||||
@@ -800,7 +858,7 @@ HandleCapsules (
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
"%a: capsule update successful, resetting ...\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
|
||||
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
||||
@@ -868,7 +926,7 @@ BootDiscoveryPolicyHandler (
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DiscoveryPolicy
|
||||
));
|
||||
return EFI_SUCCESS;
|
||||
@@ -884,14 +942,14 @@ BootDiscoveryPolicyHandler (
|
||||
DEBUG_INFO,
|
||||
"%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
|
||||
"Driver connect will be skipped.\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCTION__, Status));
|
||||
DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __func__, Status));
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -1075,6 +1133,18 @@ PlatformBootManagerUnableToBoot (
|
||||
EfiBootManagerConnectAll ();
|
||||
EfiBootManagerRefreshAllBootOption ();
|
||||
|
||||
//
|
||||
// Boot the 'UEFI Shell'. If the Pcd is not set, the UEFI Shell is not
|
||||
// an active boot option and must be manually selected through UiApp
|
||||
// (at least during the fist boot).
|
||||
//
|
||||
if (FixedPcdGetBool (PcdUefiShellDefaultBootEnable)) {
|
||||
PlatformBootFvBootOption (
|
||||
&gUefiShellFileGuid,
|
||||
L"UEFI Shell (default)"
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Record the updated number of boot configured boot options
|
||||
//
|
||||
@@ -1096,7 +1166,7 @@ PlatformBootManagerUnableToBoot (
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
"%a: rebooting after refreshing all boot options\n",
|
||||
__FUNCTION__
|
||||
__func__
|
||||
));
|
||||
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# Implementation for PlatformBootManagerLib library class interfaces.
|
||||
#
|
||||
# Copyright (C) 2015-2016, Red Hat, Inc.
|
||||
# Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2014 - 2023, Arm Ltd. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||
#
|
||||
@@ -29,6 +29,7 @@
|
||||
PlatformBm.h
|
||||
|
||||
[Packages]
|
||||
ArmPkg/ArmPkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
@@ -55,7 +56,7 @@
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
||||
[FixedPcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
|
||||
gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
|
||||
@@ -66,6 +67,7 @@
|
||||
[Pcd]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
|
||||
|
||||
[Guids]
|
||||
gBootDiscoveryPolicyMgrFormsetGuid
|
||||
|
@@ -1,147 +0,0 @@
|
||||
/**@file
|
||||
|
||||
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Library/PeCoffLib.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/PeCoffExtraActionLib.h>
|
||||
#include <Library/SemihostLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
|
||||
/**
|
||||
Append string to debugger script file, create file if needed.
|
||||
|
||||
This library can show up in multiple places so we need to append the file every time we write to it.
|
||||
For example Sec can use this to load the DXE core, and the DXE core would use this to load all the
|
||||
other modules. So we have two instances of the library in the system.
|
||||
|
||||
@param Buffer Buffer to write to file.
|
||||
@param Length Length of Buffer in bytes.
|
||||
**/
|
||||
VOID
|
||||
WriteStringToFile (
|
||||
IN VOID *Buffer,
|
||||
IN UINT32 Length
|
||||
)
|
||||
{
|
||||
// Working around and issue with the code that is commented out. For now send it to the console.
|
||||
// You can copy the console into a file and source the file as a script and you get symbols.
|
||||
// This gets you all the symbols except for SEC. To get SEC symbols you need to copy the
|
||||
// debug print in the SEC into the debugger manually
|
||||
SemihostWriteString (Buffer);
|
||||
|
||||
/*
|
||||
I'm currently having issues with this code crashing the debugger. Seems like it should work.
|
||||
|
||||
UINT32 SemihostHandle;
|
||||
UINT32 SemihostMode = SEMIHOST_FILE_MODE_WRITE | SEMIHOST_FILE_MODE_BINARY | SEMIHOST_FILE_MODE_UPDATE;
|
||||
|
||||
SemihostFileOpen ("c:\rvi_symbols.inc", SemihostMode, &SemihostHandle);
|
||||
SemihostFileWrite (SemihostHandle, &Length, Buffer);
|
||||
SemihostFileClose (SemihostHandle);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
If the build is done on cygwin the paths are cygpaths.
|
||||
/cygdrive/c/tmp.txt vs c:\tmp.txt so we need to convert
|
||||
them to work with RVD commands
|
||||
|
||||
@param Name Path to convert if needed
|
||||
|
||||
**/
|
||||
CHAR8 *
|
||||
DeCygwinPathIfNeeded (
|
||||
IN CHAR8 *Name
|
||||
)
|
||||
{
|
||||
CHAR8 *Ptr;
|
||||
UINTN Index;
|
||||
UINTN Len;
|
||||
|
||||
Ptr = AsciiStrStr (Name, "/cygdrive/");
|
||||
if (Ptr == NULL) {
|
||||
return Name;
|
||||
}
|
||||
|
||||
Len = AsciiStrLen (Ptr);
|
||||
|
||||
// convert "/cygdrive" to spaces
|
||||
for (Index = 0; Index < 9; Index++) {
|
||||
Ptr[Index] = ' ';
|
||||
}
|
||||
|
||||
// convert /c to c:
|
||||
Ptr[9] = Ptr[10];
|
||||
Ptr[10] = ':';
|
||||
|
||||
// switch path separators
|
||||
for (Index = 11; Index < Len; Index++) {
|
||||
if (Ptr[Index] == '/') {
|
||||
Ptr[Index] = '\\';
|
||||
}
|
||||
}
|
||||
|
||||
return Name;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs additional actions after a PE/COFF image has been loaded and relocated.
|
||||
|
||||
If ImageContext is NULL, then ASSERT().
|
||||
|
||||
@param ImageContext Pointer to the image context structure that describes the
|
||||
PE/COFF image that has already been loaded and relocated.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PeCoffLoaderRelocateImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
CHAR8 Buffer[256];
|
||||
|
||||
#if (__ARMCC_VERSION < 500000)
|
||||
AsciiSPrint (Buffer, sizeof (Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
|
||||
#else
|
||||
AsciiSPrint (Buffer, sizeof (Buffer), "add-symbol-file %a 0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
|
||||
#endif
|
||||
DeCygwinPathIfNeeded (&Buffer[16]);
|
||||
|
||||
WriteStringToFile (Buffer, AsciiStrSize (Buffer));
|
||||
}
|
||||
|
||||
/**
|
||||
Performs additional actions just before a PE/COFF image is unloaded. Any resources
|
||||
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
|
||||
|
||||
If ImageContext is NULL, then ASSERT().
|
||||
|
||||
@param ImageContext Pointer to the image context structure that describes the
|
||||
PE/COFF image that is being unloaded.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PeCoffLoaderUnloadImageExtraAction (
|
||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
{
|
||||
CHAR8 Buffer[256];
|
||||
|
||||
AsciiSPrint (Buffer, sizeof (Buffer), "unload symbols_only \"%a\"\n", ImageContext->PdbPointer);
|
||||
DeCygwinPathIfNeeded (Buffer);
|
||||
|
||||
WriteStringToFile (Buffer, AsciiStrSize (Buffer));
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
#/** @file
|
||||
# PeCoff extra action library for DXE phase that run Unix emulator.
|
||||
#
|
||||
# Lib to provide memory journal status code reporting Routines
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
#
|
||||
#**/
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = RvdUnixPeCoffExtraActionLib
|
||||
FILE_GUID = 5EDEB7E7-EA55-4E92-8216-335AC98A3B11
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = PeCoffExtraActionLib
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = ARM
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
RvdPeCoffExtraActionLib.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
ArmPkg/ArmPkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
SemihostLib
|
@@ -741,7 +741,7 @@ AddSmbiosProcessorTypeTable (
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
|
||||
Copyright (c) 2022 - 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
|
||||
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
|
||||
@@ -124,22 +124,47 @@ GetBiosReleaseDate (
|
||||
return ReleaseDate;
|
||||
}
|
||||
|
||||
/**
|
||||
Fetches the firmware ('BIOS') version from the
|
||||
FirmwareVersionInfo HOB.
|
||||
/** Fetches the Firmware version string for SMBIOS type 0
|
||||
|
||||
This function first acquires the firmware version string from OemMiscLib;
|
||||
if it is invalid, PcdFirmwareVersionString is used as a fallback,
|
||||
and then sets it in SMBIOS type 0.
|
||||
|
||||
@return The version as a UTF-16 string
|
||||
**/
|
||||
CHAR16 *
|
||||
GetBiosVersion (
|
||||
VOID
|
||||
SetBiosVersion (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
CHAR16 *ReleaseString;
|
||||
CHAR16 *DefaultVersionString;
|
||||
CHAR16 *Version;
|
||||
EFI_STRING_ID TokenToUpdate;
|
||||
|
||||
ReleaseString = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
|
||||
DefaultVersionString = HiiGetString (
|
||||
mSmbiosMiscHiiHandle,
|
||||
STRING_TOKEN (STR_MISC_BIOS_VERSION),
|
||||
NULL
|
||||
);
|
||||
|
||||
return ReleaseString;
|
||||
OemUpdateSmbiosInfo (
|
||||
mSmbiosMiscHiiHandle,
|
||||
STRING_TOKEN (STR_MISC_BIOS_VERSION),
|
||||
BiosVersionType00
|
||||
);
|
||||
|
||||
Version = HiiGetString (
|
||||
mSmbiosMiscHiiHandle,
|
||||
STRING_TOKEN (STR_MISC_BIOS_VERSION),
|
||||
NULL
|
||||
);
|
||||
|
||||
if (((StrCmp (Version, DefaultVersionString) == 0) || (StrLen (Version) == 0))) {
|
||||
Version = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString);
|
||||
if (StrLen (Version) > 0) {
|
||||
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
|
||||
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +185,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
||||
UINTN VendorStrLen;
|
||||
UINTN VerStrLen;
|
||||
UINTN DateStrLen;
|
||||
UINTN BiosPhysicalSize;
|
||||
UINT64 BiosPhysicalSize;
|
||||
CHAR16 *Vendor;
|
||||
CHAR16 *Version;
|
||||
CHAR16 *ReleaseDate;
|
||||
@@ -187,18 +212,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
||||
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);
|
||||
}
|
||||
|
||||
Version = GetBiosVersion ();
|
||||
|
||||
if (StrLen (Version) > 0) {
|
||||
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
|
||||
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
|
||||
} else {
|
||||
OemUpdateSmbiosInfo (
|
||||
mSmbiosMiscHiiHandle,
|
||||
STRING_TOKEN (STR_MISC_BIOS_VERSION),
|
||||
BiosVersionType00
|
||||
);
|
||||
}
|
||||
SetBiosVersion ();
|
||||
|
||||
Char16String = GetBiosReleaseDate ();
|
||||
if (StrLen (Char16String) > 0) {
|
||||
@@ -273,7 +287,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
@@ -184,7 +184,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
@@ -214,7 +214,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
@@ -179,7 +179,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscChassisManufacturer) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
@@ -161,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
|
||||
DEBUG ((
|
||||
DEBUG_ERROR,
|
||||
"[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
|
||||
__FUNCTION__,
|
||||
__func__,
|
||||
DEBUG_LINE_NUMBER,
|
||||
Status
|
||||
));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user