Skip to content

Commit 73e3ce3

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Fix which features are marked as allowed for protected VMs
Cache maintenance operations are not trapped for protected VMs, and shouldn't be. Mark them as allowed. Moreover, features advertised by ID_AA64PFR2 and ID_AA64MMFR3 are (already) not allowed, mark them as such. Signed-off-by: Fuad Tabba <tabba@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20231214100158.2305400-16-tabba@google.com
1 parent 0ccd901 commit 73e3ce3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

arch/arm64/kvm/hyp/include/nvhe/fixed_config.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_SSBS) \
7070
)
7171

72+
#define PVM_ID_AA64PFR2_ALLOW 0ULL
73+
7274
/*
7375
* Allow for protected VMs:
7476
* - Mixed-endian
@@ -101,14 +103,16 @@
101103
* - Privileged Access Never
102104
* - SError interrupt exceptions from speculative reads
103105
* - Enhanced Translation Synchronization
106+
* - Control for cache maintenance permission
104107
*/
105108
#define PVM_ID_AA64MMFR1_ALLOW (\
106109
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_HAFDBS) | \
107110
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_VMIDBits) | \
108111
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_HPDS) | \
109112
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_PAN) | \
110113
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_SpecSEI) | \
111-
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_ETS) \
114+
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_ETS) | \
115+
ARM64_FEATURE_MASK(ID_AA64MMFR1_EL1_CMOW) \
112116
)
113117

114118
/*
@@ -133,6 +137,8 @@
133137
ARM64_FEATURE_MASK(ID_AA64MMFR2_EL1_E0PD) \
134138
)
135139

140+
#define PVM_ID_AA64MMFR3_ALLOW (0ULL)
141+
136142
/*
137143
* No support for Scalable Vectors for protected VMs:
138144
* Requires additional support from KVM, e.g., context-switching and

0 commit comments

Comments
 (0)