Commit c2385ea
KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables
At the moment we don't properly check the GITS_BASER<n>.Valid
bit before saving the collection and device tables.
On vgic_its_save_collection_table() we use the GITS_BASER gpa
field whereas the Valid bit should be used.
On vgic_its_save_device_tables() there is no check. This can
cause various bugs, among which a subsequent fault when accessing
the table in guest memory.
Let's systematically check the Valid bit before doing anything.
We also uniformize the code between save and restore.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>1 parent c9b51bb commit c2385ea
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2067 | 2067 | | |
2068 | 2068 | | |
2069 | 2069 | | |
| 2070 | + | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | | - | |
2073 | 2073 | | |
2074 | | - | |
| 2074 | + | |
| 2075 | + | |
2075 | 2076 | | |
2076 | 2077 | | |
2077 | 2078 | | |
| |||
2215 | 2216 | | |
2216 | 2217 | | |
2217 | 2218 | | |
| 2219 | + | |
| 2220 | + | |
2218 | 2221 | | |
2219 | 2222 | | |
2220 | | - | |
2221 | 2223 | | |
2222 | 2224 | | |
2223 | 2225 | | |
2224 | | - | |
2225 | | - | |
| 2226 | + | |
2226 | 2227 | | |
2227 | 2228 | | |
2228 | | - | |
| 2229 | + | |
2229 | 2230 | | |
2230 | 2231 | | |
2231 | 2232 | | |
| |||
2256 | 2257 | | |
2257 | 2258 | | |
2258 | 2259 | | |
| 2260 | + | |
2259 | 2261 | | |
2260 | 2262 | | |
2261 | 2263 | | |
2262 | 2264 | | |
2263 | 2265 | | |
2264 | | - | |
| 2266 | + | |
2265 | 2267 | | |
2266 | 2268 | | |
2267 | | - | |
| 2269 | + | |
2268 | 2270 | | |
2269 | | - | |
| 2271 | + | |
2270 | 2272 | | |
2271 | 2273 | | |
2272 | 2274 | | |
| |||
0 commit comments