Compare commits
1642 Commits
edk2-stabl
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
71606314f8 | ||
|
90cb1ec332 | ||
|
603ad2d6ae | ||
|
65b0d08786 | ||
|
b45aff0dc9 | ||
|
10ab1c67c4 | ||
|
10cd8b45ce | ||
|
e2e09d8512 | ||
|
7772e339bd | ||
|
cac1ea6c2a | ||
|
de4cc40b8c | ||
|
839bd17973 | ||
|
077760fec4 | ||
|
e3b3e907e1 | ||
|
d390b163f8 | ||
|
341ee5c31b | ||
|
525578bdd5 | ||
|
cdc1a88272 | ||
|
669291db5a | ||
|
fcd09b1edb | ||
|
68310cd56a | ||
|
ffb8481ba8 | ||
|
7421ea1f2a | ||
|
b7db4d895a | ||
|
db4101c308 | ||
|
ad245ffeff | ||
|
3a516aa240 | ||
|
32a9ee736e | ||
|
52a4bc65f6 | ||
|
87f22f4b5c | ||
|
27b044605c | ||
|
b0930e3f4e | ||
|
de2330450f | ||
|
7339bfeffa | ||
|
3b36aa96de | ||
|
7c584bb048 | ||
|
746cc5cc40 | ||
|
5f68a363d0 | ||
|
a8dc6bf73f | ||
|
ced13b93af | ||
|
e784848116 | ||
|
9518d77eb8 | ||
|
c695e3182a | ||
|
cd4cebabf5 | ||
|
843f2d0964 | ||
|
30b6d08e27 | ||
|
b40c64ec25 | ||
|
79655e2768 | ||
|
55f8bddade | ||
|
0e3189d406 | ||
|
08281572aa | ||
|
ed7a3143b7 | ||
|
3096fcf81d | ||
|
27a7345882 | ||
|
b5412646db | ||
|
e065735b1b | ||
|
acfd991b68 | ||
|
40fa5cf299 | ||
|
f44cc28972 | ||
|
8deeda7ce0 | ||
|
1d8fedb0cd | ||
|
88a4de450f | ||
|
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 |
@@ -27,7 +27,7 @@ steps:
|
|||||||
|
|
||||||
- task: UsePythonVersion@0
|
- task: UsePythonVersion@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '>=3.10.6'
|
versionSpec: '3.12'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
|
@@ -8,5 +8,5 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
default_python_version: ">=3.10.6"
|
default_python_version: "3.12"
|
||||||
default_linux_image: "ghcr.io/tianocore/containers/fedora-35-test:47addc9"
|
default_linux_image: "ghcr.io/tianocore/containers/fedora-37-test:a0dd931"
|
||||||
|
@@ -116,7 +116,7 @@ steps:
|
|||||||
filename: stuart_build
|
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
|
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))
|
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
|
# Copy the build logs to the artifact staging directory
|
||||||
- task: CopyFiles@2
|
- task: CopyFiles@2
|
||||||
|
@@ -49,9 +49,12 @@ jobs:
|
|||||||
TARGET_FMP_FAT_TEST:
|
TARGET_FMP_FAT_TEST:
|
||||||
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
|
Build.Pkgs: 'FmpDevicePkg,FatPkg,UnitTestFrameworkPkg,DynamicTablesPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
TARGET_CRYPTO:
|
TARGET_CRYPTO_DEBUG:
|
||||||
Build.Pkgs: 'CryptoPkg'
|
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:
|
TARGET_FSP:
|
||||||
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
|
Build.Pkgs: 'IntelFsp2Pkg,IntelFsp2WrapperPkg'
|
||||||
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT'
|
||||||
|
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
|
|
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -20,6 +20,7 @@ updates:
|
|||||||
- "makubacki"
|
- "makubacki"
|
||||||
- "mdkinney"
|
- "mdkinney"
|
||||||
- "spbrogan"
|
- "spbrogan"
|
||||||
|
rebase-strategy: "disabled"
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
@@ -32,3 +33,4 @@ updates:
|
|||||||
- "makubacki"
|
- "makubacki"
|
||||||
- "mdkinney"
|
- "mdkinney"
|
||||||
- "spbrogan"
|
- "spbrogan"
|
||||||
|
rebase-strategy: "disabled"
|
||||||
|
27
.github/pull_request_template.md
vendored
Normal file
27
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Description
|
||||||
|
|
||||||
|
<_Include a description of the change and why this change was made._>
|
||||||
|
|
||||||
|
<_For each item, place an "x" in between `[` and `]` if true. Example: `[x]` (you can also check items in GitHub UI)_>
|
||||||
|
|
||||||
|
<_Create the PR as a Draft PR if it is only created to run CI checks._>
|
||||||
|
|
||||||
|
<_Delete lines in \<\> tags before creating the PR._>
|
||||||
|
|
||||||
|
- [ ] Breaking change?
|
||||||
|
- **Breaking change** - Will this cause a break in build or boot behavior?
|
||||||
|
- Examples: Add a new library class or move a module to a different repo.
|
||||||
|
- [ ] Impacts security?
|
||||||
|
- **Security** - Does the change have a direct security impact?
|
||||||
|
- Examples: Crypto algorithm change or buffer overflow fix.
|
||||||
|
- [ ] Includes tests?
|
||||||
|
- **Tests** - Does the change include any explicit test code?
|
||||||
|
- Examples: Unit tests or integration tests.
|
||||||
|
|
||||||
|
## How This Was Tested
|
||||||
|
|
||||||
|
<_Describe the test(s) that were run to verify the changes._>
|
||||||
|
|
||||||
|
## Integration Instructions
|
||||||
|
|
||||||
|
<_Describe how these changes should be integrated. Use N/A if nothing is required._>
|
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
|
|
361
.github/workflows/codeql.yml
vendored
Normal file
361
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
# This workflow runs CodeQL against the repository.
|
||||||
|
#
|
||||||
|
# Results are uploaded to GitHub Code Scanning.
|
||||||
|
#
|
||||||
|
# Due to a known issue with the CodeQL extractor when building the edk2
|
||||||
|
# codebase on Linux systems, only Windows agents are used for build with
|
||||||
|
# the VS toolchain.
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- '!**.c'
|
||||||
|
- '!**.h'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: windows-2019
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- Package: "ArmPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "CryptoPkg"
|
||||||
|
ArchList: "IA32"
|
||||||
|
- Package: "CryptoPkg"
|
||||||
|
ArchList: "X64"
|
||||||
|
- Package: "DynamicTablesPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "FatPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "FmpDevicePkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "IntelFsp2Pkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "IntelFsp2WrapperPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "MdeModulePkg"
|
||||||
|
ArchList: "IA32"
|
||||||
|
- Package: "MdeModulePkg"
|
||||||
|
ArchList: "X64"
|
||||||
|
- Package: "MdePkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "PcAtChipsetPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "PrmPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "SecurityPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "ShellPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "SourceLevelDebugPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "StandaloneMmPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "UefiCpuPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
- Package: "UnitTestFrameworkPkg"
|
||||||
|
ArchList: "IA32,X64"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
cache: 'pip'
|
||||||
|
cache-dependency-path: 'pip-requirements.txt'
|
||||||
|
|
||||||
|
- name: Use Git Long Paths on Windows
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
git config --system core.longpaths true
|
||||||
|
|
||||||
|
- name: Install/Upgrade pip Modules
|
||||||
|
run: pip install -r pip-requirements.txt --upgrade requests sarif-tools
|
||||||
|
|
||||||
|
- name: Determine CI Settings File Supported Operations
|
||||||
|
id: get_ci_file_operations
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import importlib
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
from edk2toolext.invocables.edk2_ci_setup import CiSetupSettingsManager
|
||||||
|
from edk2toolext.invocables.edk2_setup import SetupSettingsManager
|
||||||
|
|
||||||
|
# Find the repo CI Settings file
|
||||||
|
ci_settings_file = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/CISettings.py'))
|
||||||
|
|
||||||
|
# Note: At this point, submodules have not been pulled, only one CI Settings file should exist
|
||||||
|
if len(ci_settings_file) != 1 or not ci_settings_file[0].is_file():
|
||||||
|
print("::error title=Workspace Error!::Failed to find CI Settings file!")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
ci_settings_file = ci_settings_file[0]
|
||||||
|
|
||||||
|
# Try Finding the Settings class in the file
|
||||||
|
module_name = 'ci_settings'
|
||||||
|
|
||||||
|
spec = importlib.util.spec_from_file_location(module_name, ci_settings_file)
|
||||||
|
module = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(module)
|
||||||
|
|
||||||
|
try:
|
||||||
|
settings = getattr(module, 'Settings')
|
||||||
|
except AttributeError:
|
||||||
|
print("::error title=Workspace Error!::Failed to find Settings class in CI Settings file!")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Determine Which Operations Are Supported by the Settings Class
|
||||||
|
ci_setup_supported = issubclass(settings, CiSetupSettingsManager)
|
||||||
|
setup_supported = issubclass(settings, SetupSettingsManager)
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
|
||||||
|
print(f'ci_setup_supported={str(ci_setup_supported).lower()}', file=fh)
|
||||||
|
print(f'setup_supported={str(setup_supported).lower()}', file=fh)
|
||||||
|
|
||||||
|
- name: Convert Arch to Log Format
|
||||||
|
id: convert_arch_hyphen
|
||||||
|
env:
|
||||||
|
ARCH_LIST: ${{ matrix.ArchList }}
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import os
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
|
||||||
|
print(f'arch_list={os.environ["ARCH_LIST"].replace(",", "-")}', file=fh)
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
|
||||||
|
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
|
||||||
|
|
||||||
|
- name: Upload Setup Log As An Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: (success() || failure()) && steps.get_ci_file_operations.outputs.setup_supported == 'true'
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Setup-Log
|
||||||
|
path: |
|
||||||
|
**/SETUPLOG.txt
|
||||||
|
retention-days: 7
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
- name: CI Setup
|
||||||
|
if: steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
|
||||||
|
run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
|
||||||
|
|
||||||
|
- name: Upload CI Setup Log As An Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: (success() || failure()) && steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CI-Setup-Log
|
||||||
|
path: |
|
||||||
|
**/CISETUP.txt
|
||||||
|
retention-days: 7
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
- name: Update
|
||||||
|
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
|
||||||
|
|
||||||
|
- name: Upload Update Log As An Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: success() || failure()
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Update-Log
|
||||||
|
path: |
|
||||||
|
**/UPDATE_LOG.txt
|
||||||
|
retention-days: 7
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
- name: Build Tools From Source
|
||||||
|
run: python BaseTools/Edk2ToolsBuild.py -t VS2019
|
||||||
|
|
||||||
|
- name: Find CodeQL Plugin Directory
|
||||||
|
id: find_dir
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Find the plugin directory that contains the CodeQL plugin
|
||||||
|
plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('BaseTools/Plugin/CodeQL'))
|
||||||
|
|
||||||
|
# This should only be found once
|
||||||
|
if len(plugin_dir) == 1:
|
||||||
|
plugin_dir = str(plugin_dir[0])
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
|
||||||
|
print(f'codeql_plugin_dir={plugin_dir}', file=fh)
|
||||||
|
else:
|
||||||
|
print("::error title=Workspace Error!::Failed to find CodeQL plugin directory!")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
- name: Get CodeQL CLI Cache Data
|
||||||
|
id: cache_key_gen
|
||||||
|
env:
|
||||||
|
CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }}
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import os
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
codeql_cli_ext_dep_name = 'codeqlcli_windows_ext_dep'
|
||||||
|
codeql_plugin_file = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep_name + '.yaml')
|
||||||
|
|
||||||
|
with open (codeql_plugin_file) as pf:
|
||||||
|
codeql_cli_ext_dep = yaml.safe_load(pf)
|
||||||
|
|
||||||
|
cache_key_name = codeql_cli_ext_dep['name']
|
||||||
|
cache_key_version = codeql_cli_ext_dep['version']
|
||||||
|
cache_key = f'{cache_key_name}-{cache_key_version}'
|
||||||
|
|
||||||
|
codeql_plugin_cli_ext_dep_dir = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep['name'].strip() + '_extdep')
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
|
||||||
|
print(f'codeql_cli_cache_key={cache_key}', file=fh)
|
||||||
|
print(f'codeql_cli_ext_dep_dir={codeql_plugin_cli_ext_dep_dir}', file=fh)
|
||||||
|
|
||||||
|
- name: Attempt to Load CodeQL CLI From Cache
|
||||||
|
id: codeqlcli_cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
|
||||||
|
key: ${{ steps.cache_key_gen.outputs.codeql_cli_cache_key }}
|
||||||
|
|
||||||
|
- name: Download CodeQL CLI
|
||||||
|
if: steps.codeqlcli_cache.outputs.cache-hit != 'true'
|
||||||
|
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019 --codeql
|
||||||
|
|
||||||
|
- name: Remove CI Plugins Irrelevant to CodeQL
|
||||||
|
shell: python
|
||||||
|
env:
|
||||||
|
CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }}
|
||||||
|
run: |
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Only these two plugins are needed for CodeQL
|
||||||
|
plugins_to_keep = ['CompilerPlugin']
|
||||||
|
|
||||||
|
plugin_dir = Path('.pytool/Plugin').absolute()
|
||||||
|
if plugin_dir.is_dir():
|
||||||
|
for dir in plugin_dir.iterdir():
|
||||||
|
if str(dir.stem) not in plugins_to_keep:
|
||||||
|
shutil.rmtree(str(dir.absolute()), ignore_errors=True)
|
||||||
|
|
||||||
|
- name: CI Build
|
||||||
|
env:
|
||||||
|
STUART_CODEQL_PATH: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
|
||||||
|
run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.Package }} -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019 --codeql
|
||||||
|
|
||||||
|
- name: Build Cleanup
|
||||||
|
id: build_cleanup
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
dirs_to_delete = ['ia32', 'x64', 'arm', 'aarch64']
|
||||||
|
|
||||||
|
def delete_dirs(path: Path):
|
||||||
|
if path.exists() and path.is_dir():
|
||||||
|
if path.name.lower() in dirs_to_delete:
|
||||||
|
print(f'Removed {str(path)}')
|
||||||
|
shutil.rmtree(path)
|
||||||
|
return
|
||||||
|
|
||||||
|
for child_dir in path.iterdir():
|
||||||
|
delete_dirs(child_dir)
|
||||||
|
|
||||||
|
build_path = Path(os.environ['GITHUB_WORKSPACE'], 'Build')
|
||||||
|
delete_dirs(build_path)
|
||||||
|
|
||||||
|
- name: Upload Build Logs As An Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: success() || failure()
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Build-Logs
|
||||||
|
path: |
|
||||||
|
**/BUILD_REPORT.TXT
|
||||||
|
**/OVERRIDELOG.TXT
|
||||||
|
**/BUILDLOG_*.md
|
||||||
|
**/BUILDLOG_*.txt
|
||||||
|
**/CI_*.md
|
||||||
|
**/CI_*.txt
|
||||||
|
retention-days: 7
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
- name: Prepare Env Data for CodeQL Upload
|
||||||
|
id: env_data
|
||||||
|
env:
|
||||||
|
PACKAGE_NAME: ${{ matrix.Package }}
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from edk2toollib.utility_functions import RunCmd
|
||||||
|
from io import StringIO
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
package = os.environ['PACKAGE_NAME'].strip().lower()
|
||||||
|
directory_name = 'codeql-analysis-' + package + '-debug'
|
||||||
|
file_name = 'codeql-db-' + package + '-debug-0.sarif'
|
||||||
|
sarif_path = Path('Build', directory_name, file_name)
|
||||||
|
|
||||||
|
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
|
||||||
|
if sarif_path.is_file():
|
||||||
|
emacs_file_path = sarif_path.with_name(sarif_path.stem + "-emacs.txt")
|
||||||
|
out_stream_buffer = StringIO()
|
||||||
|
exit_code = RunCmd("sarif", f"emacs {sarif_path} --output {emacs_file_path} --no-autotrim",
|
||||||
|
outstream=out_stream_buffer,
|
||||||
|
logging_level=logging.NOTSET)
|
||||||
|
print(f'upload_sarif_file=true', file=fh)
|
||||||
|
print(f'emacs_file_path={emacs_file_path}', file=fh)
|
||||||
|
print(f'sarif_file_path={sarif_path}', file=fh)
|
||||||
|
else:
|
||||||
|
print(f'upload_sarif_file=false', file=fh)
|
||||||
|
|
||||||
|
- name: Upload CodeQL Results (SARIF) As An Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: steps.env_data.outputs.upload_sarif_file == 'true'
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CodeQL-SARIF
|
||||||
|
path: |
|
||||||
|
${{ steps.env_data.outputs.emacs_file_path }}
|
||||||
|
${{ steps.env_data.outputs.sarif_file_path }}
|
||||||
|
retention-days: 14
|
||||||
|
if-no-files-found: warn
|
||||||
|
|
||||||
|
- name: Upload CodeQL Results (SARIF) To GitHub Code Scanning
|
||||||
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
|
if: steps.env_data.outputs.upload_sarif_file == 'true'
|
||||||
|
with:
|
||||||
|
# Path to SARIF file relative to the root of the repository.
|
||||||
|
sarif_file: ${{ steps.env_data.outputs.sarif_file_path }}
|
||||||
|
# Optional category for the results. Used to differentiate multiple results for one commit.
|
||||||
|
# Each package is a separate category.
|
||||||
|
category: ${{ matrix.Package }}
|
36
.github/workflows/pr-labeler.yml
vendored
Normal file
36
.github/workflows/pr-labeler.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# This workflow automatically applies labels to pull requests based on regular expression matches against the content
|
||||||
|
# in the pull request.
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
# For more information, see:
|
||||||
|
# https://github.com/github/issue-labeler
|
||||||
|
|
||||||
|
name: Apply Labels Based on Message Content
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- edited
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
name: Label PR from Description
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Apply Labels Based on PR Description
|
||||||
|
uses: github/issue-labeler@v3.1
|
||||||
|
with:
|
||||||
|
configuration-path: .github/workflows/pr-labeler/regex.yml
|
||||||
|
enable-versioned-regex: 0
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
16
.github/workflows/pr-labeler/regex.yml
vendored
Normal file
16
.github/workflows/pr-labeler/regex.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Specifies labels to apply to pull requests based on regular expressions.
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
# For more information, see:
|
||||||
|
# https://github.com/github/issue-labeler
|
||||||
|
|
||||||
|
impact:breaking-change:
|
||||||
|
- '\s*-\s*\[\s*[x|X]\s*\] Breaking change\?'
|
||||||
|
|
||||||
|
impact:security:
|
||||||
|
- '\s*-\s*\[\s*[x|X]\s*\] Impacts security\?'
|
||||||
|
|
||||||
|
impact:testing:
|
||||||
|
- '\s*-\s*\[\s*[x|X]\s*\] Includes tests\?'
|
44
.github/workflows/stale.yml
vendored
Normal file
44
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# This workflow warns and then closes issues and PRs that have had no activity
|
||||||
|
# for a specified amount of time.
|
||||||
|
#
|
||||||
|
# For more information, see:
|
||||||
|
# https://github.com/actions/stale
|
||||||
|
#
|
||||||
|
# Copyright (c) Microsoft Corporation.
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
|
||||||
|
name: Stale Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# At 23:35 on every day-of-week from Sunday through Saturday
|
||||||
|
# https://crontab.guru/#35_23_*_*_0-6
|
||||||
|
- cron: '35 23 * * 0-6'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
name: Stale
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check for Stale Items
|
||||||
|
uses: actions/stale@v8
|
||||||
|
with:
|
||||||
|
days-before-issue-close: -1
|
||||||
|
days-before-issue-stale: -1
|
||||||
|
days-before-pr-stale: 60
|
||||||
|
days-before-pr-close: 7
|
||||||
|
stale-pr-message: >
|
||||||
|
This PR has been automatically marked as stale because it has not had
|
||||||
|
activity in 60 days. It will be closed if no further activity occurs within
|
||||||
|
7 days. Thank you for your contributions.
|
||||||
|
close-pr-message: >
|
||||||
|
This pull request has been automatically been closed because it did not have any
|
||||||
|
activity in 60 days and no follow up within 7 days after being marked stale.
|
||||||
|
Thank you for your contributions.
|
||||||
|
stale-pr-label: stale
|
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -23,3 +23,18 @@
|
|||||||
[submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
|
[submodule "UnitTestFrameworkPkg/Library/GoogleTestLib/googletest"]
|
||||||
path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
|
path = UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
|
||||||
url = https://github.com/google/googletest.git
|
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
|
||||||
|
@@ -7,12 +7,27 @@
|
|||||||
##
|
##
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
from edk2toolext.environment import shell_environment
|
from edk2toolext.environment import shell_environment
|
||||||
from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager
|
from edk2toolext.invocables.edk2_ci_build import CiBuildSettingsManager
|
||||||
from edk2toolext.invocables.edk2_setup import SetupSettingsManager, RequiredSubmodule
|
from edk2toolext.invocables.edk2_setup import SetupSettingsManager, RequiredSubmodule
|
||||||
from edk2toolext.invocables.edk2_update import UpdateSettingsManager
|
from edk2toolext.invocables.edk2_update import UpdateSettingsManager
|
||||||
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
|
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
|
||||||
from edk2toollib.utility_functions import GetHostInfo
|
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):
|
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("-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")
|
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):
|
def RetrieveCommandLineOptions(self, args):
|
||||||
super().RetrieveCommandLineOptions(args)
|
super().RetrieveCommandLineOptions(args)
|
||||||
if args.force_piptools:
|
if args.force_piptools:
|
||||||
@@ -41,6 +61,11 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
if args.no_piptools:
|
if args.no_piptools:
|
||||||
self.UseBuiltInBaseTools = False
|
self.UseBuiltInBaseTools = False
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.codeql = codeql_helpers.is_codeql_enabled_on_command_line(args)
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
|
|
||||||
# ####################################################################################### #
|
# ####################################################################################### #
|
||||||
# Default Support for this Ci Build #
|
# Default Support for this Ci Build #
|
||||||
# ####################################################################################### #
|
# ####################################################################################### #
|
||||||
@@ -169,6 +194,17 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
else:
|
else:
|
||||||
logging.warning("Falling back to using in-tree BaseTools")
|
logging.warning("Falling back to using in-tree BaseTools")
|
||||||
|
|
||||||
|
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
|
self.ActualScopes = scopes
|
||||||
return self.ActualScopes
|
return self.ActualScopes
|
||||||
|
|
||||||
@@ -193,6 +229,16 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
|
|||||||
"BaseTools/Source/C/BrotliCompress/brotli", False))
|
"BaseTools/Source/C/BrotliCompress/brotli", False))
|
||||||
rs.append(RequiredSubmodule(
|
rs.append(RequiredSubmodule(
|
||||||
"RedfishPkg/Library/JsonLib/jansson", False))
|
"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
|
return rs
|
||||||
|
|
||||||
def GetName(self):
|
def GetName(self):
|
||||||
|
@@ -93,9 +93,7 @@ class CharEncodingCheck(ICiBuildPlugin):
|
|||||||
files = [Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(x) for x in files]
|
files = [Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(x) for x in files]
|
||||||
for a in files:
|
for a in files:
|
||||||
files_tested += 1
|
files_tested += 1
|
||||||
if(self.TestEncodingOk(a, enc)):
|
if not self.TestEncodingOk(a, enc):
|
||||||
logging.debug("File {0} Passed Encoding Check {1}".format(a, enc))
|
|
||||||
else:
|
|
||||||
tc.LogStdError("Encoding Failure in {0}. Not {1}".format(a, enc))
|
tc.LogStdError("Encoding Failure in {0}. Not {1}".format(a, enc))
|
||||||
overall_status += 1
|
overall_status += 1
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin
|
from edk2toolext.environment.plugintypes.ci_build_plugin import ICiBuildPlugin
|
||||||
from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser
|
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
|
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
|
# should compile test a library that is declared type HOST_APPLICATION
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif len(infp.SupportedPhases) > 0 and \
|
elif (len(infp.SupportedPhases) > 0 and
|
||||||
"HOST_APPLICATION" in infp.SupportedPhases:
|
"HOST_APPLICATION" in infp.SupportedPhases and
|
||||||
|
infp.SupportedPhases != AllPhases):
|
||||||
# should compile test a library that supports HOST_APPLICATION but
|
# should compile test a library that supports HOST_APPLICATION but
|
||||||
# require it to be an explicit opt-in
|
# require it to be an explicit opt-in
|
||||||
pass
|
pass
|
||||||
|
@@ -12,6 +12,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
|
import stat
|
||||||
import timeit
|
import timeit
|
||||||
from edk2toolext.environment import version_aggregator
|
from edk2toolext.environment import version_aggregator
|
||||||
from edk2toolext.environment.plugin_manager import PluginManager
|
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 add any additional paths with "AdditionalIncludePaths"
|
||||||
# A package can remove any of these paths with "IgnoreStandardPaths"
|
# 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
|
# 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 git is not found, an empty list will be returned.
|
||||||
"""
|
"""
|
||||||
if not shutil.which("git"):
|
if not shutil.which("git"):
|
||||||
logging.warn(
|
logging.warning(
|
||||||
"Git is not found on this system. Git submodule paths will not be considered.")
|
"Git is not found on this system. Git submodule paths will not be considered.")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -325,7 +326,7 @@ class UncrustifyCheck(ICiBuildPlugin):
|
|||||||
If git is not found, an empty list will be returned.
|
If git is not found, an empty list will be returned.
|
||||||
"""
|
"""
|
||||||
if not shutil.which("git"):
|
if not shutil.which("git"):
|
||||||
logging.warn(
|
logging.warning(
|
||||||
"Git is not found on this system. Git submodule paths will not be considered.")
|
"Git is not found on this system. Git submodule paths will not be considered.")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -372,9 +373,9 @@ class UncrustifyCheck(ICiBuildPlugin):
|
|||||||
file_template_path = pathlib.Path(os.path.join(self._plugin_path, file_template_name))
|
file_template_path = pathlib.Path(os.path.join(self._plugin_path, file_template_name))
|
||||||
self._file_template_contents = file_template_path.read_text()
|
self._file_template_contents = file_template_path.read_text()
|
||||||
except KeyError:
|
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:
|
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:
|
try:
|
||||||
func_template_name = parser["dummy_section"]["cmt_insert_func_header"]
|
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))
|
func_template_path = pathlib.Path(os.path.join(self._plugin_path, func_template_name))
|
||||||
self._func_template_contents = func_template_path.read_text()
|
self._func_template_contents = func_template_path.read_text()
|
||||||
except KeyError:
|
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:
|
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:
|
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.
|
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)
|
func(path)
|
||||||
|
|
||||||
for _ in range(3): # retry up to 3 times
|
for _ in range(3): # retry up to 3 times
|
||||||
|
@@ -215,7 +215,7 @@ indent_braces = false
|
|||||||
indent_braces_no_class = false
|
indent_braces_no_class = false
|
||||||
indent_braces_no_func = true
|
indent_braces_no_func = true
|
||||||
indent_braces_no_struct = false
|
indent_braces_no_struct = false
|
||||||
indent_class = false
|
indent_class = true
|
||||||
indent_class_colon = false
|
indent_class_colon = false
|
||||||
indent_cmt_with_tabs = false # Whether to indent comments that are not at a brace level with tabs on
|
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.
|
# 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_col1_multi_string_literal= true
|
||||||
indent_comma_paren = true
|
indent_comma_paren = true
|
||||||
indent_else_if = true
|
indent_else_if = true
|
||||||
indent_extern = false
|
indent_extern = true
|
||||||
indent_first_bool_expr = true
|
indent_first_bool_expr = true
|
||||||
|
|
||||||
indent_func_def_param_paren_pos_threshold = 0
|
indent_func_def_param_paren_pos_threshold = 0
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
"type": "nuget",
|
"type": "nuget",
|
||||||
"name": "mu-uncrustify-release",
|
"name": "mu-uncrustify-release",
|
||||||
"source": "https://pkgs.dev.azure.com/projectmu/Uncrustify/_packaging/mu_uncrustify/nuget/v3/index.json",
|
"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"],
|
"flags": ["set_shell_var", "host_specific"],
|
||||||
"var_name": "UNCRUSTIFY_CI_PATH"
|
"var_name": "UNCRUSTIFY_CI_PATH"
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ on the TianoCore wiki.
|
|||||||
| ArmPlatformPkg | | :heavy_check_mark: |
|
| ArmPlatformPkg | | :heavy_check_mark: |
|
||||||
| ArmVirtPkg | SEE PACKAGE README | SEE PACKAGE README |
|
| ArmVirtPkg | SEE PACKAGE README | SEE PACKAGE README |
|
||||||
| CryptoPkg | :heavy_check_mark: | :heavy_check_mark: | Spell checking in audit mode
|
| CryptoPkg | :heavy_check_mark: | :heavy_check_mark: | Spell checking in audit mode
|
||||||
| DynamicTablesPkg | | :heavy_check_mark: |
|
| DynamicTablesPkg | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| EmbeddedPkg |
|
| EmbeddedPkg |
|
||||||
| EmulatorPkg | SEE PACKAGE README | SEE PACKAGE README | Spell checking in audit mode
|
| EmulatorPkg | SEE PACKAGE README | SEE PACKAGE README | Spell checking in audit mode
|
||||||
| FatPkg | :heavy_check_mark: | :heavy_check_mark: |
|
| FatPkg | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
|
@@ -239,5 +239,10 @@
|
|||||||
],
|
],
|
||||||
"AdditionalIncludePaths": [] # Additional paths to spell check
|
"AdditionalIncludePaths": [] # Additional paths to spell check
|
||||||
# (wildcards supported)
|
# (wildcards supported)
|
||||||
|
},
|
||||||
|
|
||||||
|
# options defined in .pytool/Plugin/UncrustifyCheck
|
||||||
|
"UncrustifyCheck": {
|
||||||
|
"AuditOnly": True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# ARM processor package.
|
# ARM processor package.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
|
# 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.
|
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -139,10 +139,10 @@
|
|||||||
# Define if the GICv3 controller should use the GICv2 legacy
|
# Define if the GICv3 controller should use the GICv2 legacy
|
||||||
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042
|
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x00000042
|
||||||
|
|
||||||
## Define the conduit to use for monitor calls.
|
# Whether to remap all unused memory NX before installing the CPU arch
|
||||||
# Default PcdMonitorConduitHvc = FALSE, conduit = SMC
|
# protocol driver. This is needed on platforms that map all DRAM with RWX
|
||||||
# If PcdMonitorConduitHvc = TRUE, conduit = HVC
|
# attributes initially, and can be disabled otherwise.
|
||||||
gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x00000047
|
gArmTokenSpaceGuid.PcdRemapUnusedMemoryNx|TRUE|BOOLEAN|0x00000048
|
||||||
|
|
||||||
[PcdsFeatureFlag.ARM]
|
[PcdsFeatureFlag.ARM]
|
||||||
# Whether to map normal memory as non-shareable. FALSE is the safe choice, but
|
# Whether to map normal memory as non-shareable. FALSE is the safe choice, but
|
||||||
@@ -221,6 +221,13 @@
|
|||||||
#
|
#
|
||||||
gArmTokenSpaceGuid.PcdArmDmaDeviceOffset|0x0|UINT64|0x0000044
|
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]
|
[PcdsFixedAtBuild.common, PcdsPatchableInModule.common]
|
||||||
gArmTokenSpaceGuid.PcdFdBaseAddress|0|UINT64|0x0000002B
|
gArmTokenSpaceGuid.PcdFdBaseAddress|0|UINT64|0x0000002B
|
||||||
gArmTokenSpaceGuid.PcdFvBaseAddress|0|UINT64|0x0000002D
|
gArmTokenSpaceGuid.PcdFvBaseAddress|0|UINT64|0x0000002D
|
||||||
@@ -305,6 +312,11 @@
|
|||||||
gArmTokenSpaceGuid.PcdSystemBiosRelease|0xFFFF|UINT16|0x30000058
|
gArmTokenSpaceGuid.PcdSystemBiosRelease|0xFFFF|UINT16|0x30000058
|
||||||
gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease|0xFFFF|UINT16|0x30000059
|
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]
|
[PcdsFixedAtBuild.common, PcdsDynamic.common]
|
||||||
#
|
#
|
||||||
# ARM Architectural Timer
|
# ARM Architectural Timer
|
||||||
@@ -316,6 +328,7 @@
|
|||||||
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|30|UINT32|0x00000036
|
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|30|UINT32|0x00000036
|
||||||
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|26|UINT32|0x00000040
|
gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|26|UINT32|0x00000040
|
||||||
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|27|UINT32|0x00000041
|
gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|27|UINT32|0x00000041
|
||||||
|
gArmTokenSpaceGuid.PcdArmArchTimerHypVirtIntrNum|28|UINT32|0x0000004A
|
||||||
|
|
||||||
#
|
#
|
||||||
# ARM Generic Watchdog
|
# ARM Generic Watchdog
|
||||||
|
@@ -162,6 +162,8 @@
|
|||||||
ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
|
ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
|
||||||
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
|
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
|
||||||
|
|
||||||
|
ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf
|
||||||
|
|
||||||
[Components.AARCH64]
|
[Components.AARCH64]
|
||||||
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
|
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
|
||||||
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
|
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -8,20 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
|
|
||||||
#include "ArmGicDxe.h"
|
#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
|
// Making this global saves a few bytes in image size
|
||||||
EFI_HANDLE gHardwareInterruptHandle = NULL;
|
EFI_HANDLE gHardwareInterruptHandle = NULL;
|
||||||
|
|
||||||
@@ -61,7 +47,7 @@ GicGetDistributorIcfgBaseAndBit (
|
|||||||
|
|
||||||
RegIndex = Source / ARM_GIC_ICDICFR_F_STRIDE; // NOTE: truncation is significant
|
RegIndex = Source / ARM_GIC_ICDICFR_F_STRIDE; // NOTE: truncation is significant
|
||||||
Field = Source % ARM_GIC_ICDICFR_F_STRIDE;
|
Field = Source % ARM_GIC_ICDICFR_F_STRIDE;
|
||||||
*RegAddress = PcdGet64 (PcdGicDistributorBase)
|
*RegAddress = (UINTN)PcdGet64 (PcdGicDistributorBase)
|
||||||
+ ARM_GIC_ICDICFR
|
+ ARM_GIC_ICDICFR
|
||||||
+ (ARM_GIC_ICDICFR_BYTES * RegIndex);
|
+ (ARM_GIC_ICDICFR_BYTES * RegIndex);
|
||||||
*Config1Bit = ((Field * ARM_GIC_ICDICFR_F_WIDTH)
|
*Config1Bit = ((Field * ARM_GIC_ICDICFR_F_WIDTH)
|
||||||
@@ -137,7 +123,7 @@ CpuArchEventProtocolNotify (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
@@ -153,7 +139,7 @@ CpuArchEventProtocolNotify (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
"%a: Cpu->RegisterInterruptHandler() - %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -104,10 +104,17 @@ GicGetCpuRedistributorBase (
|
|||||||
return 0;
|
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
|
EFIAPI
|
||||||
ArmGicGetInterfaceIdentification (
|
ArmGicGetInterfaceIdentification (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Read the GIC Identification Register
|
// Read the GIC Identification Register
|
||||||
@@ -117,7 +124,7 @@ ArmGicGetInterfaceIdentification (
|
|||||||
UINTN
|
UINTN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicGetMaxNumInterrupts (
|
ArmGicGetMaxNumInterrupts (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN ItLines;
|
UINTN ItLines;
|
||||||
@@ -133,15 +140,17 @@ ArmGicGetMaxNumInterrupts (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicSendSgiTo (
|
ArmGicSendSgiTo (
|
||||||
IN INTN GicDistributorBase,
|
IN UINTN GicDistributorBase,
|
||||||
IN INTN TargetListFilter,
|
IN UINT8 TargetListFilter,
|
||||||
IN INTN CPUTargetList,
|
IN UINT8 CPUTargetList,
|
||||||
IN INTN SgiId
|
IN UINT8 SgiId
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
MmioWrite32 (
|
MmioWrite32 (
|
||||||
GicDistributorBase + ARM_GIC_ICDSGIR,
|
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 Value;
|
||||||
|
UINTN IntId;
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
|
|
||||||
|
ASSERT (InterruptId != NULL);
|
||||||
Revision = ArmGicGetSupportedArchRevision ();
|
Revision = ArmGicGetSupportedArchRevision ();
|
||||||
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
||||||
Value = ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase);
|
Value = ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase);
|
||||||
// InterruptId is required for the caller to know if a valid or spurious
|
IntId = Value & ARM_GIC_ICCIAR_ACKINTID;
|
||||||
// interrupt has been read
|
|
||||||
ASSERT (InterruptId != NULL);
|
|
||||||
if (InterruptId != NULL) {
|
|
||||||
*InterruptId = Value & ARM_GIC_ICCIAR_ACKINTID;
|
|
||||||
}
|
|
||||||
} else if (Revision == ARM_GIC_ARCH_REVISION_3) {
|
} else if (Revision == ARM_GIC_ARCH_REVISION_3) {
|
||||||
Value = ArmGicV3AcknowledgeInterrupt ();
|
Value = ArmGicV3AcknowledgeInterrupt ();
|
||||||
|
IntId = Value;
|
||||||
} else {
|
} else {
|
||||||
ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
|
ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
|
||||||
// Report Spurious interrupt which is what the above controllers would
|
// Report Spurious interrupt which is what the above controllers would
|
||||||
@@ -187,6 +194,12 @@ ArmGicAcknowledgeInterrupt (
|
|||||||
Value = 1023;
|
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;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,13 +232,13 @@ ArmGicSetInterruptPriority (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 RegOffset;
|
UINT32 RegOffset;
|
||||||
UINTN RegShift;
|
UINT8 RegShift;
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
UINTN GicCpuRedistributorBase;
|
UINTN GicCpuRedistributorBase;
|
||||||
|
|
||||||
// Calculate register offset and bit position
|
// Calculate register offset and bit position
|
||||||
RegOffset = Source / 4;
|
RegOffset = (UINT32)(Source / 4);
|
||||||
RegShift = (Source % 4) * 8;
|
RegShift = (UINT8)((Source % 4) * 8);
|
||||||
|
|
||||||
Revision = ArmGicGetSupportedArchRevision ();
|
Revision = ArmGicGetSupportedArchRevision ();
|
||||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||||
@@ -263,13 +276,13 @@ ArmGicEnableInterrupt (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 RegOffset;
|
UINT32 RegOffset;
|
||||||
UINTN RegShift;
|
UINT8 RegShift;
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
UINTN GicCpuRedistributorBase;
|
UINTN GicCpuRedistributorBase;
|
||||||
|
|
||||||
// Calculate enable register offset and bit position
|
// Calculate enable register offset and bit position
|
||||||
RegOffset = Source / 32;
|
RegOffset = (UINT32)(Source / 32);
|
||||||
RegShift = Source % 32;
|
RegShift = (UINT8)(Source % 32);
|
||||||
|
|
||||||
Revision = ArmGicGetSupportedArchRevision ();
|
Revision = ArmGicGetSupportedArchRevision ();
|
||||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||||
@@ -308,13 +321,13 @@ ArmGicDisableInterrupt (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 RegOffset;
|
UINT32 RegOffset;
|
||||||
UINTN RegShift;
|
UINT8 RegShift;
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
UINTN GicCpuRedistributorBase;
|
UINTN GicCpuRedistributorBase;
|
||||||
|
|
||||||
// Calculate enable register offset and bit position
|
// Calculate enable register offset and bit position
|
||||||
RegOffset = Source / 32;
|
RegOffset = (UINT32)(Source / 32);
|
||||||
RegShift = Source % 32;
|
RegShift = (UINT8)(Source % 32);
|
||||||
|
|
||||||
Revision = ArmGicGetSupportedArchRevision ();
|
Revision = ArmGicGetSupportedArchRevision ();
|
||||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||||
@@ -352,14 +365,14 @@ ArmGicIsInterruptEnabled (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 RegOffset;
|
UINT32 RegOffset;
|
||||||
UINTN RegShift;
|
UINT8 RegShift;
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
UINTN GicCpuRedistributorBase;
|
UINTN GicCpuRedistributorBase;
|
||||||
UINT32 Interrupts;
|
UINT32 Interrupts;
|
||||||
|
|
||||||
// Calculate enable register offset and bit position
|
// Calculate enable register offset and bit position
|
||||||
RegOffset = Source / 32;
|
RegOffset = (UINT32)(Source / 32);
|
||||||
RegShift = Source % 32;
|
RegShift = (UINT8)(Source % 32);
|
||||||
|
|
||||||
Revision = ArmGicGetSupportedArchRevision ();
|
Revision = ArmGicGetSupportedArchRevision ();
|
||||||
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
if ((Revision == ARM_GIC_ARCH_REVISION_2) ||
|
||||||
@@ -390,7 +403,7 @@ ArmGicIsInterruptEnabled (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicDisableDistributor (
|
ArmGicDisableDistributor (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Disable Gic Distributor
|
// Disable Gic Distributor
|
||||||
@@ -400,7 +413,7 @@ ArmGicDisableDistributor (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicEnableInterruptInterface (
|
ArmGicEnableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
@@ -418,7 +431,7 @@ ArmGicEnableInterruptInterface (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicDisableInterruptInterface (
|
ArmGicDisableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -13,10 +13,11 @@
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicEnableDistributor (
|
ArmGicEnableDistributor (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ARM_GIC_ARCH_REVISION Revision;
|
ARM_GIC_ARCH_REVISION Revision;
|
||||||
|
UINT32 GicDistributorCtl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable GIC distributor in Non-Secure world.
|
* Enable GIC distributor in Non-Secure world.
|
||||||
@@ -26,7 +27,8 @@ ArmGicEnableDistributor (
|
|||||||
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
||||||
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||||
} else {
|
} 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);
|
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
||||||
} else {
|
} else {
|
||||||
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>
|
Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>
|
||||||
Portions copyright (c) 2010, Apple Inc. 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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ Abstract:
|
|||||||
extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol;
|
extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol;
|
||||||
extern EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V2Protocol;
|
extern EFI_HARDWARE_INTERRUPT2_PROTOCOL gHardwareInterrupt2V2Protocol;
|
||||||
|
|
||||||
STATIC UINT32 mGicInterruptInterfaceBase;
|
STATIC UINTN mGicInterruptInterfaceBase;
|
||||||
STATIC UINT32 mGicDistributorBase;
|
STATIC UINTN mGicDistributorBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable interrupt source Source.
|
Enable interrupt source Source.
|
||||||
@@ -162,7 +162,7 @@ GicV2IrqInterruptHandler (
|
|||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 GicInterrupt;
|
UINTN GicInterrupt;
|
||||||
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
||||||
|
|
||||||
GicInterrupt = ArmGicV2AcknowledgeInterrupt (mGicInterruptInterfaceBase);
|
GicInterrupt = ArmGicV2AcknowledgeInterrupt (mGicInterruptInterfaceBase);
|
||||||
@@ -179,7 +179,7 @@ GicV2IrqInterruptHandler (
|
|||||||
// Call the registered interrupt handler.
|
// Call the registered interrupt handler.
|
||||||
InterruptHandler (GicInterrupt, SystemContext);
|
InterruptHandler (GicInterrupt, SystemContext);
|
||||||
} else {
|
} 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);
|
GicV2EndOfInterrupt (&gHardwareInterruptV2Protocol, GicInterrupt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,7 @@ GicV2ExitBootServicesEvent (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT32 GicInterrupt;
|
UINTN GicInterrupt;
|
||||||
|
|
||||||
// Disable all the interrupts
|
// Disable all the interrupts
|
||||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||||
@@ -393,23 +393,26 @@ GicV2DxeInitialize (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT32 RegOffset;
|
UINT32 RegOffset;
|
||||||
UINTN RegShift;
|
UINT8 RegShift;
|
||||||
UINT32 CpuTarget;
|
UINT32 CpuTarget;
|
||||||
|
|
||||||
// Make sure the Interrupt Controller Protocol is not already installed in
|
// Make sure the Interrupt Controller Protocol is not already installed in
|
||||||
// the system.
|
// the system.
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||||
|
|
||||||
mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase);
|
ASSERT (PcdGet64 (PcdGicInterruptInterfaceBase) <= MAX_UINTN);
|
||||||
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN);
|
||||||
|
|
||||||
|
mGicInterruptInterfaceBase = (UINTN)PcdGet64 (PcdGicInterruptInterfaceBase);
|
||||||
|
mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
|
||||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||||
|
|
||||||
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
for (Index = 0; Index < mGicNumInterrupts; Index++) {
|
||||||
GicV2DisableInterruptSource (&gHardwareInterruptV2Protocol, Index);
|
GicV2DisableInterruptSource (&gHardwareInterruptV2Protocol, Index);
|
||||||
|
|
||||||
// Set Priority
|
// Set Priority
|
||||||
RegOffset = Index / 4;
|
RegOffset = (UINT32)(Index / 4);
|
||||||
RegShift = (Index % 4) * 8;
|
RegShift = (UINT8)((Index % 4) * 8);
|
||||||
MmioAndThenOr32 (
|
MmioAndThenOr32 (
|
||||||
mGicDistributorBase + ARM_GIC_ICDIPR + (4 * RegOffset),
|
mGicDistributorBase + ARM_GIC_ICDIPR + (4 * RegOffset),
|
||||||
~(0xff << RegShift),
|
~(0xff << RegShift),
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
/** @file
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Library/ArmGicLib.h>
|
#include <Library/ArmGicLib.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/IoLib.h>
|
#include <Library/IoLib.h>
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
@@ -26,5 +27,6 @@ ArmGicV2EndOfInterrupt (
|
|||||||
IN UINTN Source
|
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
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicV2EnableInterruptInterface (
|
ArmGicV2EnableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -26,7 +26,7 @@ ArmGicV2EnableInterruptInterface (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicV2DisableInterruptInterface (
|
ArmGicV2DisableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Disable Gic Interface
|
// Disable Gic Interface
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -156,7 +156,7 @@ GicV3IrqInterruptHandler (
|
|||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 GicInterrupt;
|
UINTN GicInterrupt;
|
||||||
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
HARDWARE_INTERRUPT_HANDLER InterruptHandler;
|
||||||
|
|
||||||
GicInterrupt = ArmGicV3AcknowledgeInterrupt ();
|
GicInterrupt = ArmGicV3AcknowledgeInterrupt ();
|
||||||
@@ -173,7 +173,7 @@ GicV3IrqInterruptHandler (
|
|||||||
// Call the registered interrupt handler.
|
// Call the registered interrupt handler.
|
||||||
InterruptHandler (GicInterrupt, SystemContext);
|
InterruptHandler (GicInterrupt, SystemContext);
|
||||||
} else {
|
} 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);
|
GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, GicInterrupt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ GicV3DxeInitialize (
|
|||||||
// the system.
|
// the system.
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
|
||||||
|
|
||||||
mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
|
mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
|
||||||
mGicRedistributorsBase = PcdGet64 (PcdGicRedistributorsBase);
|
mGicRedistributorsBase = PcdGet64 (PcdGicRedistributorsBase);
|
||||||
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
|
||||||
|
|
||||||
|
@@ -103,7 +103,9 @@ DispatchCpu (
|
|||||||
|
|
||||||
ArmCallSmc (&Args);
|
ArmCallSmc (&Args);
|
||||||
|
|
||||||
if (Args.Arg0 != ARM_SMC_PSCI_RET_SUCCESS) {
|
if (Args.Arg0 == ARM_SMC_PSCI_RET_ALREADY_ON) {
|
||||||
|
Status = EFI_NOT_READY;
|
||||||
|
} else if (Args.Arg0 != ARM_SMC_PSCI_RET_SUCCESS) {
|
||||||
DEBUG ((DEBUG_ERROR, "PSCI_CPU_ON call failed: %d\n", Args.Arg0));
|
DEBUG ((DEBUG_ERROR, "PSCI_CPU_ON call failed: %d\n", Args.Arg0));
|
||||||
Status = EFI_DEVICE_ERROR;
|
Status = EFI_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/** @file
|
/** @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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
System Control and Management Interface V1.0
|
System Control and Management Interface V3.2, latest version at:
|
||||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
- https://developer.arm.com/documentation/den0056/latest/
|
||||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
@@ -416,6 +416,75 @@ PerformanceLevelGet (
|
|||||||
return EFI_SUCCESS;
|
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.
|
// Instance of the SCMI performance management protocol.
|
||||||
STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol = {
|
STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol = {
|
||||||
PerformanceGetVersion,
|
PerformanceGetVersion,
|
||||||
@@ -425,7 +494,8 @@ STATIC CONST SCMI_PERFORMANCE_PROTOCOL PerformanceProtocol = {
|
|||||||
PerformanceLimitsSet,
|
PerformanceLimitsSet,
|
||||||
PerformanceLimitsGet,
|
PerformanceLimitsGet,
|
||||||
PerformanceLevelSet,
|
PerformanceLevelSet,
|
||||||
PerformanceLevelGet
|
PerformanceLevelGet,
|
||||||
|
DescribeFastchannel,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Initialize performance management protocol and install on a given Handle.
|
/** 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 <Library/MemoryAllocationLib.h>
|
||||||
#include "CpuDxe.h"
|
#include "CpuDxe.h"
|
||||||
|
|
||||||
#define INVALID_ENTRY ((UINT32)~0)
|
#define INVALID_ENTRY ((UINT64)~0)
|
||||||
|
|
||||||
#define MIN_T0SZ 16
|
#define MIN_T0SZ 16
|
||||||
#define BITS_PER_LEVEL 9
|
#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
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
GetRootTranslationTableInfo (
|
GetRootTranslationTableInfo (
|
||||||
@@ -30,6 +38,13 @@ GetRootTranslationTableInfo (
|
|||||||
*RootTableEntryCount = TT_ENTRY_COUNT >> (T0SZ - MIN_T0SZ) % BITS_PER_LEVEL;
|
*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
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
PageAttributeToGcdAttribute (
|
PageAttributeToGcdAttribute (
|
||||||
@@ -64,6 +79,10 @@ PageAttributeToGcdAttribute (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine protection attributes
|
// Determine protection attributes
|
||||||
|
if ((PageAttributes & TT_AF) == 0) {
|
||||||
|
GcdAttributes |= EFI_MEMORY_RP;
|
||||||
|
}
|
||||||
|
|
||||||
if (((PageAttributes & TT_AP_MASK) == TT_AP_NO_RO) ||
|
if (((PageAttributes & TT_AP_MASK) == TT_AP_NO_RO) ||
|
||||||
((PageAttributes & TT_AP_MASK) == TT_AP_RO_RO))
|
((PageAttributes & TT_AP_MASK) == TT_AP_RO_RO))
|
||||||
{
|
{
|
||||||
@@ -79,6 +98,31 @@ PageAttributeToGcdAttribute (
|
|||||||
return GcdAttributes;
|
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
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
GetFirstPageAttribute (
|
GetFirstPageAttribute (
|
||||||
@@ -99,12 +143,25 @@ GetFirstPageAttribute (
|
|||||||
} else if (((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY) ||
|
} else if (((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY) ||
|
||||||
((TableLevel == 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY_LEVEL3)))
|
((TableLevel == 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENTRY_LEVEL3)))
|
||||||
{
|
{
|
||||||
return FirstEntry & TT_ATTR_INDX_MASK;
|
return FirstEntry & TT_ATTRIBUTES_MASK;
|
||||||
} else {
|
} else {
|
||||||
return INVALID_ENTRY;
|
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
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
GetNextEntryAttribute (
|
GetNextEntryAttribute (
|
||||||
@@ -112,14 +169,14 @@ GetNextEntryAttribute (
|
|||||||
IN UINTN EntryCount,
|
IN UINTN EntryCount,
|
||||||
IN UINTN TableLevel,
|
IN UINTN TableLevel,
|
||||||
IN UINT64 BaseAddress,
|
IN UINT64 BaseAddress,
|
||||||
IN OUT UINT32 *PrevEntryAttribute,
|
IN OUT UINT64 *PrevEntryAttribute,
|
||||||
IN OUT UINT64 *StartGcdRegion
|
IN OUT UINT64 *StartGcdRegion
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT64 Entry;
|
UINT64 Entry;
|
||||||
UINT32 EntryAttribute;
|
UINT64 EntryAttribute;
|
||||||
UINT32 EntryType;
|
UINT64 EntryType;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN NumberOfDescriptors;
|
UINTN NumberOfDescriptors;
|
||||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
||||||
@@ -127,17 +184,19 @@ GetNextEntryAttribute (
|
|||||||
// Get the memory space map from GCD
|
// Get the memory space map from GCD
|
||||||
MemorySpaceMap = NULL;
|
MemorySpaceMap = NULL;
|
||||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
// We cannot get more than 3-level page table
|
if (EFI_ERROR (Status) || (TableLevel > 3)) {
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
ASSERT (TableLevel <= 3);
|
ASSERT (TableLevel <= 3);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// While the top level table might not contain TT_ENTRY_COUNT entries;
|
// While the top level table might not contain TT_ENTRY_COUNT entries;
|
||||||
// the subsequent ones should be filled up
|
// the subsequent ones should be filled up
|
||||||
for (Index = 0; Index < EntryCount; Index++) {
|
for (Index = 0; Index < EntryCount; Index++) {
|
||||||
Entry = TableAddress[Index];
|
Entry = TableAddress[Index];
|
||||||
EntryType = Entry & TT_TYPE_MASK;
|
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 Entry is a Table Descriptor type entry then go through the sub-level table
|
||||||
if ((EntryType == TT_TYPE_BLOCK_ENTRY) ||
|
if ((EntryType == TT_TYPE_BLOCK_ENTRY) ||
|
||||||
@@ -197,13 +256,22 @@ GetNextEntryAttribute (
|
|||||||
return BaseAddress + (EntryCount * TT_ADDRESS_AT_LEVEL (TableLevel));
|
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
|
EFI_STATUS
|
||||||
SyncCacheConfig (
|
SyncCacheConfig (
|
||||||
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 PageAttribute;
|
UINT64 PageAttribute;
|
||||||
UINT64 *FirstLevelTableAddress;
|
UINT64 *FirstLevelTableAddress;
|
||||||
UINTN TableLevel;
|
UINTN TableLevel;
|
||||||
UINTN TableCount;
|
UINTN TableCount;
|
||||||
@@ -222,7 +290,11 @@ SyncCacheConfig (
|
|||||||
//
|
//
|
||||||
MemorySpaceMap = NULL;
|
MemorySpaceMap = NULL;
|
||||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
ASSERT_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
|
// 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
|
// 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
|
// Update GCD with the last region if valid
|
||||||
if (PageAttribute != INVALID_ENTRY) {
|
if ((PageAttribute != INVALID_ENTRY) && (EndAddressGcdRegion > BaseAddressGcdRegion)) {
|
||||||
SetGcdMemorySpaceAttributes (
|
SetGcdMemorySpaceAttributes (
|
||||||
MemorySpaceMap,
|
MemorySpaceMap,
|
||||||
NumberOfDescriptors,
|
NumberOfDescriptors,
|
||||||
@@ -271,6 +343,13 @@ SyncCacheConfig (
|
|||||||
return EFI_SUCCESS;
|
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
|
UINT64
|
||||||
EfiAttributeToArmAttribute (
|
EfiAttributeToArmAttribute (
|
||||||
IN UINT64 EfiAttributes
|
IN UINT64 EfiAttributes
|
||||||
@@ -301,7 +380,9 @@ EfiAttributeToArmAttribute (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the access flag to match the block attributes
|
// Set the access flag to match the block attributes
|
||||||
|
if ((EfiAttributes & EFI_MEMORY_RP) == 0) {
|
||||||
ArmAttributes |= TT_AF;
|
ArmAttributes |= TT_AF;
|
||||||
|
}
|
||||||
|
|
||||||
// Determine protection attributes
|
// Determine protection attributes
|
||||||
if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
|
if ((EfiAttributes & EFI_MEMORY_RO) != 0) {
|
||||||
@@ -316,8 +397,25 @@ EfiAttributeToArmAttribute (
|
|||||||
return ArmAttributes;
|
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
|
EFI_STATUS
|
||||||
GetMemoryRegionRec (
|
GetMemoryRegionRec (
|
||||||
IN UINT64 *TranslationTable,
|
IN UINT64 *TranslationTable,
|
||||||
@@ -357,10 +455,10 @@ GetMemoryRegionRec (
|
|||||||
RegionAttributes
|
RegionAttributes
|
||||||
);
|
);
|
||||||
|
|
||||||
// In case of 'Success', it means the end of the block region has been found into the upper
|
// EFI_SUCCESS: The end of the end of the region was found.
|
||||||
// level translation table
|
// EFI_NO_MAPPING: The translation entry associated with BaseAddress is invalid.
|
||||||
if (!EFI_ERROR (Status)) {
|
if (Status != EFI_NOT_FOUND) {
|
||||||
return EFI_SUCCESS;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we processed the table move to the next entry
|
// Now we processed the table move to the next entry
|
||||||
@@ -372,12 +470,13 @@ GetMemoryRegionRec (
|
|||||||
*RegionLength = 0;
|
*RegionLength = 0;
|
||||||
*RegionAttributes = *BlockEntry & TT_ATTRIBUTES_MASK;
|
*RegionAttributes = *BlockEntry & TT_ATTRIBUTES_MASK;
|
||||||
} else {
|
} else {
|
||||||
// We have an 'Invalid' entry
|
return EFI_NO_MAPPING;
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (BlockEntry <= LastBlockEntry) {
|
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);
|
*RegionLength = *RegionLength + TT_BLOCK_ENTRY_SIZE_AT_LEVEL (TableLevel);
|
||||||
} else {
|
} else {
|
||||||
// In case we have found the end of the region we return success
|
// 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
|
// 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.
|
// 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;
|
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
|
EFI_STATUS
|
||||||
GetMemoryRegion (
|
GetMemoryRegion (
|
||||||
IN OUT UINTN *BaseAddress,
|
IN OUT UINTN *BaseAddress,
|
||||||
@@ -406,10 +524,18 @@ GetMemoryRegion (
|
|||||||
UINTN EntryCount;
|
UINTN EntryCount;
|
||||||
UINTN T0SZ;
|
UINTN T0SZ;
|
||||||
|
|
||||||
|
if ((BaseAddress == NULL) || (RegionLength == NULL) || (RegionAttributes == NULL)) {
|
||||||
ASSERT ((BaseAddress != NULL) && (RegionLength != NULL) && (RegionAttributes != NULL));
|
ASSERT ((BaseAddress != NULL) && (RegionLength != NULL) && (RegionAttributes != NULL));
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
TranslationTable = ArmGetTTBR0BaseAddress ();
|
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;
|
T0SZ = ArmGetTCR () & TCR_T0SZ_MASK;
|
||||||
// Get the Table info from T0SZ
|
// Get the Table info from T0SZ
|
||||||
GetRootTranslationTableInfo (T0SZ, &TableLevel, &EntryCount);
|
GetRootTranslationTableInfo (T0SZ, &TableLevel, &EntryCount);
|
||||||
@@ -424,10 +550,10 @@ GetMemoryRegion (
|
|||||||
);
|
);
|
||||||
|
|
||||||
// If the region continues up to the end of the root table then GetMemoryRegionRec()
|
// If the region continues up to the end of the root table then GetMemoryRegionRec()
|
||||||
// will return EFI_NOT_FOUND
|
// will return EFI_NOT_FOUND. Check if the region length was updated.
|
||||||
if (Status == EFI_NOT_FOUND) {
|
if ((Status == EFI_NOT_FOUND) && (*RegionLength > 0)) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@@ -13,6 +13,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include "CpuDxe.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
|
EFI_STATUS
|
||||||
SectionToGcdAttributes (
|
SectionToGcdAttributes (
|
||||||
IN UINT32 SectionAttributes,
|
IN UINT32 SectionAttributes,
|
||||||
@@ -50,23 +62,16 @@ SectionToGcdAttributes (
|
|||||||
|
|
||||||
// determine protection attributes
|
// determine protection attributes
|
||||||
switch (SectionAttributes & TT_DESCRIPTOR_SECTION_AP_MASK) {
|
switch (SectionAttributes & TT_DESCRIPTOR_SECTION_AP_MASK) {
|
||||||
case TT_DESCRIPTOR_SECTION_AP_NO_NO: // no read, no write
|
case TT_DESCRIPTOR_SECTION_AP_NO_RW:
|
||||||
// *GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TT_DESCRIPTOR_SECTION_AP_RW_NO:
|
|
||||||
case TT_DESCRIPTOR_SECTION_AP_RW_RW:
|
case TT_DESCRIPTOR_SECTION_AP_RW_RW:
|
||||||
// normal read/write access, do not add additional attributes
|
// normal read/write access, do not add additional attributes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// read only cases map to write-protect
|
// 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:
|
case TT_DESCRIPTOR_SECTION_AP_RO_RO:
|
||||||
*GcdAttributes |= EFI_MEMORY_RO;
|
*GcdAttributes |= EFI_MEMORY_RO;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now process eXectue Never attribute
|
// now process eXectue Never attribute
|
||||||
@@ -74,9 +79,45 @@ SectionToGcdAttributes (
|
|||||||
*GcdAttributes |= EFI_MEMORY_XP;
|
*GcdAttributes |= EFI_MEMORY_XP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((SectionAttributes & TT_DESCRIPTOR_SECTION_AF) == 0) {
|
||||||
|
*GcdAttributes |= EFI_MEMORY_RP;
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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
|
EFI_STATUS
|
||||||
PageToGcdAttributes (
|
PageToGcdAttributes (
|
||||||
IN UINT32 PageAttributes,
|
IN UINT32 PageAttributes,
|
||||||
@@ -114,23 +155,16 @@ PageToGcdAttributes (
|
|||||||
|
|
||||||
// determine protection attributes
|
// determine protection attributes
|
||||||
switch (PageAttributes & TT_DESCRIPTOR_PAGE_AP_MASK) {
|
switch (PageAttributes & TT_DESCRIPTOR_PAGE_AP_MASK) {
|
||||||
case TT_DESCRIPTOR_PAGE_AP_NO_NO: // no read, no write
|
case TT_DESCRIPTOR_PAGE_AP_NO_RW:
|
||||||
// *GcdAttributes |= EFI_MEMORY_RO | EFI_MEMORY_RP;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TT_DESCRIPTOR_PAGE_AP_RW_NO:
|
|
||||||
case TT_DESCRIPTOR_PAGE_AP_RW_RW:
|
case TT_DESCRIPTOR_PAGE_AP_RW_RW:
|
||||||
// normal read/write access, do not add additional attributes
|
// normal read/write access, do not add additional attributes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// read only cases map to write-protect
|
// 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:
|
case TT_DESCRIPTOR_PAGE_AP_RO_RO:
|
||||||
*GcdAttributes |= EFI_MEMORY_RO;
|
*GcdAttributes |= EFI_MEMORY_RO;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now process eXectue Never attribute
|
// now process eXectue Never attribute
|
||||||
@@ -138,9 +172,30 @@ PageToGcdAttributes (
|
|||||||
*GcdAttributes |= EFI_MEMORY_XP;
|
*GcdAttributes |= EFI_MEMORY_XP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((PageAttributes & TT_DESCRIPTOR_PAGE_AF) == 0) {
|
||||||
|
*GcdAttributes |= EFI_MEMORY_RP;
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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
|
EFI_STATUS
|
||||||
SyncCacheConfigPage (
|
SyncCacheConfigPage (
|
||||||
IN UINT32 SectionIndex,
|
IN UINT32 SectionIndex,
|
||||||
@@ -165,7 +220,8 @@ SyncCacheConfigPage (
|
|||||||
|
|
||||||
// Convert SectionAttributes into PageAttributes
|
// Convert SectionAttributes into PageAttributes
|
||||||
NextPageAttributes =
|
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);
|
TT_DESCRIPTOR_CONVERT_TO_PAGE_AP (*NextSectionAttributes);
|
||||||
|
|
||||||
// obtain page table base
|
// obtain page table base
|
||||||
@@ -174,7 +230,7 @@ SyncCacheConfigPage (
|
|||||||
for (i = 0; i < TRANSLATION_TABLE_PAGE_COUNT; i++) {
|
for (i = 0; i < TRANSLATION_TABLE_PAGE_COUNT; i++) {
|
||||||
if ((SecondLevelTable[i] & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
if ((SecondLevelTable[i] & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
||||||
// extract attributes (cacheability and permissions)
|
// 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) {
|
if (NextPageAttributes == 0) {
|
||||||
// start on a new region
|
// start on a new region
|
||||||
@@ -184,7 +240,10 @@ SyncCacheConfigPage (
|
|||||||
} else if (PageAttributes != NextPageAttributes) {
|
} else if (PageAttributes != NextPageAttributes) {
|
||||||
// Convert Section Attributes into GCD Attributes
|
// Convert Section Attributes into GCD Attributes
|
||||||
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
ASSERT_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)
|
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
||||||
@@ -197,7 +256,10 @@ SyncCacheConfigPage (
|
|||||||
} else if (NextPageAttributes != 0) {
|
} else if (NextPageAttributes != 0) {
|
||||||
// Convert Page Attributes into GCD Attributes
|
// Convert Page Attributes into GCD Attributes
|
||||||
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
Status = PageToGcdAttributes (NextPageAttributes, &GcdAttributes);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
ASSERT_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)
|
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, *NextRegionBase, *NextRegionLength, GcdAttributes);
|
||||||
@@ -212,12 +274,21 @@ SyncCacheConfigPage (
|
|||||||
|
|
||||||
// Convert back PageAttributes into SectionAttributes
|
// Convert back PageAttributes into SectionAttributes
|
||||||
*NextSectionAttributes =
|
*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);
|
TT_DESCRIPTOR_CONVERT_TO_SECTION_AP (NextPageAttributes);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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
|
EFI_STATUS
|
||||||
SyncCacheConfig (
|
SyncCacheConfig (
|
||||||
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol
|
||||||
@@ -244,7 +315,12 @@ SyncCacheConfig (
|
|||||||
//
|
//
|
||||||
MemorySpaceMap = NULL;
|
MemorySpaceMap = NULL;
|
||||||
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
Status = gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - GetMemorySpaceMap() failed! Status: %r\n", Status));
|
||||||
ASSERT_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
|
// 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
|
// 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 ());
|
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)(ArmGetTTBR0BaseAddress ());
|
||||||
|
|
||||||
// Get the first region
|
// 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
|
// iterate through each 1MB descriptor
|
||||||
NextRegionBase = NextRegionLength = 0;
|
NextRegionBase = NextRegionLength = 0;
|
||||||
for (i = 0; i < TRANSLATION_TABLE_SECTION_COUNT; i++) {
|
for (i = 0; i < TRANSLATION_TABLE_SECTION_COUNT; i++) {
|
||||||
if ((FirstLevelTable[i] & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) {
|
if ((FirstLevelTable[i] & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) {
|
||||||
// extract attributes (cacheability and permissions)
|
// 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) {
|
if (NextSectionAttributes == 0) {
|
||||||
// start on a new region
|
// start on a new region
|
||||||
@@ -273,7 +349,12 @@ SyncCacheConfig (
|
|||||||
} else if (SectionAttributes != NextSectionAttributes) {
|
} else if (SectionAttributes != NextSectionAttributes) {
|
||||||
// Convert Section Attributes into GCD Attributes
|
// Convert Section Attributes into GCD Attributes
|
||||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||||
ASSERT_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)
|
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||||
@@ -309,7 +390,11 @@ SyncCacheConfig (
|
|||||||
if (NextSectionAttributes != 0) {
|
if (NextSectionAttributes != 0) {
|
||||||
// Convert Section Attributes into GCD Attributes
|
// Convert Section Attributes into GCD Attributes
|
||||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||||
ASSERT_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)
|
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||||
@@ -326,7 +411,11 @@ SyncCacheConfig (
|
|||||||
if (NextSectionAttributes != 0) {
|
if (NextSectionAttributes != 0) {
|
||||||
// Convert Section Attributes into GCD Attributes
|
// Convert Section Attributes into GCD Attributes
|
||||||
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
Status = SectionToGcdAttributes (NextSectionAttributes, &GcdAttributes);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_ERROR, "SyncCacheConfig - SectionToGcdAttributes() failed! Status: %r\n", Status));
|
||||||
ASSERT_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)
|
// update GCD with these changes (this will recurse into our own CpuSetMemoryAttributes below which is OK)
|
||||||
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
SetGcdMemorySpaceAttributes (MemorySpaceMap, NumberOfDescriptors, NextRegionBase, NextRegionLength, GcdAttributes);
|
||||||
@@ -337,6 +426,13 @@ SyncCacheConfig (
|
|||||||
return EFI_SUCCESS;
|
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
|
UINT64
|
||||||
EfiAttributeToArmAttribute (
|
EfiAttributeToArmAttribute (
|
||||||
IN UINT64 EfiAttributes
|
IN UINT64 EfiAttributes
|
||||||
@@ -383,23 +479,46 @@ EfiAttributeToArmAttribute (
|
|||||||
ArmAttributes |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
ArmAttributes |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((EfiAttributes & EFI_MEMORY_RP) == 0) {
|
||||||
|
ArmAttributes |= TT_DESCRIPTOR_SECTION_AF;
|
||||||
|
}
|
||||||
|
|
||||||
return ArmAttributes;
|
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
|
EFI_STATUS
|
||||||
GetMemoryRegionPage (
|
GetMemoryRegionPage (
|
||||||
IN UINT32 *PageTable,
|
IN UINT32 *PageTable,
|
||||||
IN OUT UINTN *BaseAddress,
|
IN UINTN *BaseAddress,
|
||||||
OUT UINTN *RegionLength,
|
IN UINTN *RegionAttributes,
|
||||||
OUT UINTN *RegionAttributes
|
OUT UINTN *RegionLength
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 PageAttributes;
|
UINT32 PageAttributes;
|
||||||
UINT32 TableIndex;
|
UINT32 TableIndex;
|
||||||
UINT32 PageDescriptor;
|
UINT32 PageDescriptor;
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
// Convert the section attributes into page attributes
|
// 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
|
// Calculate index into first level translation table for start of modification
|
||||||
TableIndex = ((*BaseAddress) & TT_DESCRIPTOR_PAGE_INDEX_MASK) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
TableIndex = ((*BaseAddress) & TT_DESCRIPTOR_PAGE_INDEX_MASK) >> TT_DESCRIPTOR_PAGE_BASE_SHIFT;
|
||||||
@@ -411,25 +530,44 @@ GetMemoryRegionPage (
|
|||||||
PageDescriptor = PageTable[TableIndex];
|
PageDescriptor = PageTable[TableIndex];
|
||||||
|
|
||||||
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_FAULT) {
|
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_MASK) == TT_DESCRIPTOR_PAGE_TYPE_FAULT) {
|
||||||
// Case: End of the boundary of the region
|
Status = (*RegionLength > 0) ? EFI_SUCCESS : EFI_NO_MAPPING;
|
||||||
return EFI_SUCCESS;
|
break;
|
||||||
} else if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_PAGE) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
} else if ((PageDescriptor & TT_DESCRIPTOR_PAGE_TYPE_PAGE) == TT_DESCRIPTOR_PAGE_TYPE_PAGE) {
|
||||||
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK) == PageAttributes) {
|
if ((PageDescriptor & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK) != PageAttributes) {
|
||||||
*RegionLength = *RegionLength + TT_DESCRIPTOR_PAGE_SIZE;
|
Status = EFI_SUCCESS;
|
||||||
} else {
|
break;
|
||||||
// Case: End of the boundary of the region
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*RegionLength += TT_DESCRIPTOR_PAGE_SIZE;
|
||||||
} else {
|
} 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);
|
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
|
EFI_STATUS
|
||||||
GetMemoryRegion (
|
GetMemoryRegion (
|
||||||
IN OUT UINTN *BaseAddress,
|
IN OUT UINTN *BaseAddress,
|
||||||
@@ -444,6 +582,7 @@ GetMemoryRegion (
|
|||||||
UINT32 SectionDescriptor;
|
UINT32 SectionDescriptor;
|
||||||
ARM_FIRST_LEVEL_DESCRIPTOR *FirstLevelTable;
|
ARM_FIRST_LEVEL_DESCRIPTOR *FirstLevelTable;
|
||||||
UINT32 *PageTable;
|
UINT32 *PageTable;
|
||||||
|
UINTN Length;
|
||||||
|
|
||||||
// Initialize the arguments
|
// Initialize the arguments
|
||||||
*RegionLength = 0;
|
*RegionLength = 0;
|
||||||
@@ -453,7 +592,11 @@ GetMemoryRegion (
|
|||||||
|
|
||||||
// Calculate index into first level translation table for start of modification
|
// Calculate index into first level translation table for start of modification
|
||||||
TableIndex = TT_DESCRIPTOR_SECTION_BASE_ADDRESS (*BaseAddress) >> TT_DESCRIPTOR_SECTION_BASE_SHIFT;
|
TableIndex = TT_DESCRIPTOR_SECTION_BASE_ADDRESS (*BaseAddress) >> TT_DESCRIPTOR_SECTION_BASE_SHIFT;
|
||||||
|
|
||||||
|
if (TableIndex >= TRANSLATION_TABLE_SECTION_COUNT) {
|
||||||
ASSERT (TableIndex < TRANSLATION_TABLE_SECTION_COUNT);
|
ASSERT (TableIndex < TRANSLATION_TABLE_SECTION_COUNT);
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the section at the given index
|
// Get the section at the given index
|
||||||
SectionDescriptor = FirstLevelTable[TableIndex];
|
SectionDescriptor = FirstLevelTable[TableIndex];
|
||||||
@@ -479,10 +622,15 @@ GetMemoryRegion (
|
|||||||
ASSERT (PageTableIndex < TRANSLATION_TABLE_PAGE_COUNT);
|
ASSERT (PageTableIndex < TRANSLATION_TABLE_PAGE_COUNT);
|
||||||
|
|
||||||
PageAttributes = PageTable[PageTableIndex] & TT_DESCRIPTOR_PAGE_ATTRIBUTE_MASK;
|
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);
|
TT_DESCRIPTOR_CONVERT_TO_SECTION_AP (PageAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = EFI_NOT_FOUND;
|
||||||
|
|
||||||
for ( ; TableIndex < TRANSLATION_TABLE_SECTION_COUNT; TableIndex++) {
|
for ( ; TableIndex < TRANSLATION_TABLE_SECTION_COUNT; TableIndex++) {
|
||||||
// Get the section at the given index
|
// Get the section at the given index
|
||||||
SectionDescriptor = FirstLevelTable[TableIndex];
|
SectionDescriptor = FirstLevelTable[TableIndex];
|
||||||
@@ -491,14 +639,18 @@ GetMemoryRegion (
|
|||||||
if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE (SectionDescriptor)) {
|
if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE (SectionDescriptor)) {
|
||||||
// Extract the page table location from the descriptor
|
// Extract the page table location from the descriptor
|
||||||
PageTable = (UINT32 *)(SectionDescriptor & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK);
|
PageTable = (UINT32 *)(SectionDescriptor & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK);
|
||||||
|
Length = 0;
|
||||||
|
|
||||||
// Scan the page table to find the end of the region.
|
// 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
|
// Status == EFI_NOT_FOUND implies we have not reached the end of the region.
|
||||||
if (Status == EFI_SUCCESS) {
|
if ((Status == EFI_NOT_FOUND) && (Length > 0)) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
} else if (((SectionDescriptor & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) ||
|
} else if (((SectionDescriptor & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SECTION) ||
|
||||||
((SectionDescriptor & TT_DESCRIPTOR_SECTION_TYPE_MASK) == TT_DESCRIPTOR_SECTION_TYPE_SUPERSECTION))
|
((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 <Guid/IdleLoopEvent.h>
|
||||||
|
|
||||||
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
|
||||||
BOOLEAN mIsFlushingGCD;
|
BOOLEAN mIsFlushingGCD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -227,6 +229,77 @@ InitializeDma (
|
|||||||
CpuArchProtocol->DmaBufferAlignment = ArmCacheWritebackGranule ();
|
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
|
EFI_STATUS
|
||||||
CpuDxeInitialize (
|
CpuDxeInitialize (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
@@ -240,10 +313,26 @@ CpuDxeInitialize (
|
|||||||
|
|
||||||
InitializeDma (&mCpu);
|
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 (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&mCpuHandle,
|
&mCpuHandle,
|
||||||
&gEfiCpuArchProtocolGuid,
|
&gEfiCpuArchProtocolGuid,
|
||||||
&mCpu,
|
&mCpu,
|
||||||
|
&gEfiMemoryAttributeProtocolGuid,
|
||||||
|
&mMemoryAttribute,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -30,9 +30,12 @@
|
|||||||
#include <Protocol/Cpu.h>
|
#include <Protocol/Cpu.h>
|
||||||
#include <Protocol/DebugSupport.h>
|
#include <Protocol/DebugSupport.h>
|
||||||
#include <Protocol/LoadedImage.h>
|
#include <Protocol/LoadedImage.h>
|
||||||
|
#include <Protocol/MemoryAttribute.h>
|
||||||
|
|
||||||
extern BOOLEAN mIsFlushingGCD;
|
extern BOOLEAN mIsFlushingGCD;
|
||||||
|
|
||||||
|
extern EFI_MEMORY_ATTRIBUTE_PROTOCOL mMemoryAttribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function registers and enables the handler specified by InterruptHandler for a processor
|
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
|
interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
|
||||||
@@ -126,4 +129,18 @@ SetGcdMemorySpaceAttributes (
|
|||||||
IN UINT64 Attributes
|
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_
|
#endif // CPU_DXE_H_
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
CpuDxe.h
|
CpuDxe.h
|
||||||
CpuMmuCommon.c
|
CpuMmuCommon.c
|
||||||
Exception.c
|
Exception.c
|
||||||
|
MemoryAttribute.c
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
Arm/Mmu.c
|
Arm/Mmu.c
|
||||||
@@ -47,12 +48,14 @@
|
|||||||
DefaultExceptionHandlerLib
|
DefaultExceptionHandlerLib
|
||||||
DxeServicesTableLib
|
DxeServicesTableLib
|
||||||
HobLib
|
HobLib
|
||||||
|
MemoryAllocationLib
|
||||||
PeCoffGetEntryPointLib
|
PeCoffGetEntryPointLib
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
UefiLib
|
UefiLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiCpuArchProtocolGuid
|
gEfiCpuArchProtocolGuid
|
||||||
|
gEfiMemoryAttributeProtocolGuid
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiDebugImageInfoTableGuid
|
gEfiDebugImageInfoTableGuid
|
||||||
@@ -62,9 +65,11 @@
|
|||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gArmTokenSpaceGuid.PcdVFPEnabled
|
gArmTokenSpaceGuid.PcdVFPEnabled
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy
|
||||||
|
|
||||||
[FeaturePcd.common]
|
[FeaturePcd.common]
|
||||||
gArmTokenSpaceGuid.PcdDebuggerExceptionSupport
|
gArmTokenSpaceGuid.PcdDebuggerExceptionSupport
|
||||||
|
gArmTokenSpaceGuid.PcdRemapUnusedMemoryNx
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gHardwareInterruptProtocolGuid OR gHardwareInterrupt2ProtocolGuid
|
gHardwareInterruptProtocolGuid OR gHardwareInterrupt2ProtocolGuid
|
||||||
|
@@ -217,7 +217,7 @@ CpuSetMemoryAttributes (
|
|||||||
if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) ||
|
if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) ||
|
||||||
((BaseAddress + Length) > (RegionBaseAddress + RegionLength)))
|
((BaseAddress + Length) > (RegionBaseAddress + RegionLength)))
|
||||||
{
|
{
|
||||||
return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes);
|
return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes, 0);
|
||||||
} else {
|
} else {
|
||||||
return EFI_SUCCESS;
|
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) 2006, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2011 Hewlett Packard 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) 2011-2013, ARM Limited. All rights reserved.<BR>
|
||||||
|
Copyright (c) 2023, Google, LLC. All rights reserved.<BR>
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ Abstract:
|
|||||||
// The protocols, PPI and GUID definitions for this module
|
// The protocols, PPI and GUID definitions for this module
|
||||||
//
|
//
|
||||||
#include <Ppi/ArmMpCoreInfo.h>
|
#include <Ppi/ArmMpCoreInfo.h>
|
||||||
|
#include <Ppi/MemoryAttribute.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// The Library classes this module consumes
|
// The Library classes this module consumes
|
||||||
@@ -34,6 +36,77 @@ Abstract:
|
|||||||
#include <Library/PcdLib.h>
|
#include <Library/PcdLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
#include <Library/ArmLib.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;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
# This module provides platform specific function to detect boot mode.
|
# This module provides platform specific function to detect boot mode.
|
||||||
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
# 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
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#
|
#
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
CpuPei.c
|
CpuPei.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
EmbeddedPkg/EmbeddedPkg.dec
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
@@ -37,9 +39,11 @@
|
|||||||
DebugLib
|
DebugLib
|
||||||
HobLib
|
HobLib
|
||||||
ArmLib
|
ArmLib
|
||||||
|
ArmMmuLib
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
gArmMpCoreInfoPpiGuid
|
gArmMpCoreInfoPpiGuid
|
||||||
|
gEdkiiMemoryAttributePpiGuid
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gArmMpCoreInfoGuid
|
gArmMpCoreInfoGuid
|
||||||
|
@@ -1,9 +1,13 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||||
* Copyright (c) 2013-2017, ARM Limited. All rights reserved.
|
* Copyright (c) 2013-2017, ARM Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* 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_
|
#ifndef GENERIC_WATCHDOG_H_
|
||||||
@@ -14,12 +18,17 @@
|
|||||||
|
|
||||||
// Control Frame:
|
// Control Frame:
|
||||||
#define GENERIC_WDOG_CONTROL_STATUS_REG ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x000)
|
#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_LOW ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x010)
|
||||||
#define GENERIC_WDOG_COMPARE_VALUE_REG_HIGH ((UINTN)FixedPcdGet64 (PcdGenericWatchdogControlBase) + 0x014)
|
#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
|
// Values of bit 0 of the Control/Status Register
|
||||||
#define GENERIC_WDOG_ENABLED 1
|
#define GENERIC_WDOG_ENABLED 1
|
||||||
#define GENERIC_WDOG_DISABLED 0
|
#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_
|
#endif // GENERIC_WATCHDOG_H_
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||||
* Copyright (c) 2013-2018, ARM Limited. All rights reserved.
|
* Copyright (c) 2013-2018, ARM Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
@@ -27,24 +28,58 @@
|
|||||||
in a second */
|
in a second */
|
||||||
#define TIME_UNITS_PER_SECOND 10000000
|
#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
|
/* In cases where the compare register was set manually, information about
|
||||||
how long the watchdog was asked to wait cannot be retrieved from hardware.
|
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. */
|
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_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;
|
||||||
STATIC EFI_WATCHDOG_TIMER_NOTIFY mWatchdogNotify;
|
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
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
WatchdogWriteOffsetRegister (
|
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
|
STATIC
|
||||||
@@ -87,7 +122,8 @@ WatchdogExitBootServicesEvent (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
WatchdogDisable ();
|
WatchdogDisable ();
|
||||||
mNumTimerTicks = 0;
|
mTimerPeriod = 0;
|
||||||
|
mExitedBootServices = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called when the watchdog's first signal (WS0) goes high.
|
/* 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.";
|
STATIC CONST CHAR16 ResetString[] = L"The generic watchdog timer ran out.";
|
||||||
UINT64 TimerPeriod;
|
|
||||||
|
|
||||||
WatchdogDisable ();
|
WatchdogDisable ();
|
||||||
|
|
||||||
@@ -115,8 +150,7 @@ WatchdogInterruptHandler (
|
|||||||
// the timer period plus 1.
|
// the timer period plus 1.
|
||||||
//
|
//
|
||||||
if (mWatchdogNotify != NULL) {
|
if (mWatchdogNotify != NULL) {
|
||||||
TimerPeriod = ((TIME_UNITS_PER_SECOND / mTimerFrequencyHz) * mNumTimerTicks);
|
mWatchdogNotify (mTimerPeriod + 1);
|
||||||
mWatchdogNotify (TimerPeriod + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gRT->ResetSystem (
|
gRT->ResetSystem (
|
||||||
@@ -186,6 +220,8 @@ WatchdogRegisterHandler (
|
|||||||
|
|
||||||
@retval EFI_SUCCESS The watchdog timer has been programmed to fire
|
@retval EFI_SUCCESS The watchdog timer has been programmed to fire
|
||||||
in TimerPeriod 100ns units.
|
in TimerPeriod 100ns units.
|
||||||
|
@retval EFI_DEVICE_ERROR Boot Services has been exited but TimerPeriod
|
||||||
|
is not zero.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
@@ -197,31 +233,46 @@ WatchdogSetTimerPeriod (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
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) {
|
if (TimerPeriod == 0) {
|
||||||
mNumTimerTicks = 0;
|
mTimerPeriod = 0;
|
||||||
WatchdogDisable ();
|
WatchdogDisable ();
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work out how many timer ticks will equate to TimerPeriod
|
// 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
|
/* 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
|
offset register (WOR) can hold, we need to manually compute and set
|
||||||
the compare register (WCV) */
|
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,
|
/* We need to enable the watchdog *before* writing to the compare register,
|
||||||
because enabling the watchdog causes an "explicit refresh", which
|
because enabling the watchdog causes an "explicit refresh", which
|
||||||
clobbers the compare register (WCV). In order to make sure this doesn't
|
clobbers the compare register (WCV). In order to make sure this doesn't
|
||||||
trigger an interrupt, set the offset to max. */
|
trigger an interrupt, set the offset to max. */
|
||||||
WatchdogWriteOffsetRegister (MAX_UINT32);
|
WatchdogWriteOffsetRegister (MaxWatchdogOffsetValue);
|
||||||
WatchdogEnable ();
|
WatchdogEnable ();
|
||||||
SystemCount = ArmGenericTimerGetSystemCount ();
|
SystemCount = ArmGenericTimerGetSystemCount ();
|
||||||
WatchdogWriteCompareRegister (SystemCount + mNumTimerTicks);
|
WatchdogWriteCompareRegister (SystemCount + NumTimerTicks);
|
||||||
} else {
|
} else {
|
||||||
WatchdogWriteOffsetRegister ((UINT32)mNumTimerTicks);
|
WatchdogWriteOffsetRegister (NumTimerTicks);
|
||||||
WatchdogEnable ();
|
WatchdogEnable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +307,7 @@ WatchdogGetTimerPeriod (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
*TimerPeriod = ((TIME_UNITS_PER_SECOND / mTimerFrequencyHz) * mNumTimerTicks);
|
*TimerPeriod = mTimerPeriod;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -299,8 +350,6 @@ STATIC EFI_WATCHDOG_TIMER_ARCH_PROTOCOL mWatchdogTimer = {
|
|||||||
WatchdogGetTimerPeriod
|
WatchdogGetTimerPeriod
|
||||||
};
|
};
|
||||||
|
|
||||||
STATIC EFI_EVENT mEfiExitBootServicesEvent;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
GenericWatchdogEntry (
|
GenericWatchdogEntry (
|
||||||
@@ -323,9 +372,6 @@ GenericWatchdogEntry (
|
|||||||
This will avoid conflicts with the universal watchdog */
|
This will avoid conflicts with the universal watchdog */
|
||||||
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiWatchdogTimerArchProtocolGuid);
|
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiWatchdogTimerArchProtocolGuid);
|
||||||
|
|
||||||
mTimerFrequencyHz = ArmGenericTimerGetTimerFreq ();
|
|
||||||
ASSERT (mTimerFrequencyHz != 0);
|
|
||||||
|
|
||||||
// Install interrupt handler
|
// Install interrupt handler
|
||||||
Status = mInterruptProtocol->RegisterInterruptSource (
|
Status = mInterruptProtocol->RegisterInterruptSource (
|
||||||
mInterruptProtocol,
|
mInterruptProtocol,
|
||||||
@@ -367,7 +413,6 @@ GenericWatchdogEntry (
|
|||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
mNumTimerTicks = 0;
|
|
||||||
WatchdogDisable ();
|
WatchdogDisable ();
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
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;
|
Remaining = Size;
|
||||||
SetMem (WriteBuffer, 0, sizeof (WriteBuffer));
|
ZeroMem (WriteBuffer, sizeof (WriteBuffer));
|
||||||
while (Remaining > 0) {
|
while (Remaining > 0) {
|
||||||
WriteNb = MIN (Remaining, sizeof (WriteBuffer));
|
WriteNb = MIN (Remaining, sizeof (WriteBuffer));
|
||||||
WriteSize = WriteNb;
|
WriteSize = WriteNb;
|
||||||
|
@@ -38,10 +38,22 @@
|
|||||||
.global Name ; \
|
.global Name ; \
|
||||||
.section #Section, "ax" ; \
|
.section #Section, "ax" ; \
|
||||||
.type Name, %function ; \
|
.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(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) \
|
#define MOV32(Reg, Val) \
|
||||||
movz Reg, (Val) >> 16, lsl #16 ; \
|
movz Reg, (Val) >> 16, lsl #16 ; \
|
||||||
movk Reg, (Val) & 0xffff
|
movk Reg, (Val) & 0xffff
|
||||||
|
@@ -24,10 +24,17 @@
|
|||||||
// Coprocessor Trap Register (CPTR)
|
// Coprocessor Trap Register (CPTR)
|
||||||
#define AARCH64_CPTR_TFP (1 << 10)
|
#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
|
// ID_AA64PFR0 - AArch64 Processor Feature Register 0 definitions
|
||||||
#define AARCH64_PFR0_FP (0xF << 16)
|
#define AARCH64_PFR0_FP (0xF << 16)
|
||||||
#define AARCH64_PFR0_GIC (0xF << 24)
|
#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
|
// SCR - Secure Configuration Register definitions
|
||||||
#define SCR_NS (1 << 0)
|
#define SCR_NS (1 << 0)
|
||||||
#define SCR_IRQ (1 << 1)
|
#define SCR_IRQ (1 << 1)
|
||||||
@@ -112,6 +119,10 @@
|
|||||||
#define ARM_VECTOR_LOW_A32_FIQ 0x700
|
#define ARM_VECTOR_LOW_A32_FIQ 0x700
|
||||||
#define ARM_VECTOR_LOW_A32_SERR 0x780
|
#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
|
// The ID_AA64MMFR2_EL1 register was added in ARMv8.2. Since we
|
||||||
// build for ARMv8.0, we need to define the register here.
|
// build for ARMv8.0, we need to define the register here.
|
||||||
#define ID_AA64MMFR2_EL1 S3_0_C0_C7_2
|
#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)
|
#define TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(Desc) (((Desc) & 3UL) == TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE)
|
||||||
|
|
||||||
// Translation table descriptor types
|
// Translation table descriptor types
|
||||||
#define TT_DESCRIPTOR_PAGE_TYPE_MASK (3UL << 0)
|
#define TT_DESCRIPTOR_PAGE_TYPE_MASK (1UL << 1)
|
||||||
#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 0)
|
#define TT_DESCRIPTOR_PAGE_TYPE_FAULT (0UL << 1)
|
||||||
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (2UL << 0)
|
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE (1UL << 1)
|
||||||
#define TT_DESCRIPTOR_PAGE_TYPE_PAGE_XN (3UL << 0)
|
|
||||||
#define TT_DESCRIPTOR_PAGE_TYPE_LARGEPAGE (1UL << 0)
|
|
||||||
|
|
||||||
// Section descriptor definitions
|
// Section descriptor definitions
|
||||||
#define TT_DESCRIPTOR_SECTION_SIZE (0x00100000)
|
#define TT_DESCRIPTOR_SECTION_SIZE (0x00100000)
|
||||||
@@ -82,25 +80,24 @@
|
|||||||
#define TT_DESCRIPTOR_PAGE_S_NOT_SHARED (0UL << 10)
|
#define TT_DESCRIPTOR_PAGE_S_NOT_SHARED (0UL << 10)
|
||||||
#define TT_DESCRIPTOR_PAGE_S_SHARED (1UL << 10)
|
#define TT_DESCRIPTOR_PAGE_S_SHARED (1UL << 10)
|
||||||
|
|
||||||
#define TT_DESCRIPTOR_SECTION_AP_MASK ((1UL << 15) | (3UL << 10))
|
#define TT_DESCRIPTOR_SECTION_AP_MASK ((1UL << 15) | (1UL << 11))
|
||||||
#define TT_DESCRIPTOR_SECTION_AP_NO_NO ((0UL << 15) | (0UL << 10))
|
#define TT_DESCRIPTOR_SECTION_AP_NO_RW ((0UL << 15) | (0UL << 11))
|
||||||
#define TT_DESCRIPTOR_SECTION_AP_RW_NO ((0UL << 15) | (1UL << 10))
|
#define TT_DESCRIPTOR_SECTION_AP_RW_RW ((0UL << 15) | (1UL << 11))
|
||||||
#define TT_DESCRIPTOR_SECTION_AP_RW_RO ((0UL << 15) | (2UL << 10))
|
#define TT_DESCRIPTOR_SECTION_AP_NO_RO ((1UL << 15) | (0UL << 11))
|
||||||
#define TT_DESCRIPTOR_SECTION_AP_RW_RW ((0UL << 15) | (3UL << 10))
|
#define TT_DESCRIPTOR_SECTION_AP_RO_RO ((1UL << 15) | (1UL << 11))
|
||||||
#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_PAGE_AP_MASK ((1UL << 9) | (3UL << 4))
|
#define TT_DESCRIPTOR_SECTION_AF (1UL << 10)
|
||||||
#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_MASK ((1UL << 9) | (1UL << 5))
|
||||||
#define TT_DESCRIPTOR_PAGE_AP_RW_RO ((0UL << 9) | (2UL << 4))
|
#define TT_DESCRIPTOR_PAGE_AP_NO_RW ((0UL << 9) | (0UL << 5))
|
||||||
#define TT_DESCRIPTOR_PAGE_AP_RW_RW ((0UL << 9) | (3UL << 4))
|
#define TT_DESCRIPTOR_PAGE_AP_RW_RW ((0UL << 9) | (1UL << 5))
|
||||||
#define TT_DESCRIPTOR_PAGE_AP_RO_NO ((1UL << 9) | (1UL << 4))
|
#define TT_DESCRIPTOR_PAGE_AP_NO_RO ((1UL << 9) | (0UL << 5))
|
||||||
#define TT_DESCRIPTOR_PAGE_AP_RO_RO ((1UL << 9) | (3UL << 4))
|
#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_SECTION_XN_MASK (0x1UL << 4)
|
||||||
#define TT_DESCRIPTOR_PAGE_XN_MASK (0x1UL << 0)
|
#define TT_DESCRIPTOR_PAGE_XN_MASK (0x1UL << 0)
|
||||||
#define TT_DESCRIPTOR_LARGEPAGE_XN_MASK (0x1UL << 15)
|
|
||||||
|
|
||||||
#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK ((3UL << 12) | (1UL << 3) | (1UL << 2))
|
#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK ((3UL << 12) | (1UL << 3) | (1UL << 2))
|
||||||
#define TT_DESCRIPTOR_SECTION_CACHEABLE_MASK (1UL << 3)
|
#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_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_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_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_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_S(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_S_MASK) >> 6) & TT_DESCRIPTOR_PAGE_S_MASK)
|
||||||
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_XN(Desc, IsLargePage) ((IsLargePage)?\
|
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_AF(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_AF) >> 6) & TT_DESCRIPTOR_PAGE_AF)
|
||||||
((((Desc) & TT_DESCRIPTOR_SECTION_XN_MASK) << 11) & TT_DESCRIPTOR_LARGEPAGE_XN_MASK): \
|
#define TT_DESCRIPTOR_CONVERT_TO_PAGE_XN(Desc) ((((Desc) & TT_DESCRIPTOR_SECTION_XN_MASK) >> 4) & TT_DESCRIPTOR_PAGE_XN_MASK)
|
||||||
((((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_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_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_CACHE_POLICY(Desc, IsLargePage) (IsLargePage? \
|
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_AF(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_AF) << 6) & TT_DESCRIPTOR_SECTION_AF)
|
||||||
(((Desc) & TT_DESCRIPTOR_LARGEPAGE_CACHE_POLICY_MASK) & TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK): \
|
#define TT_DESCRIPTOR_CONVERT_TO_SECTION_XN(Desc) ((((Desc) & TT_DESCRIPTOR_PAGE_XN_MASK) << 4) & TT_DESCRIPTOR_SECTION_XN_MASK)
|
||||||
(((((Desc) & (0x3 << 6)) << 6) | (Desc & (0x3 << 2)))))
|
#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 | \
|
#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_S_MASK | TT_DESCRIPTOR_SECTION_AP_MASK | \
|
||||||
|
TT_DESCRIPTOR_SECTION_AF | \
|
||||||
TT_DESCRIPTOR_SECTION_XN_MASK | TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK)
|
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 | \
|
#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_AP_MASK | TT_DESCRIPTOR_PAGE_XN_MASK | \
|
||||||
|
TT_DESCRIPTOR_PAGE_AF | \
|
||||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK)
|
TT_DESCRIPTOR_PAGE_CACHE_POLICY_MASK)
|
||||||
|
|
||||||
#define TT_DESCRIPTOR_SECTION_DOMAIN_MASK (0x0FUL << 5)
|
#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_ADDRESS(a) ((a) & TT_DESCRIPTOR_PAGE_BASE_ADDRESS_MASK)
|
||||||
#define TT_DESCRIPTOR_PAGE_BASE_SHIFT 12
|
#define TT_DESCRIPTOR_PAGE_BASE_SHIFT 12
|
||||||
|
|
||||||
#define TT_DESCRIPTOR_SECTION_WRITE_BACK(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
#define TT_DESCRIPTOR_SECTION_DEFAULT (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
||||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
|
||||||
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
TT_DESCRIPTOR_SECTION_NG_GLOBAL | \
|
||||||
TT_DESCRIPTOR_SECTION_S_SHARED | \
|
TT_DESCRIPTOR_SECTION_S_SHARED | \
|
||||||
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \
|
||||||
TT_DESCRIPTOR_SECTION_AP_RW_RW | \
|
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)
|
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) | \
|
#define TT_DESCRIPTOR_SECTION_WRITE_THROUGH (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||||
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)
|
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) | \
|
#define TT_DESCRIPTOR_SECTION_DEVICE (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||||
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)
|
TT_DESCRIPTOR_SECTION_CACHE_POLICY_SHAREABLE_DEVICE)
|
||||||
#define TT_DESCRIPTOR_SECTION_UNCACHED(NonSecure) (TT_DESCRIPTOR_SECTION_TYPE_SECTION | \
|
|
||||||
((NonSecure) ? TT_DESCRIPTOR_SECTION_NS : 0) | \
|
#define TT_DESCRIPTOR_SECTION_UNCACHED (TT_DESCRIPTOR_SECTION_DEFAULT | \
|
||||||
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)
|
TT_DESCRIPTOR_SECTION_CACHE_POLICY_NON_CACHEABLE)
|
||||||
|
|
||||||
#define TT_DESCRIPTOR_PAGE_WRITE_BACK (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
#define TT_DESCRIPTOR_PAGE_WRITE_BACK (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||||
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
||||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||||
|
TT_DESCRIPTOR_PAGE_AF | \
|
||||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_BACK_ALLOC)
|
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_BACK_ALLOC)
|
||||||
#define TT_DESCRIPTOR_PAGE_WRITE_THROUGH (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
#define TT_DESCRIPTOR_PAGE_WRITE_THROUGH (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||||
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
TT_DESCRIPTOR_PAGE_S_SHARED | \
|
||||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||||
|
TT_DESCRIPTOR_PAGE_AF | \
|
||||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)
|
TT_DESCRIPTOR_PAGE_CACHE_POLICY_WRITE_THROUGH_NO_ALLOC)
|
||||||
#define TT_DESCRIPTOR_PAGE_DEVICE (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
#define TT_DESCRIPTOR_PAGE_DEVICE (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||||
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
||||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||||
|
TT_DESCRIPTOR_PAGE_AF | \
|
||||||
TT_DESCRIPTOR_PAGE_XN_MASK | \
|
TT_DESCRIPTOR_PAGE_XN_MASK | \
|
||||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_SHAREABLE_DEVICE)
|
TT_DESCRIPTOR_PAGE_CACHE_POLICY_SHAREABLE_DEVICE)
|
||||||
#define TT_DESCRIPTOR_PAGE_UNCACHED (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
#define TT_DESCRIPTOR_PAGE_UNCACHED (TT_DESCRIPTOR_PAGE_TYPE_PAGE | \
|
||||||
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
TT_DESCRIPTOR_PAGE_NG_GLOBAL | \
|
||||||
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
TT_DESCRIPTOR_PAGE_S_NOT_SHARED | \
|
||||||
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
TT_DESCRIPTOR_PAGE_AP_RW_RW | \
|
||||||
|
TT_DESCRIPTOR_PAGE_AF | \
|
||||||
TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_CACHEABLE)
|
TT_DESCRIPTOR_PAGE_CACHE_POLICY_NON_CACHEABLE)
|
||||||
|
|
||||||
// First Level Descriptors
|
// First Level Descriptors
|
||||||
@@ -230,8 +210,7 @@ typedef UINT32 ARM_PAGE_TABLE_ENTRY;
|
|||||||
|
|
||||||
UINT32
|
UINT32
|
||||||
ConvertSectionAttributesToPageAttributes (
|
ConvertSectionAttributesToPageAttributes (
|
||||||
IN UINT32 SectionAttributes,
|
IN UINT32 SectionAttributes
|
||||||
IN BOOLEAN IsLargePage
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // ARMV7_MMU_H_
|
#endif // ARMV7_MMU_H_
|
||||||
|
@@ -244,4 +244,13 @@
|
|||||||
#define TRNG_STATUS_INVALID_PARAMETER (INT32)(-2)
|
#define TRNG_STATUS_INVALID_PARAMETER (INT32)(-2)
|
||||||
#define TRNG_STATUS_NO_ENTROPY (INT32)(-3)
|
#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_
|
#endif // ARM_STD_SMC_H_
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015, Linaro Ltd. All rights reserved.
|
* Copyright (c) 2015, Linaro Ltd. All rights reserved.
|
||||||
|
* Copyright (c) 2024, Arm Limited. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
* 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_
|
#ifndef ARM_GIC_ARCH_LIB_H_
|
||||||
@@ -23,4 +29,12 @@ ArmGicGetSupportedArchRevision (
|
|||||||
VOID
|
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_
|
#endif // ARM_GIC_ARCH_LIB_H_
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @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
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
*
|
*
|
||||||
@@ -110,10 +110,10 @@
|
|||||||
// Bit Mask for
|
// Bit Mask for
|
||||||
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
|
||||||
|
|
||||||
UINTN
|
UINT32
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicGetInterfaceIdentification (
|
ArmGicGetInterfaceIdentification (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
// GIC Secure interfaces
|
// GIC Secure interfaces
|
||||||
@@ -121,8 +121,8 @@ VOID
|
|||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicSetupNonSecure (
|
ArmGicSetupNonSecure (
|
||||||
IN UINTN MpId,
|
IN UINTN MpId,
|
||||||
IN INTN GicDistributorBase,
|
IN UINTN GicDistributorBase,
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
@@ -136,40 +136,40 @@ ArmGicSetSecureInterrupts (
|
|||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicEnableInterruptInterface (
|
ArmGicEnableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicDisableInterruptInterface (
|
ArmGicDisableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicEnableDistributor (
|
ArmGicEnableDistributor (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicDisableDistributor (
|
ArmGicDisableDistributor (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
);
|
);
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicGetMaxNumInterrupts (
|
ArmGicGetMaxNumInterrupts (
|
||||||
IN INTN GicDistributorBase
|
IN UINTN GicDistributorBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicSendSgiTo (
|
ArmGicSendSgiTo (
|
||||||
IN INTN GicDistributorBase,
|
IN UINTN GicDistributorBase,
|
||||||
IN INTN TargetListFilter,
|
IN UINT8 TargetListFilter,
|
||||||
IN INTN CPUTargetList,
|
IN UINT8 CPUTargetList,
|
||||||
IN INTN SgiId
|
IN UINT8 SgiId
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -203,7 +203,7 @@ ArmGicEndOfInterrupt (
|
|||||||
UINTN
|
UINTN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicSetPriorityMask (
|
ArmGicSetPriorityMask (
|
||||||
IN INTN GicInterruptInterfaceBase,
|
IN UINTN GicInterruptInterfaceBase,
|
||||||
IN INTN PriorityMask
|
IN INTN PriorityMask
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -251,20 +251,20 @@ VOID
|
|||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicV2SetupNonSecure (
|
ArmGicV2SetupNonSecure (
|
||||||
IN UINTN MpId,
|
IN UINTN MpId,
|
||||||
IN INTN GicDistributorBase,
|
IN UINTN GicDistributorBase,
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicV2EnableInterruptInterface (
|
ArmGicV2EnableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmGicV2DisableInterruptInterface (
|
ArmGicV2DisableInterruptInterface (
|
||||||
IN INTN GicInterruptInterfaceBase
|
IN UINTN GicInterruptInterfaceBase
|
||||||
);
|
);
|
||||||
|
|
||||||
UINTN
|
UINTN
|
||||||
|
@@ -25,33 +25,26 @@
|
|||||||
EFI_MEMORY_WT | EFI_MEMORY_WB | \
|
EFI_MEMORY_WT | EFI_MEMORY_WB | \
|
||||||
EFI_MEMORY_UCE)
|
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 {
|
typedef enum {
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED = 0,
|
ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED = 0,
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED,
|
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK,
|
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
|
// On some platforms, memory mapped flash region is designed as not supporting
|
||||||
// shareable attribute, so WRITE_BACK_NONSHAREABLE is added for such special
|
// shareable attribute, so WRITE_BACK_NONSHAREABLE is added for such special
|
||||||
// need.
|
// need.
|
||||||
// Do NOT use below two attributes if you are not sure.
|
// Do NOT use below two attributes if you are not sure.
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE,
|
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_WRITE_THROUGH,
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH,
|
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE,
|
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE,
|
||||||
ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE
|
|
||||||
} ARM_MEMORY_REGION_ATTRIBUTES;
|
} ARM_MEMORY_REGION_ATTRIBUTES;
|
||||||
|
|
||||||
#define IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE(attr) ((UINT32)(attr) & 1)
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_PHYSICAL_ADDRESS PhysicalBase;
|
EFI_PHYSICAL_ADDRESS PhysicalBase;
|
||||||
EFI_VIRTUAL_ADDRESS VirtualBase;
|
EFI_VIRTUAL_ADDRESS VirtualBase;
|
||||||
@@ -771,6 +764,49 @@ ArmHasCcidx (
|
|||||||
VOID
|
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
|
#ifdef MDE_CPU_ARM
|
||||||
///
|
///
|
||||||
/// AArch32-only ID Register Helper functions
|
/// AArch32-only ID Register Helper functions
|
||||||
|
@@ -21,34 +21,6 @@ ArmConfigureMmu (
|
|||||||
OUT UINTN *TranslationTableSize OPTIONAL
|
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
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmReplaceLiveTranslationEntry (
|
ArmReplaceLiveTranslationEntry (
|
||||||
@@ -58,11 +30,45 @@ ArmReplaceLiveTranslationEntry (
|
|||||||
IN BOOLEAN DisableMmu
|
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
|
EFI_STATUS
|
||||||
ArmSetMemoryAttributes (
|
ArmSetMemoryAttributes (
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length,
|
IN UINT64 Length,
|
||||||
IN UINT64 Attributes
|
IN UINT64 Attributes,
|
||||||
|
IN UINT64 AttributeMask
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif // ARM_MMU_LIB_H_
|
#endif // ARM_MMU_LIB_H_
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/** @file
|
/** @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
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
System Control and Management Interface V1.0
|
System Control and Management Interface V3.2, latest version at:
|
||||||
http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
|
- https://developer.arm.com/documentation/den0056/latest/
|
||||||
DEN0056A_System_Control_and_Management_Interface.pdf
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_
|
#ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_
|
||||||
@@ -14,7 +14,10 @@
|
|||||||
|
|
||||||
#include <Protocol/ArmScmi.h>
|
#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 { \
|
#define ARM_SCMI_PERFORMANCE_PROTOCOL_GUID { \
|
||||||
0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad} \
|
0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad} \
|
||||||
@@ -76,8 +79,58 @@ typedef struct {
|
|||||||
UINT32 RangeMin;
|
UINT32 RangeMin;
|
||||||
} SCMI_PERFORMANCE_LIMITS;
|
} 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()
|
#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.
|
/** Return version of the performance management protocol supported by SCP.
|
||||||
firmware.
|
firmware.
|
||||||
|
|
||||||
@@ -235,6 +288,34 @@ EFI_STATUS
|
|||||||
OUT UINT32 *Level
|
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 {
|
typedef struct _SCMI_PERFORMANCE_PROTOCOL {
|
||||||
SCMI_PERFORMANCE_GET_VERSION GetVersion;
|
SCMI_PERFORMANCE_GET_VERSION GetVersion;
|
||||||
SCMI_PERFORMANCE_GET_ATTRIBUTES GetProtocolAttributes;
|
SCMI_PERFORMANCE_GET_ATTRIBUTES GetProtocolAttributes;
|
||||||
@@ -244,15 +325,7 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL {
|
|||||||
SCMI_PERFORMANCE_LIMITS_GET LimitsGet;
|
SCMI_PERFORMANCE_LIMITS_GET LimitsGet;
|
||||||
SCMI_PERFORMANCE_LEVEL_SET LevelSet;
|
SCMI_PERFORMANCE_LEVEL_SET LevelSet;
|
||||||
SCMI_PERFORMANCE_LEVEL_GET LevelGet;
|
SCMI_PERFORMANCE_LEVEL_GET LevelGet;
|
||||||
|
SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL DescribeFastchannel;
|
||||||
} SCMI_PERFORMANCE_PROTOCOL;
|
} 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_ */
|
#endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
|
||||||
|
@@ -94,7 +94,6 @@
|
|||||||
|
|
||||||
GCC_ASM_EXPORT(ExceptionHandlersEnd)
|
GCC_ASM_EXPORT(ExceptionHandlersEnd)
|
||||||
GCC_ASM_EXPORT(CommonCExceptionHandler)
|
GCC_ASM_EXPORT(CommonCExceptionHandler)
|
||||||
GCC_ASM_EXPORT(RegisterEl0Stack)
|
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
@@ -387,6 +386,6 @@ ASM_PFX(CommonExceptionEntry):
|
|||||||
|
|
||||||
eret
|
eret
|
||||||
|
|
||||||
ASM_PFX(RegisterEl0Stack):
|
ASM_FUNC(RegisterEl0Stack)
|
||||||
msr sp_el0, x0
|
msr sp_el0, x0
|
||||||
ret
|
ret
|
||||||
|
@@ -104,3 +104,49 @@ ArmHasCcidx (
|
|||||||
Mmfr2 = ArmReadIdAA64Mmfr2 ();
|
Mmfr2 = ArmReadIdAA64Mmfr2 ();
|
||||||
return (((Mmfr2 >> 20) & 0xF) == 1) ? TRUE : FALSE;
|
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
|
UINTN
|
||||||
EFIAPI
|
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
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -54,4 +90,16 @@ ArmReadIdAA64Mmfr2 (
|
|||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
ArmReadIdAA64Pfr0 (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
UINTN
|
||||||
|
EFIAPI
|
||||||
|
ArmReadIdAA64Pfr1 (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
#endif // AARCH64_LIB_H_
|
#endif // AARCH64_LIB_H_
|
||||||
|
@@ -425,10 +425,6 @@ ASM_FUNC(ArmCallWFI)
|
|||||||
wfi
|
wfi
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ASM_FUNC(ArmReadIdAA64Mmfr2)
|
|
||||||
mrs x0, ID_AA64MMFR2_EL1 // read EL1 MMFR2
|
|
||||||
ret
|
|
||||||
|
|
||||||
ASM_FUNC(ArmReadMpidr)
|
ASM_FUNC(ArmReadMpidr)
|
||||||
mrs x0, mpidr_el1 // read EL1 MPIDR
|
mrs x0, mpidr_el1 // read EL1 MPIDR
|
||||||
ret
|
ret
|
||||||
@@ -452,10 +448,6 @@ ASM_FUNC(ArmIsArchTimerImplemented)
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
ASM_FUNC(ArmReadIdAA64Pfr0)
|
|
||||||
mrs x0, id_aa64pfr0_el1 // Read ID_AA64PFR0 Register
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
// VOID ArmWriteHcr(UINTN Hcr)
|
// VOID ArmWriteHcr(UINTN Hcr)
|
||||||
ASM_FUNC(ArmWriteHcr)
|
ASM_FUNC(ArmWriteHcr)
|
||||||
@@ -482,4 +474,54 @@ ASM_FUNC(ArmWriteCntHctl)
|
|||||||
msr cnthctl_el2, x0
|
msr cnthctl_el2, x0
|
||||||
ret
|
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
|
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
.set CTRL_C_BIT, (1 << 2)
|
.set CTRL_C_BIT, (1 << 2)
|
||||||
.set CTRL_B_BIT, (1 << 7)
|
.set CTRL_B_BIT, (1 << 7)
|
||||||
.set CTRL_I_BIT, (1 << 12)
|
.set CTRL_I_BIT, (1 << 12)
|
||||||
|
.set CTRL_AFE_BIT,(1 << 29)
|
||||||
|
|
||||||
|
|
||||||
ASM_FUNC(ArmInvalidateDataCacheEntryByMVA)
|
ASM_FUNC(ArmInvalidateDataCacheEntryByMVA)
|
||||||
@@ -64,6 +65,7 @@ ASM_FUNC(ArmInvalidateInstructionCache)
|
|||||||
ASM_FUNC(ArmEnableMmu)
|
ASM_FUNC(ArmEnableMmu)
|
||||||
mrc p15,0,R0,c1,c0,0
|
mrc p15,0,R0,c1,c0,0
|
||||||
orr R0,R0,#1
|
orr R0,R0,#1
|
||||||
|
orr R0,R0,#CTRL_AFE_BIT
|
||||||
mcr p15,0,R0,c1,c0,0
|
mcr p15,0,R0,c1,c0,0
|
||||||
dsb
|
dsb
|
||||||
isb
|
isb
|
||||||
|
@@ -20,16 +20,9 @@
|
|||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
|
#include "ArmMmuLibInternal.h"
|
||||||
|
|
||||||
STATIC
|
STATIC ARM_REPLACE_LIVE_TRANSLATION_ENTRY mReplaceLiveEntryFunc = ArmReplaceLiveTranslationEntry;
|
||||||
VOID (
|
|
||||||
EFIAPI *mReplaceLiveEntryFunc
|
|
||||||
)(
|
|
||||||
IN UINT64 *Entry,
|
|
||||||
IN UINT64 Value,
|
|
||||||
IN UINT64 RegionStart,
|
|
||||||
IN BOOLEAN DisableMmu
|
|
||||||
) = ArmReplaceLiveTranslationEntry;
|
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
@@ -37,33 +30,47 @@ ArmMemoryAttributeToPageAttribute (
|
|||||||
IN ARM_MEMORY_REGION_ATTRIBUTES Attributes
|
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) {
|
switch (Attributes) {
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE:
|
|
||||||
return TT_ATTR_INDX_MEMORY_WRITE_BACK;
|
return TT_ATTR_INDX_MEMORY_WRITE_BACK;
|
||||||
|
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO:
|
||||||
return TT_ATTR_INDX_MEMORY_WRITE_BACK | TT_SH_INNER_SHAREABLE;
|
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_WRITE_THROUGH:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH:
|
|
||||||
return TT_ATTR_INDX_MEMORY_WRITE_THROUGH | TT_SH_INNER_SHAREABLE;
|
return TT_ATTR_INDX_MEMORY_WRITE_THROUGH | TT_SH_INNER_SHAREABLE;
|
||||||
|
|
||||||
// Uncached and device mappings are treated as outer shareable by default,
|
// Uncached and device mappings are treated as outer shareable by default,
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED:
|
|
||||||
return TT_ATTR_INDX_MEMORY_NON_CACHEABLE;
|
return TT_ATTR_INDX_MEMORY_NON_CACHEABLE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT (0);
|
ASSERT (0);
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
|
return TT_ATTR_INDX_DEVICE_MEMORY | Permissions;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +132,7 @@ ReplaceTableEntry (
|
|||||||
(((RegionStart ^ (UINTN)Entry) & ~BlockMask) == 0))
|
(((RegionStart ^ (UINTN)Entry) & ~BlockMask) == 0))
|
||||||
{
|
{
|
||||||
DisableMmu = TRUE;
|
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);
|
mReplaceLiveEntryFunc (Entry, Value, RegionStart, DisableMmu);
|
||||||
@@ -219,7 +226,7 @@ UpdateRegionMappingRecursive (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_VERBOSE,
|
DEBUG_VERBOSE,
|
||||||
"%a(%d): %llx - %llx set %lx clr %lx\n",
|
"%a(%d): %llx - %llx set %lx clr %lx\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
Level,
|
Level,
|
||||||
RegionStart,
|
RegionStart,
|
||||||
RegionEnd,
|
RegionEnd,
|
||||||
@@ -251,6 +258,16 @@ UpdateRegionMappingRecursive (
|
|||||||
ASSERT (Level < 3);
|
ASSERT (Level < 3);
|
||||||
|
|
||||||
if (!IsTableEntry (*Entry, Level)) {
|
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
|
// No table entry exists yet, so we need to allocate a page table
|
||||||
// for the next level.
|
// for the next level.
|
||||||
@@ -438,14 +455,52 @@ GcdAttributeToPageAttribute (
|
|||||||
PageAttributes |= TT_AP_NO_RO;
|
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
|
EFI_STATUS
|
||||||
ArmSetMemoryAttributes (
|
ArmSetMemoryAttributes (
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length,
|
IN UINT64 Length,
|
||||||
IN UINT64 Attributes
|
IN UINT64 Attributes,
|
||||||
|
IN UINT64 AttributeMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT64 PageAttributes;
|
UINT64 PageAttributes;
|
||||||
@@ -459,9 +514,25 @@ ArmSetMemoryAttributes (
|
|||||||
// No memory type was set in Attributes, so we are going to update the
|
// No memory type was set in Attributes, so we are going to update the
|
||||||
// permissions only.
|
// 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 |
|
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 (
|
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ArmConfigureMmu (
|
ArmConfigureMmu (
|
||||||
@@ -752,7 +735,7 @@ ArmMmuBaseLibConstructor (
|
|||||||
|
|
||||||
Hob = GetFirstGuidHob (&gArmMmuReplaceLiveTranslationEntryFuncGuid);
|
Hob = GetFirstGuidHob (&gArmMmuReplaceLiveTranslationEntryFuncGuid);
|
||||||
if (Hob != NULL) {
|
if (Hob != NULL) {
|
||||||
mReplaceLiveEntryFunc = *(VOID **)GET_GUID_HOB_DATA (Hob);
|
mReplaceLiveEntryFunc = *(ARM_REPLACE_LIVE_TRANSLATION_ENTRY *)GET_GUID_HOB_DATA (Hob);
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
|
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
|
||||||
|
@@ -65,21 +65,21 @@
|
|||||||
// write updated entry
|
// write updated entry
|
||||||
str x1, [x0]
|
str x1, [x0]
|
||||||
dsb nshst
|
dsb nshst
|
||||||
|
isb
|
||||||
|
|
||||||
.L2_\@:
|
.L2_\@:
|
||||||
.endm
|
.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
|
//VOID
|
||||||
//ArmReplaceLiveTranslationEntry (
|
//ArmReplaceLiveTranslationEntry (
|
||||||
// IN UINT64 *Entry,
|
// IN UINT64 *Entry,
|
||||||
// IN UINT64 Value,
|
// IN UINT64 Value,
|
||||||
// IN UINT64 Address
|
// 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
|
// disable interrupts
|
||||||
mrs x4, daif
|
mrs x4, daif
|
||||||
@@ -101,5 +101,8 @@ ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)
|
|||||||
ASM_PFX(ArmReplaceLiveTranslationEntrySize):
|
ASM_PFX(ArmReplaceLiveTranslationEntrySize):
|
||||||
.long . - ArmReplaceLiveTranslationEntry
|
.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
|
.org ArmReplaceLiveTranslationEntry + 0x200
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include <Library/CacheMaintenanceLib.h>
|
#include <Library/CacheMaintenanceLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
|
#include "ArmMmuLibInternal.h"
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@@ -22,7 +23,7 @@ ArmMmuPeiLibConstructor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
||||||
VOID *ArmReplaceLiveTranslationEntryFunc;
|
ARM_REPLACE_LIVE_TRANSLATION_ENTRY ArmReplaceLiveTranslationEntryFunc;
|
||||||
VOID *Hob;
|
VOID *Hob;
|
||||||
|
|
||||||
EFI_FV_FILE_INFO FileInfo;
|
EFI_FV_FILE_INFO FileInfo;
|
||||||
|
@@ -15,16 +15,16 @@
|
|||||||
|
|
||||||
UINT32
|
UINT32
|
||||||
ConvertSectionAttributesToPageAttributes (
|
ConvertSectionAttributesToPageAttributes (
|
||||||
IN UINT32 SectionAttributes,
|
IN UINT32 SectionAttributes
|
||||||
IN BOOLEAN IsLargePage
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 PageAttributes;
|
UINT32 PageAttributes;
|
||||||
|
|
||||||
PageAttributes = 0;
|
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_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_NG (SectionAttributes);
|
||||||
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_S (SectionAttributes);
|
PageAttributes |= TT_DESCRIPTOR_CONVERT_TO_PAGE_S (SectionAttributes);
|
||||||
|
|
||||||
|
@@ -100,24 +100,27 @@ PopulateLevel2PageTable (
|
|||||||
|
|
||||||
switch (Attributes) {
|
switch (Attributes) {
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK:
|
|
||||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
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_WRITE_BACK;
|
||||||
PageAttributes &= ~TT_DESCRIPTOR_PAGE_S_SHARED;
|
PageAttributes &= ~TT_DESCRIPTOR_PAGE_S_SHARED;
|
||||||
break;
|
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_WRITE_THROUGH:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH:
|
|
||||||
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_THROUGH;
|
PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_THROUGH;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_DEVICE:
|
|
||||||
PageAttributes = TT_DESCRIPTOR_PAGE_DEVICE;
|
PageAttributes = TT_DESCRIPTOR_PAGE_DEVICE;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED:
|
|
||||||
PageAttributes = TT_DESCRIPTOR_PAGE_UNCACHED;
|
PageAttributes = TT_DESCRIPTOR_PAGE_UNCACHED;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -145,7 +148,7 @@ PopulateLevel2PageTable (
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Translate the Section Descriptor into Page Descriptor
|
// 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);
|
BaseSectionAddress = TT_DESCRIPTOR_SECTION_BASE_ADDRESS (*SectionEntry);
|
||||||
|
|
||||||
@@ -166,7 +169,6 @@ PopulateLevel2PageTable (
|
|||||||
|
|
||||||
// Overwrite the section entry to point to the new Level2 Translation Table
|
// Overwrite the section entry to point to the new Level2 Translation Table
|
||||||
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
||||||
(IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) |
|
|
||||||
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
||||||
} else {
|
} else {
|
||||||
// We do not support the other section type (16MB Section)
|
// We do not support the other section type (16MB Section)
|
||||||
@@ -189,7 +191,6 @@ PopulateLevel2PageTable (
|
|||||||
ZeroMem ((VOID *)TranslationTable, TRANSLATION_TABLE_PAGE_SIZE);
|
ZeroMem ((VOID *)TranslationTable, TRANSLATION_TABLE_PAGE_SIZE);
|
||||||
|
|
||||||
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
*SectionEntry = (TranslationTable & TT_DESCRIPTOR_SECTION_PAGETABLE_ADDRESS_MASK) |
|
||||||
(IS_ARM_MEMORY_REGION_ATTRIBUTES_SECURE (Attributes) ? (1 << 3) : 0) |
|
|
||||||
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
TT_DESCRIPTOR_SECTION_TYPE_PAGE_TABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,39 +240,31 @@ FillTranslationTable (
|
|||||||
|
|
||||||
switch (MemoryRegion->Attributes) {
|
switch (MemoryRegion->Attributes) {
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:
|
||||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK (0);
|
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE:
|
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;
|
Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED;
|
||||||
break;
|
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:
|
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH:
|
||||||
Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH (0);
|
Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
case ARM_MEMORY_REGION_ATTRIBUTE_DEVICE:
|
||||||
Attributes = TT_DESCRIPTOR_SECTION_DEVICE (0);
|
Attributes = TT_DESCRIPTOR_SECTION_DEVICE;
|
||||||
break;
|
break;
|
||||||
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
case ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED:
|
||||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED (0);
|
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED;
|
||||||
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);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED (0);
|
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include <Uefi.h>
|
#include <Uefi.h>
|
||||||
|
|
||||||
#include <Library/ArmLib.h>
|
#include <Library/ArmLib.h>
|
||||||
|
#include <Library/ArmMmuLib.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
@@ -53,7 +54,7 @@ ConvertSectionToPages (
|
|||||||
|
|
||||||
// Get section attributes and convert to page attributes
|
// Get section attributes and convert to page attributes
|
||||||
SectionDescriptor = FirstLevelTable[FirstLevelIdx];
|
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)
|
// 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);
|
PageTable = (volatile ARM_PAGE_TABLE_ENTRY *)AllocatePages (1);
|
||||||
@@ -81,12 +82,12 @@ UpdatePageEntries (
|
|||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length,
|
IN UINT64 Length,
|
||||||
IN UINT64 Attributes,
|
IN UINT64 Attributes,
|
||||||
|
IN UINT32 EntryMask,
|
||||||
OUT BOOLEAN *FlushTlbs OPTIONAL
|
OUT BOOLEAN *FlushTlbs OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 EntryValue;
|
UINT32 EntryValue;
|
||||||
UINT32 EntryMask;
|
|
||||||
UINT32 FirstLevelIdx;
|
UINT32 FirstLevelIdx;
|
||||||
UINT32 Offset;
|
UINT32 Offset;
|
||||||
UINT32 NumPageEntries;
|
UINT32 NumPageEntries;
|
||||||
@@ -104,12 +105,7 @@ UpdatePageEntries (
|
|||||||
|
|
||||||
// EntryMask: bitmask of values to change (1 = change this value, 0 = leave alone)
|
// EntryMask: bitmask of values to change (1 = change this value, 0 = leave alone)
|
||||||
// EntryValue: values at bit positions specified by EntryMask
|
// 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
|
// 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
|
// one Attribute bit is set at a time, so the order of the conditionals below
|
||||||
@@ -142,12 +138,20 @@ UpdatePageEntries (
|
|||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Attributes & EFI_MEMORY_RP) == 0) {
|
||||||
|
EntryValue |= TT_DESCRIPTOR_PAGE_AF;
|
||||||
|
}
|
||||||
|
|
||||||
if ((Attributes & EFI_MEMORY_RO) != 0) {
|
if ((Attributes & EFI_MEMORY_RO) != 0) {
|
||||||
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RO_RO;
|
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RO_RO;
|
||||||
} else {
|
} else {
|
||||||
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RW_RW;
|
EntryValue |= TT_DESCRIPTOR_PAGE_AP_RW_RW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Attributes & EFI_MEMORY_XP) != 0) {
|
||||||
|
EntryValue |= TT_DESCRIPTOR_PAGE_XN_MASK;
|
||||||
|
}
|
||||||
|
|
||||||
// Obtain page table base
|
// Obtain page table base
|
||||||
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
||||||
|
|
||||||
@@ -167,6 +171,17 @@ UpdatePageEntries (
|
|||||||
|
|
||||||
// Does this descriptor need to be converted from section entry to 4K pages?
|
// Does this descriptor need to be converted from section entry to 4K pages?
|
||||||
if (!TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE (Descriptor)) {
|
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);
|
Status = ConvertSectionToPages (FirstLevelIdx << TT_DESCRIPTOR_SECTION_BASE_SHIFT);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
// Exit for loop
|
// Exit for loop
|
||||||
@@ -216,11 +231,11 @@ EFI_STATUS
|
|||||||
UpdateSectionEntries (
|
UpdateSectionEntries (
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length,
|
IN UINT64 Length,
|
||||||
IN UINT64 Attributes
|
IN UINT64 Attributes,
|
||||||
|
IN UINT32 EntryMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 EntryMask;
|
|
||||||
UINT32 EntryValue;
|
UINT32 EntryValue;
|
||||||
UINT32 FirstLevelIdx;
|
UINT32 FirstLevelIdx;
|
||||||
UINT32 NumSections;
|
UINT32 NumSections;
|
||||||
@@ -236,8 +251,6 @@ UpdateSectionEntries (
|
|||||||
// EntryValue: values at bit positions specified by EntryMask
|
// EntryValue: values at bit positions specified by EntryMask
|
||||||
|
|
||||||
// Make sure we handle a section range that is unmapped
|
// 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;
|
EntryValue = TT_DESCRIPTOR_SECTION_TYPE_SECTION;
|
||||||
|
|
||||||
// Although the PI spec is unclear on this, the GCD guarantees that only
|
// Although the PI spec is unclear on this, the GCD guarantees that only
|
||||||
@@ -281,6 +294,10 @@ UpdateSectionEntries (
|
|||||||
EntryValue |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
EntryValue |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Attributes & EFI_MEMORY_RP) == 0) {
|
||||||
|
EntryValue |= TT_DESCRIPTOR_SECTION_AF;
|
||||||
|
}
|
||||||
|
|
||||||
// obtain page table base
|
// obtain page table base
|
||||||
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
|
||||||
|
|
||||||
@@ -302,6 +319,7 @@ UpdateSectionEntries (
|
|||||||
(FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT,
|
(FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT,
|
||||||
TT_DESCRIPTOR_SECTION_SIZE,
|
TT_DESCRIPTOR_SECTION_SIZE,
|
||||||
Attributes,
|
Attributes,
|
||||||
|
ConvertSectionAttributesToPageAttributes (EntryMask),
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -332,11 +350,26 @@ UpdateSectionEntries (
|
|||||||
return Status;
|
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
|
EFI_STATUS
|
||||||
ArmSetMemoryAttributes (
|
SetMemoryAttributes (
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length,
|
IN UINT64 Length,
|
||||||
IN UINT64 Attributes
|
IN UINT64 Attributes,
|
||||||
|
IN UINT32 SectionMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@@ -367,7 +400,12 @@ ArmSetMemoryAttributes (
|
|||||||
Attributes
|
Attributes
|
||||||
));
|
));
|
||||||
|
|
||||||
Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes);
|
Status = UpdateSectionEntries (
|
||||||
|
BaseAddress,
|
||||||
|
ChunkLength,
|
||||||
|
Attributes,
|
||||||
|
SectionMask
|
||||||
|
);
|
||||||
|
|
||||||
FlushTlbs = TRUE;
|
FlushTlbs = TRUE;
|
||||||
} else {
|
} else {
|
||||||
@@ -393,6 +431,7 @@ ArmSetMemoryAttributes (
|
|||||||
BaseAddress,
|
BaseAddress,
|
||||||
ChunkLength,
|
ChunkLength,
|
||||||
Attributes,
|
Attributes,
|
||||||
|
ConvertSectionAttributesToPageAttributes (SectionMask),
|
||||||
&FlushTlbs
|
&FlushTlbs
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -412,38 +451,96 @@ ArmSetMemoryAttributes (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
EFI_STATUS
|
||||||
ArmSetMemoryRegionNoExec (
|
ArmSetMemoryAttributes (
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
||||||
IN UINT64 Length
|
IN UINT64 Length,
|
||||||
|
IN UINT64 Attributes,
|
||||||
|
IN UINT64 AttributeMask
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ArmSetMemoryAttributes (BaseAddress, Length, EFI_MEMORY_XP);
|
UINT32 TtEntryMask;
|
||||||
|
|
||||||
|
if (((BaseAddress | Length) & EFI_PAGE_MASK) != 0) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
if ((Attributes & EFI_MEMORY_CACHETYPE_MASK) == 0) {
|
||||||
ArmClearMemoryRegionNoExec (
|
//
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
// No memory type was set in Attributes, so we are going to update the
|
||||||
IN UINT64 Length
|
// permissions only.
|
||||||
)
|
//
|
||||||
|
if (AttributeMask != 0) {
|
||||||
|
if (((AttributeMask & ~(UINT64)(EFI_MEMORY_RP|EFI_MEMORY_RO|EFI_MEMORY_XP)) != 0) ||
|
||||||
|
((Attributes & ~AttributeMask) != 0))
|
||||||
{
|
{
|
||||||
return ArmSetMemoryAttributes (BaseAddress, Length, __EFI_MEMORY_RWX);
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AttributeMask = EFI_MEMORY_RP | EFI_MEMORY_RO | EFI_MEMORY_XP;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
TtEntryMask = 0;
|
||||||
ArmSetMemoryRegionReadOnly (
|
if ((AttributeMask & EFI_MEMORY_RP) != 0) {
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
TtEntryMask |= TT_DESCRIPTOR_SECTION_AF;
|
||||||
IN UINT64 Length
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return ArmSetMemoryAttributes (BaseAddress, Length, EFI_MEMORY_RO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
if ((AttributeMask & EFI_MEMORY_RO) != 0) {
|
||||||
ArmClearMemoryRegionReadOnly (
|
TtEntryMask |= TT_DESCRIPTOR_SECTION_AP_MASK;
|
||||||
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
}
|
||||||
IN UINT64 Length
|
|
||||||
)
|
if ((AttributeMask & EFI_MEMORY_XP) != 0) {
|
||||||
{
|
TtEntryMask |= TT_DESCRIPTOR_SECTION_XN_MASK;
|
||||||
return ArmSetMemoryAttributes (BaseAddress, Length, __EFI_MEMORY_RWX);
|
}
|
||||||
|
} 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
|
CONSTRUCTOR = ArmMmuBaseLibConstructor
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
AArch64/ArmMmuLibCore.c
|
AArch64/ArmMmuLibCore.c
|
||||||
AArch64/ArmMmuLibReplaceEntry.S
|
AArch64/ArmMmuLibReplaceEntry.S
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
Arm/ArmMmuLibConvert.c
|
Arm/ArmMmuLibConvert.c
|
||||||
Arm/ArmMmuLibCore.c
|
Arm/ArmMmuLibCore.c
|
||||||
Arm/ArmMmuLibUpdate.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
|
CONSTRUCTOR = ArmMmuPeiLibConstructor
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
AArch64/ArmMmuLibCore.c
|
AArch64/ArmMmuLibCore.c
|
||||||
AArch64/ArmMmuPeiLibConstructor.c
|
AArch64/ArmMmuPeiLibConstructor.c
|
||||||
AArch64/ArmMmuLibReplaceEntry.S
|
AArch64/ArmMmuLibReplaceEntry.S
|
||||||
|
@@ -26,7 +26,7 @@ ArmMonitorCall (
|
|||||||
IN OUT ARM_MONITOR_ARGS *Args
|
IN OUT ARM_MONITOR_ARGS *Args
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (FeaturePcdGet (PcdMonitorConduitHvc)) {
|
if (PcdGetBool (PcdMonitorConduitHvc)) {
|
||||||
ArmCallHvc ((ARM_HVC_ARGS *)Args);
|
ArmCallHvc ((ARM_HVC_ARGS *)Args);
|
||||||
} else {
|
} else {
|
||||||
ArmCallSmc ((ARM_SMC_ARGS *)Args);
|
ArmCallSmc ((ARM_SMC_ARGS *)Args);
|
||||||
|
@@ -65,7 +65,7 @@ LibResetSystem (
|
|||||||
ArmCallSmc (&ArmSmcArgs);
|
ArmCallSmc (&ArmSmcArgs);
|
||||||
|
|
||||||
// We should never be here
|
// We should never be here
|
||||||
DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__));
|
DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __func__));
|
||||||
CpuDeadLoop ();
|
CpuDeadLoop ();
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
@@ -5,12 +5,12 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <AsmMacroIoLibV8.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.align 3
|
.align 3
|
||||||
|
|
||||||
GCC_ASM_EXPORT(ArmCallSvc)
|
ASM_FUNC(ArmCallSvc)
|
||||||
|
|
||||||
ASM_PFX(ArmCallSvc):
|
|
||||||
// Push frame pointer and return address on the stack
|
// Push frame pointer and return address on the stack
|
||||||
stp x29, x30, [sp, #-32]!
|
stp x29, x30, [sp, #-32]!
|
||||||
mov x29, sp
|
mov x29, sp
|
||||||
|
@@ -17,45 +17,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Library/PeCoffExtraActionLib.h>
|
#include <Library/PeCoffExtraActionLib.h>
|
||||||
#include <Library/PrintLib.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.
|
Performs additional actions after a PE/COFF image has been loaded and relocated.
|
||||||
|
|
||||||
@@ -71,23 +32,24 @@ PeCoffLoaderRelocateImageExtraAction (
|
|||||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if !defined (MDEPKG_NDEBUG)
|
#ifdef __GNUC__
|
||||||
CHAR8 Temp[512];
|
if (ImageContext->PdbPointer) {
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_LOAD | DEBUG_INFO,
|
||||||
|
"add-symbol-file %a 0x%p\n",
|
||||||
|
ImageContext->PdbPointer,
|
||||||
|
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ImageContext->PdbPointer) {
|
DEBUG ((
|
||||||
#ifdef __CC_ARM
|
DEBUG_LOAD | DEBUG_INFO,
|
||||||
// Print out the command for the DS-5 to load symbols for this image
|
"Loading driver at 0x%11p EntryPoint=0x%11p\n",
|
||||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "add-symbol-file %a 0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
|
(VOID *)(UINTN)ImageContext->ImageAddress,
|
||||||
#elif __GNUC__
|
FUNCTION_ENTRY_POINT (ImageContext->EntryPoint)
|
||||||
// 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)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,21 +68,21 @@ PeCoffLoaderUnloadImageExtraAction (
|
|||||||
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if !defined (MDEPKG_NDEBUG)
|
#ifdef __GNUC__
|
||||||
CHAR8 Temp[512];
|
if (ImageContext->PdbPointer) {
|
||||||
|
DEBUG ((
|
||||||
|
DEBUG_LOAD | DEBUG_INFO,
|
||||||
|
"remove-symbol-file %a 0x%08x\n",
|
||||||
|
ImageContext->PdbPointer,
|
||||||
|
(UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ImageContext->PdbPointer) {
|
DEBUG ((
|
||||||
#ifdef __CC_ARM
|
DEBUG_LOAD | DEBUG_INFO,
|
||||||
// Print out the command for the RVD debugger to load symbols for this image
|
"Unloading driver at 0x%11p\n",
|
||||||
DEBUG ((DEBUG_LOAD | DEBUG_INFO, "unload symbols_only %a\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp))));
|
(VOID *)(UINTN)ImageContext->ImageAddress
|
||||||
#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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,12 @@
|
|||||||
#include <Protocol/DebugSupport.h>
|
#include <Protocol/DebugSupport.h>
|
||||||
#include <Protocol/LoadedImage.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[] = {
|
STATIC CHAR8 *gExceptionTypeString[] = {
|
||||||
"Synchronous",
|
"Synchronous",
|
||||||
"IRQ",
|
"IRQ",
|
||||||
@@ -188,18 +194,14 @@ DefaultExceptionHandler (
|
|||||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CHAR8 Buffer[100];
|
CHAR8 Buffer[MAX_PRINT_CHARS];
|
||||||
|
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
|
||||||
UINTN CharCount;
|
UINTN CharCount;
|
||||||
INT32 Offset;
|
INT32 Offset;
|
||||||
|
|
||||||
if (mRecursiveException) {
|
if (mRecursiveException) {
|
||||||
STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n";
|
STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n";
|
||||||
|
|
||||||
SerialPortWrite ((UINT8 *)Message, sizeof Message - 1);
|
SerialPortWrite ((UINT8 *)Message, sizeof Message - 1);
|
||||||
if (gST->ConOut != NULL) {
|
|
||||||
AsciiPrint (Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
CpuDeadLoop ();
|
CpuDeadLoop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,9 +209,10 @@ DefaultExceptionHandler (
|
|||||||
|
|
||||||
CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);
|
CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);
|
||||||
SerialPortWrite ((UINT8 *)Buffer, CharCount);
|
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 ();
|
DEBUG_CODE_BEGIN ();
|
||||||
CHAR8 *Pdb, *PrevPdb;
|
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);
|
ASSERT (FALSE);
|
||||||
CpuDeadLoop ();
|
CpuDeadLoop ();
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,12 @@
|
|||||||
#include <Protocol/DebugSupport.h>
|
#include <Protocol/DebugSupport.h>
|
||||||
#include <Library/DefaultExceptionHandlerLib.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
|
// The number of elements in a CHAR8 array, including the terminating NUL, that
|
||||||
// is meant to hold the string rendering of the CPSR.
|
// is meant to hold the string rendering of the CPSR.
|
||||||
@@ -198,7 +204,8 @@ DefaultExceptionHandler (
|
|||||||
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
IN OUT EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CHAR8 Buffer[100];
|
CHAR8 Buffer[MAX_PRINT_CHARS];
|
||||||
|
CHAR16 UnicodeBuffer[MAX_PRINT_CHARS];
|
||||||
UINTN CharCount;
|
UINTN CharCount;
|
||||||
UINT32 DfsrStatus;
|
UINT32 DfsrStatus;
|
||||||
UINT32 IfsrStatus;
|
UINT32 IfsrStatus;
|
||||||
@@ -216,9 +223,10 @@ DefaultExceptionHandler (
|
|||||||
SystemContext.SystemContextArm->CPSR
|
SystemContext.SystemContextArm->CPSR
|
||||||
);
|
);
|
||||||
SerialPortWrite ((UINT8 *)Buffer, CharCount);
|
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 ();
|
DEBUG_CODE_BEGIN ();
|
||||||
CHAR8 *Pdb;
|
CHAR8 *Pdb;
|
||||||
@@ -289,6 +297,14 @@ DefaultExceptionHandler (
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((DEBUG_ERROR, "\n"));
|
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);
|
ASSERT (FALSE);
|
||||||
|
|
||||||
CpuDeadLoop (); // may return if executing under a debugger
|
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
|
LOAD_OPTION_ACTIVE
|
||||||
);
|
);
|
||||||
} else {
|
} 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;
|
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)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
Implementation for PlatformBootManagerLib library class interfaces.
|
Implementation for PlatformBootManagerLib library class interfaces.
|
||||||
|
|
||||||
Copyright (C) 2015-2016, Red Hat, Inc.
|
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) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
Copyright (c) 2021, Semihalf All rights reserved.<BR>
|
Copyright (c) 2021, Semihalf All rights reserved.<BR>
|
||||||
@@ -195,7 +195,7 @@ FilterAndProcess (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_VERBOSE,
|
DEBUG_VERBOSE,
|
||||||
"%a: %g: %r\n",
|
"%a: %g: %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ProtocolGuid,
|
ProtocolGuid,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -266,7 +266,7 @@ IsPciDisplay (
|
|||||||
&Pci
|
&Pci
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ Connect (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
|
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
|
||||||
"%a: %s: %r\n",
|
"%a: %s: %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ReportText,
|
ReportText,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -356,7 +356,7 @@ AddOutput (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: %s: handle %p: device path not found\n",
|
"%a: %s: handle %p: device path not found\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ReportText,
|
ReportText,
|
||||||
Handle
|
Handle
|
||||||
));
|
));
|
||||||
@@ -368,7 +368,7 @@ AddOutput (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: %s: adding to ConOut: %r\n",
|
"%a: %s: adding to ConOut: %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ReportText,
|
ReportText,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -380,7 +380,7 @@ AddOutput (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: %s: adding to ErrOut: %r\n",
|
"%a: %s: adding to ErrOut: %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ReportText,
|
ReportText,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -390,7 +390,7 @@ AddOutput (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_VERBOSE,
|
DEBUG_VERBOSE,
|
||||||
"%a: %s: added to ConOut and ErrOut\n",
|
"%a: %s: added to ConOut and ErrOut\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
ReportText
|
ReportText
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -470,6 +470,64 @@ PlatformRegisterFvBootOption (
|
|||||||
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
|
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
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
GetPlatformOptions (
|
GetPlatformOptions (
|
||||||
@@ -547,7 +605,7 @@ GetPlatformOptions (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: failed to register \"%s\": %r\n",
|
"%a: failed to register \"%s\": %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
BootOptions[Index].Description,
|
BootOptions[Index].Description,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -575,7 +633,7 @@ GetPlatformOptions (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: failed to register hotkey for \"%s\": %r\n",
|
"%a: failed to register hotkey for \"%s\": %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
BootOptions[Index].Description,
|
BootOptions[Index].Description,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -757,7 +815,7 @@ HandleCapsules (
|
|||||||
BOOLEAN NeedReset;
|
BOOLEAN NeedReset;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __FUNCTION__));
|
DEBUG ((DEBUG_INFO, "%a: processing capsules ...\n", __func__));
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (
|
Status = gBS->LocateProtocol (
|
||||||
&gEsrtManagementProtocolGuid,
|
&gEsrtManagementProtocolGuid,
|
||||||
@@ -785,7 +843,7 @@ HandleCapsules (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: failed to process capsule %p - %r\n",
|
"%a: failed to process capsule %p - %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
CapsuleHeader,
|
CapsuleHeader,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
@@ -800,7 +858,7 @@ HandleCapsules (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_WARN,
|
DEBUG_WARN,
|
||||||
"%a: capsule update successful, resetting ...\n",
|
"%a: capsule update successful, resetting ...\n",
|
||||||
__FUNCTION__
|
__func__
|
||||||
));
|
));
|
||||||
|
|
||||||
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
||||||
@@ -868,7 +926,7 @@ BootDiscoveryPolicyHandler (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_INFO,
|
DEBUG_INFO,
|
||||||
"%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
|
"%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DiscoveryPolicy
|
DiscoveryPolicy
|
||||||
));
|
));
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@@ -884,14 +942,14 @@ BootDiscoveryPolicyHandler (
|
|||||||
DEBUG_INFO,
|
DEBUG_INFO,
|
||||||
"%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
|
"%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
|
||||||
"Driver connect will be skipped.\n",
|
"Driver connect will be skipped.\n",
|
||||||
__FUNCTION__
|
__func__
|
||||||
));
|
));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
|
Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
|
||||||
if (EFI_ERROR (Status)) {
|
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;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1075,6 +1133,18 @@ PlatformBootManagerUnableToBoot (
|
|||||||
EfiBootManagerConnectAll ();
|
EfiBootManagerConnectAll ();
|
||||||
EfiBootManagerRefreshAllBootOption ();
|
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
|
// Record the updated number of boot configured boot options
|
||||||
//
|
//
|
||||||
@@ -1096,7 +1166,7 @@ PlatformBootManagerUnableToBoot (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_WARN,
|
DEBUG_WARN,
|
||||||
"%a: rebooting after refreshing all boot options\n",
|
"%a: rebooting after refreshing all boot options\n",
|
||||||
__FUNCTION__
|
__func__
|
||||||
));
|
));
|
||||||
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
# Implementation for PlatformBootManagerLib library class interfaces.
|
# Implementation for PlatformBootManagerLib library class interfaces.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2015-2016, Red Hat, Inc.
|
# 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) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
PlatformBm.h
|
PlatformBm.h
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
ArmPkg/ArmPkg.dec
|
||||||
EmbeddedPkg/EmbeddedPkg.dec
|
EmbeddedPkg/EmbeddedPkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||||
|
|
||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
|
gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
|
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
|
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
|
||||||
@@ -66,6 +67,7 @@
|
|||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
|
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gBootDiscoveryPolicyMgrFormsetGuid
|
gBootDiscoveryPolicyMgrFormsetGuid
|
||||||
|
@@ -741,7 +741,7 @@ AddSmbiosProcessorTypeTable (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -78,7 +78,6 @@
|
|||||||
gArmTokenSpaceGuid.PcdBaseBoardManufacturer
|
gArmTokenSpaceGuid.PcdBaseBoardManufacturer
|
||||||
gArmTokenSpaceGuid.PcdBaseBoardProductName
|
gArmTokenSpaceGuid.PcdBaseBoardProductName
|
||||||
gArmTokenSpaceGuid.PcdBaseBoardVersion
|
gArmTokenSpaceGuid.PcdBaseBoardVersion
|
||||||
gArmTokenSpaceGuid.PcdFdBaseAddress
|
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiGenericVariableGuid
|
gEfiGenericVariableGuid
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @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) 2021, NUVIA Inc. All rights reserved.<BR>
|
||||||
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
|
||||||
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
|
Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
|
||||||
@@ -124,22 +124,47 @@ GetBiosReleaseDate (
|
|||||||
return ReleaseDate;
|
return ReleaseDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Fetches the Firmware version string for SMBIOS type 0
|
||||||
Fetches the firmware ('BIOS') version from the
|
|
||||||
FirmwareVersionInfo HOB.
|
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 *
|
VOID
|
||||||
GetBiosVersion (
|
SetBiosVersion (
|
||||||
VOID
|
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 VendorStrLen;
|
||||||
UINTN VerStrLen;
|
UINTN VerStrLen;
|
||||||
UINTN DateStrLen;
|
UINTN DateStrLen;
|
||||||
UINTN BiosPhysicalSize;
|
UINT64 BiosPhysicalSize;
|
||||||
CHAR16 *Vendor;
|
CHAR16 *Vendor;
|
||||||
CHAR16 *Version;
|
CHAR16 *Version;
|
||||||
CHAR16 *ReleaseDate;
|
CHAR16 *ReleaseDate;
|
||||||
@@ -187,18 +212,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
|||||||
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);
|
HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Version = GetBiosVersion ();
|
SetBiosVersion ();
|
||||||
|
|
||||||
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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Char16String = GetBiosReleaseDate ();
|
Char16String = GetBiosReleaseDate ();
|
||||||
if (StrLen (Char16String) > 0) {
|
if (StrLen (Char16String) > 0) {
|
||||||
@@ -239,7 +253,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
|||||||
(VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE0));
|
(VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE0));
|
||||||
|
|
||||||
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);
|
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);
|
||||||
SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB);
|
SmbiosRecord->BiosSegment = 0;
|
||||||
if (BiosPhysicalSize < SIZE_16MB) {
|
if (BiosPhysicalSize < SIZE_16MB) {
|
||||||
SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
|
SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -273,7 +287,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -184,7 +184,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -214,7 +214,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -179,7 +179,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscChassisManufacturer) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -161,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscNumberOfInstallableLanguages) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -69,7 +69,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBootInformation) {
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
|
"[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
DEBUG_LINE_NUMBER,
|
DEBUG_LINE_NUMBER,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
|
@@ -397,7 +397,7 @@ SP805Initialize (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_ERROR,
|
DEBUG_ERROR,
|
||||||
"%a: failed to register watchdog interrupt - %r\n",
|
"%a: failed to register watchdog interrupt - %r\n",
|
||||||
__FUNCTION__,
|
__func__,
|
||||||
Status
|
Status
|
||||||
));
|
));
|
||||||
return Status;
|
return Status;
|
||||||
@@ -406,7 +406,7 @@ SP805Initialize (
|
|||||||
DEBUG ((
|
DEBUG ((
|
||||||
DEBUG_WARN,
|
DEBUG_WARN,
|
||||||
"%a: no interrupt specified, running in RESET mode only\n",
|
"%a: no interrupt specified, running in RESET mode only\n",
|
||||||
__FUNCTION__
|
__func__
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
#include <Library/UefiRuntimeLib.h>
|
#include <Library/UefiRuntimeLib.h>
|
||||||
|
|
||||||
#include <Protocol/RealTimeClock.h>
|
|
||||||
|
|
||||||
#include "PL031RealTimeClock.h"
|
#include "PL031RealTimeClock.h"
|
||||||
|
|
||||||
STATIC BOOLEAN mPL031Initialized = FALSE;
|
STATIC BOOLEAN mPL031Initialized = FALSE;
|
||||||
@@ -113,7 +111,9 @@ EXIT:
|
|||||||
@retval EFI_SUCCESS The operation completed successfully.
|
@retval EFI_SUCCESS The operation completed successfully.
|
||||||
@retval EFI_INVALID_PARAMETER Time is NULL.
|
@retval EFI_INVALID_PARAMETER Time is NULL.
|
||||||
@retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
|
@retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
|
||||||
@retval EFI_SECURITY_VIOLATION The time could not be retrieved due to an authentication failure.
|
@retval EFI_UNSUPPORTED This call is not supported by this platform at the time the call is made.
|
||||||
|
The platform should describe this runtime service as unsupported at runtime
|
||||||
|
via an EFI_RT_PROPERTIES_TABLE configuration table.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@@ -174,6 +174,9 @@ LibGetTime (
|
|||||||
@retval EFI_SUCCESS The operation completed successfully.
|
@retval EFI_SUCCESS The operation completed successfully.
|
||||||
@retval EFI_INVALID_PARAMETER A time field is out of range.
|
@retval EFI_INVALID_PARAMETER A time field is out of range.
|
||||||
@retval EFI_DEVICE_ERROR The time could not be set due to hardware error.
|
@retval EFI_DEVICE_ERROR The time could not be set due to hardware error.
|
||||||
|
@retval EFI_UNSUPPORTED This call is not supported by this platform at the time the call is made.
|
||||||
|
The platform should describe this runtime service as unsupported at runtime
|
||||||
|
via an EFI_RT_PROPERTIES_TABLE configuration table.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@@ -226,8 +229,13 @@ LibSetTime (
|
|||||||
@param Time The current alarm setting.
|
@param Time The current alarm setting.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The alarm settings were returned.
|
@retval EFI_SUCCESS The alarm settings were returned.
|
||||||
@retval EFI_INVALID_PARAMETER Any parameter is NULL.
|
@retval EFI_INVALID_PARAMETER Enabled is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Pending is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Time is NULL.
|
||||||
@retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
|
@retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
|
||||||
|
@retval EFI_UNSUPPORTED This call is not supported by this platform at the time the call is made.
|
||||||
|
The platform should describe this runtime service as unsupported at runtime
|
||||||
|
via an EFI_RT_PROPERTIES_TABLE configuration table.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@@ -250,9 +258,13 @@ LibGetWakeupTime (
|
|||||||
|
|
||||||
@retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
|
@retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
|
||||||
Enable is FALSE, then the wakeup alarm was disabled.
|
Enable is FALSE, then the wakeup alarm was disabled.
|
||||||
@retval EFI_INVALID_PARAMETER A time field is out of range.
|
@retval EFI_INVALID_PARAMETER Enabled is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Pending is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Time is NULL.
|
||||||
@retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
|
@retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
|
||||||
@retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
|
@retval EFI_UNSUPPORTED This call is not supported by this platform at the time the call is made.
|
||||||
|
The platform should describe this runtime service as unsupported at runtime
|
||||||
|
via an EFI_RT_PROPERTIES_TABLE configuration table.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@@ -274,9 +286,10 @@ LibSetWakeupTime (
|
|||||||
@param[in] Event The Event that is being processed
|
@param[in] Event The Event that is being processed
|
||||||
@param[in] Context Event Context
|
@param[in] Context Event Context
|
||||||
**/
|
**/
|
||||||
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
LibRtcVirtualNotifyEvent (
|
VirtualNotifyEvent (
|
||||||
IN EFI_EVENT Event,
|
IN EFI_EVENT Event,
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
@@ -309,7 +322,6 @@ LibRtcInitialize (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_HANDLE Handle;
|
|
||||||
|
|
||||||
// Initialize RTC Base Address
|
// Initialize RTC Base Address
|
||||||
mPL031RtcBase = PcdGet32 (PcdPL031RtcBase);
|
mPL031RtcBase = PcdGet32 (PcdPL031RtcBase);
|
||||||
@@ -330,23 +342,13 @@ LibRtcInitialize (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install the protocol
|
|
||||||
Handle = NULL;
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
|
||||||
&Handle,
|
|
||||||
&gEfiRealTimeClockArchProtocolGuid,
|
|
||||||
NULL,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Register for the virtual address change event
|
// Register for the virtual address change event
|
||||||
//
|
//
|
||||||
Status = gBS->CreateEventEx (
|
Status = gBS->CreateEventEx (
|
||||||
EVT_NOTIFY_SIGNAL,
|
EVT_NOTIFY_SIGNAL,
|
||||||
TPL_NOTIFY,
|
TPL_NOTIFY,
|
||||||
LibRtcVirtualNotifyEvent,
|
VirtualNotifyEvent,
|
||||||
NULL,
|
NULL,
|
||||||
&gEfiEventVirtualAddressChangeGuid,
|
&gEfiEventVirtualAddressChangeGuid,
|
||||||
&mRtcVirtualAddrChangeEvent
|
&mRtcVirtualAddrChangeEvent
|
||||||
|
@@ -112,3 +112,5 @@ _DefaultSError_LowerA32:
|
|||||||
TO_HANDLER
|
TO_HANDLER
|
||||||
|
|
||||||
VECTOR_END(PeiVectorTable)
|
VECTOR_END(PeiVectorTable)
|
||||||
|
|
||||||
|
AARCH64_BTI_NOTE()
|
||||||
|
@@ -73,14 +73,4 @@ PeiCommonExceptionEntry (
|
|||||||
IN UINTN LR
|
IN UINTN LR
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
* Autogenerated function that calls the library constructors for all of the
|
|
||||||
* module's dependent libraries.
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
ProcessLibraryConstructorList (
|
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#**/
|
#**/
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x00010005
|
INF_VERSION = 1.30
|
||||||
BASE_NAME = ArmPlatformPrePeiCore
|
BASE_NAME = ArmPlatformPrePeiCore
|
||||||
FILE_GUID = b78d02bb-d0b5-4389-bc7f-b39ee846c784
|
FILE_GUID = b78d02bb-d0b5-4389-bc7f-b39ee846c784
|
||||||
MODULE_TYPE = SEC
|
MODULE_TYPE = SEC
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#**/
|
#**/
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x00010005
|
INF_VERSION = 1.30
|
||||||
BASE_NAME = ArmPlatformPrePeiCore
|
BASE_NAME = ArmPlatformPrePeiCore
|
||||||
FILE_GUID = 469fc080-aec1-11df-927c-0002a5d5c51b
|
FILE_GUID = 469fc080-aec1-11df-927c-0002a5d5c51b
|
||||||
MODULE_TYPE = SEC
|
MODULE_TYPE = SEC
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user