|
14 | 14 | * guest virtual machines, depending on the mode KVM is running in and on the
|
15 | 15 | * type of guest that is running.
|
16 | 16 | *
|
17 |
| - * The ALLOW masks represent a bitmask of feature fields that are allowed |
18 |
| - * without any restrictions as long as they are supported by the system. |
19 |
| - * |
20 |
| - * The RESTRICT_UNSIGNED masks, if present, represent unsigned fields for |
21 |
| - * features that are restricted to support at most the specified feature. |
| 17 | + * Each field in the masks represents the highest supported *unsigned* value for |
| 18 | + * the feature, if supported by the system. |
22 | 19 | *
|
23 | 20 | * If a feature field is not present in either, than it is not supported.
|
24 | 21 | *
|
|
34 | 31 | * - Floating-point and Advanced SIMD
|
35 | 32 | * - Data Independent Timing
|
36 | 33 | * - Spectre/Meltdown Mitigation
|
37 |
| - */ |
38 |
| -#define PVM_ID_AA64PFR0_ALLOW (\ |
39 |
| - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_FP) | \ |
40 |
| - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_AdvSIMD) | \ |
41 |
| - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_DIT) | \ |
42 |
| - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV2) | \ |
43 |
| - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV3) \ |
44 |
| - ) |
45 |
| - |
46 |
| -/* |
| 34 | + * |
47 | 35 | * Restrict to the following *unsigned* features for protected VMs:
|
48 | 36 | * - AArch64 guests only (no support for AArch32 guests):
|
49 | 37 | * AArch32 adds complexity in trap handling, emulation, condition codes,
|
50 | 38 | * etc...
|
51 | 39 | * - RAS (v1)
|
52 | 40 | * Supported by KVM
|
53 | 41 | */
|
54 |
| -#define PVM_ID_AA64PFR0_RESTRICT_UNSIGNED (\ |
| 42 | +#define PVM_ID_AA64PFR0_ALLOW (\ |
| 43 | + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_FP) | \ |
| 44 | + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_AdvSIMD) | \ |
| 45 | + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_DIT) | \ |
| 46 | + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV2) | \ |
| 47 | + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV3) | \ |
55 | 48 | SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, EL0, IMP) | \
|
56 | 49 | SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, EL1, IMP) | \
|
57 | 50 | SYS_FIELD_PREP_ENUM(ID_AA64PFR0_EL1, EL2, IMP) | \
|
|
77 | 70 | * - Distinction between Secure and Non-secure Memory
|
78 | 71 | * - Mixed-endian at EL0 only
|
79 | 72 | * - Non-context synchronizing exception entry and exit
|
| 73 | + * |
| 74 | + * Restrict to the following *unsigned* features for protected VMs: |
| 75 | + * - 40-bit IPA |
| 76 | + * - 16-bit ASID |
80 | 77 | */
|
81 | 78 | #define PVM_ID_AA64MMFR0_ALLOW (\
|
82 | 79 | ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_BIGEND) | \
|
83 | 80 | ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_SNSMEM) | \
|
84 | 81 | ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_BIGENDEL0) | \
|
85 |
| - ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_EXS) \ |
86 |
| - ) |
87 |
| - |
88 |
| -/* |
89 |
| - * Restrict to the following *unsigned* features for protected VMs: |
90 |
| - * - 40-bit IPA |
91 |
| - * - 16-bit ASID |
92 |
| - */ |
93 |
| -#define PVM_ID_AA64MMFR0_RESTRICT_UNSIGNED (\ |
| 82 | + ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_EXS) | \ |
94 | 83 | FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_PARANGE), ID_AA64MMFR0_EL1_PARANGE_40) | \
|
95 | 84 | FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64MMFR0_EL1_ASIDBITS), ID_AA64MMFR0_EL1_ASIDBITS_16) \
|
96 | 85 | )
|
|
185 | 174 | )
|
186 | 175 |
|
187 | 176 | /* Restrict pointer authentication to the basic version. */
|
188 |
| -#define PVM_ID_AA64ISAR1_RESTRICT_UNSIGNED (\ |
189 |
| - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA), ID_AA64ISAR1_EL1_APA_PAuth) | \ |
190 |
| - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API), ID_AA64ISAR1_EL1_API_PAuth) \ |
191 |
| - ) |
192 |
| - |
193 |
| -#define PVM_ID_AA64ISAR2_RESTRICT_UNSIGNED (\ |
194 |
| - FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3), ID_AA64ISAR2_EL1_APA3_PAuth) \ |
195 |
| - ) |
196 |
| - |
197 | 177 | #define PVM_ID_AA64ISAR1_ALLOW (\
|
198 | 178 | ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DPB) | \
|
199 | 179 | ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_JSCVT) | \
|
|
206 | 186 | ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_SPECRES) | \
|
207 | 187 | ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_BF16) | \
|
208 | 188 | ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DGH) | \
|
209 |
| - ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_I8MM) \ |
| 189 | + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_I8MM) | \ |
| 190 | + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA), ID_AA64ISAR1_EL1_APA_PAuth) | \ |
| 191 | + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API), ID_AA64ISAR1_EL1_API_PAuth) \ |
210 | 192 | )
|
211 | 193 |
|
212 | 194 | #define PVM_ID_AA64ISAR2_ALLOW (\
|
213 | 195 | ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_ATS1A)| \
|
214 | 196 | ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3) | \
|
215 |
| - ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_MOPS) \ |
| 197 | + ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_MOPS) | \ |
| 198 | + FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3), ID_AA64ISAR2_EL1_APA3_PAuth) \ |
216 | 199 | )
|
217 | 200 |
|
218 | 201 | u64 pvm_read_id_reg(const struct kvm_vcpu *vcpu, u32 id);
|
|
0 commit comments