Commit 428f889
committed
x86, vmlinux.lds.S: Page align RO data for xo text
RO data starts right after the kernel text. If the kernel text doesn’t end
exactly on a 2MB page boundary, then the last page of text will share a page
with the RO data. This prevents all of the text being set as execute-only,
since it would make the RO data not readable.
So page align the start of the RO data when CONFIG_XO_TEXT so this does not
happen. This usually results in the last page of kernel text being a 4k page
instead of a 2MB one. The RO data could be 2MB aligned to avoid this, but at
the cost of extra memory usage. So have it be a 4k page, as it is the
compromise PTI used when setting some pages non-global.
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>1 parent 79b157b commit 428f889
2 files changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
875 | 878 | | |
876 | 879 | | |
877 | 880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
0 commit comments