Skip to content

Commit 3d7ff00

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Rework specifying restricted features for protected VMs
The existing code didn't properly distinguish between signed and unsigned features, and was difficult to read and to maintain. Rework it using the same method used in other parts of KVM when handling vcpu features. Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 0401f7e commit 3d7ff00

File tree

3 files changed

+189
-170
lines changed

3 files changed

+189
-170
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,7 @@ static inline bool __vcpu_has_feature(const struct kvm_arch *ka, int feature)
14221422
return test_bit(feature, ka->vcpu_features);
14231423
}
14241424

1425+
#define kvm_vcpu_has_feature(k, f) __vcpu_has_feature(&(k)->arch, (f))
14251426
#define vcpu_has_feature(v, f) __vcpu_has_feature(&(v)->kvm->arch, (f))
14261427

14271428
#define kvm_vcpu_initialized(v) vcpu_get_flag(vcpu, VCPU_INITIALIZED)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@
198198
FIELD_PREP(ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3), ID_AA64ISAR2_EL1_APA3_PAuth) \
199199
)
200200

201-
u64 pvm_read_id_reg(const struct kvm_vcpu *vcpu, u32 id);
202201
bool kvm_handle_pvm_sysreg(struct kvm_vcpu *vcpu, u64 *exit_code);
203202
bool kvm_handle_pvm_restricted(struct kvm_vcpu *vcpu, u64 *exit_code);
204203
void kvm_init_pvm_id_regs(struct kvm_vcpu *vcpu);

0 commit comments

Comments
 (0)