Commit 7da540e
KVM: arm64: Add a macro for creating filtered sys_reg_descs entries
The sys_reg_descs array holds function pointers and reset value for
managing the user-space and guest view of system registers. These
are mostly created by a set of macro's as only some combinations
of behaviour are needed.
If a register needs special treatment, its sys_reg_descs entry is
open-coded. This is true of some id registers where the value provided
by user-space is validated by some helpers.
Before adding another one of these, add a helper that covers the
existing special cases. 'ID_FILTERED' expects helpers to set the
user-space value, and retrieve the modified reset value.
Like ID_WRITABLE() this uses id_visibility(), which should have no
functional change for the registers converted to use ID_FILTERED().
read_sanitised_id_aa64dfr0_el1() and read_sanitised_id_aa64pfr0_el1()
have been refactored to be called from kvm_read_sanitised_id_reg(), to
try be consistent with ID_WRITABLE().
Signed-off-by: James Morse <[email protected]>
Signed-off-by: Joey Gouly <[email protected]>
Reviewed-by: Gavin Shan <[email protected]>
Tested-by: Shameer Kolothum <[email protected]>
Reviewed-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Oliver Upton <[email protected]>1 parent 31ff96c commit 7da540e
1 file changed
+38
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
1512 | 1515 | | |
1513 | 1516 | | |
1514 | 1517 | | |
| |||
1522 | 1525 | | |
1523 | 1526 | | |
1524 | 1527 | | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
1525 | 1534 | | |
1526 | 1535 | | |
1527 | 1536 | | |
| |||
1692 | 1701 | | |
1693 | 1702 | | |
1694 | 1703 | | |
1695 | | - | |
1696 | | - | |
| 1704 | + | |
1697 | 1705 | | |
1698 | | - | |
1699 | | - | |
1700 | 1706 | | |
1701 | 1707 | | |
1702 | 1708 | | |
| |||
1737 | 1743 | | |
1738 | 1744 | | |
1739 | 1745 | | |
1740 | | - | |
1741 | | - | |
| 1746 | + | |
1742 | 1747 | | |
1743 | | - | |
1744 | | - | |
1745 | 1748 | | |
1746 | 1749 | | |
1747 | 1750 | | |
| |||
1834 | 1837 | | |
1835 | 1838 | | |
1836 | 1839 | | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
1837 | 1846 | | |
1838 | 1847 | | |
1839 | 1848 | | |
| |||
2150 | 2159 | | |
2151 | 2160 | | |
2152 | 2161 | | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
2153 | 2171 | | |
2154 | 2172 | | |
2155 | 2173 | | |
| |||
2374 | 2392 | | |
2375 | 2393 | | |
2376 | 2394 | | |
2377 | | - | |
2378 | | - | |
2379 | | - | |
2380 | | - | |
2381 | | - | |
2382 | | - | |
2383 | | - | |
2384 | | - | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
2388 | 2402 | | |
2389 | 2403 | | |
2390 | 2404 | | |
| |||
2406 | 2420 | | |
2407 | 2421 | | |
2408 | 2422 | | |
2409 | | - | |
2410 | | - | |
2411 | | - | |
2412 | | - | |
2413 | | - | |
2414 | 2423 | | |
2415 | 2424 | | |
2416 | 2425 | | |
| |||
2423 | 2432 | | |
2424 | 2433 | | |
2425 | 2434 | | |
2426 | | - | |
2427 | | - | |
2428 | | - | |
2429 | | - | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
2430 | 2440 | | |
2431 | 2441 | | |
2432 | 2442 | | |
| |||
0 commit comments