Commit fe21ff5
KVM: arm64: Make MTE_frac masking conditional on MTE capability
If MTE_frac is masked out unconditionally then the guest will always
see ID_AA64PFR1_EL1_MTE_frac as 0. However, a value of 0 when
ID_AA64PFR1_EL1_MTE is 2 indicates that MTE_ASYNC is supported. Hence, for
a host with ID_AA64PFR1_EL1_MTE==2 and ID_AA64PFR1_EL1_MTE_frac==0xf
(MTE_ASYNC unsupported) the guest would see MTE_ASYNC advertised as
supported whilst the host does not support it. Hence, expose the sanitised
value of MTE_frac to the guest and user-space.
As MTE_frac was previously hidden, always 0, and KVM must accept values
from KVM provided by user-space, when ID_AA64PFR1_EL1.MTE is 2 allow
user-space to set ID_AA64PFR1_EL1.MTE_frac to 0. However, ignore it to
avoid incorrectly claiming hardware support for MTE_ASYNC in the guest.
Note that linux does not check the value of ID_AA64PFR1_EL1_MTE_frac and
wrongly assumes that MTE async faults can be generated even on hardware
that does nto support them. This issue is not addressed here.
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Link: https://lore.kernel.org/r/20250512114112.359087-3-ben.horgan@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>1 parent 5799a29 commit fe21ff5
1 file changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
1603 | | - | |
| 1603 | + | |
1604 | 1604 | | |
| 1605 | + | |
| 1606 | + | |
1605 | 1607 | | |
1606 | 1608 | | |
1607 | 1609 | | |
1608 | 1610 | | |
1609 | | - | |
1610 | 1611 | | |
1611 | 1612 | | |
1612 | 1613 | | |
| |||
1953 | 1954 | | |
1954 | 1955 | | |
1955 | 1956 | | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
1956 | 1960 | | |
1957 | 1961 | | |
1958 | 1962 | | |
1959 | 1963 | | |
1960 | 1964 | | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
1961 | 1985 | | |
1962 | 1986 | | |
1963 | 1987 | | |
| |||
0 commit comments