Commit 95a5885
arm64/mm: Reject memory removal that splits a kernel leaf mapping
Linear and vmemmap mappings that get torn down during a memory hot remove
operation might contain leaf level entries on any page table level. If the
requested memory range's linear or vmemmap mappings falls within such leaf
entries, new mappings need to be created for the remaining memory mapped on
the leaf entry earlier, following standard break before make aka BBM rules.
But kernel cannot tolerate BBM and hence remapping to fine grained leaves
would not be possible on systems without BBML2_NOABORT.
Currently memory hot remove operation does not perform such restructuring,
and so removing memory ranges that could split a kernel leaf level mapping
need to be rejected.
While memory_hotplug.c does appear to permit hot removing arbitrary ranges
of memory, the higher layers that drive memory_hotplug (e.g. ACPI, virtio,
...) all appear to treat memory as fixed size devices. So it is impossible
to hot unplug a different amount than was previously hot plugged, and hence
we should never see a rejection in practice, but adding the check makes us
robust against a future change.
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/all/aWZYXhrT6D2M-7-N@willie-the-truck/
Reviewed-by: David Hildenbrand (Arm) <[email protected]>
Reviewed-by: Ryan Roberts <[email protected]>
Suggested-by: Ryan Roberts <[email protected]>
Signed-off-by: Anshuman Khandual <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>1 parent 48478b9 commit 95a5885
1 file changed
Lines changed: 114 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2014 | 2014 | | |
2015 | 2015 | | |
2016 | 2016 | | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
2017 | 2118 | | |
2018 | 2119 | | |
2019 | 2120 | | |
| |||
2022 | 2123 | | |
2023 | 2124 | | |
2024 | 2125 | | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
2025 | 2129 | | |
2026 | | - | |
| 2130 | + | |
2027 | 2131 | | |
2028 | 2132 | | |
2029 | 2133 | | |
| |||
2069 | 2173 | | |
2070 | 2174 | | |
2071 | 2175 | | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
2072 | 2180 | | |
2073 | 2181 | | |
2074 | 2182 | | |
2075 | | - | |
2076 | | - | |
| 2183 | + | |
| 2184 | + | |
2077 | 2185 | | |
2078 | 2186 | | |
2079 | 2187 | | |
| |||
2123 | 2231 | | |
2124 | 2232 | | |
2125 | 2233 | | |
2126 | | - | |
| 2234 | + | |
2127 | 2235 | | |
2128 | 2236 | | |
2129 | 2237 | | |
2130 | 2238 | | |
2131 | 2239 | | |
2132 | 2240 | | |
2133 | 2241 | | |
2134 | | - | |
| 2242 | + | |
2135 | 2243 | | |
2136 | 2244 | | |
2137 | 2245 | | |
2138 | 2246 | | |
2139 | 2247 | | |
2140 | | - | |
| 2248 | + | |
2141 | 2249 | | |
2142 | 2250 | | |
2143 | 2251 | | |
| |||
0 commit comments