History

KVM: arm64: Add capability to advertise ptrauth for guest

This patch advertises the capability of two cpu feature called address pointer authentication and generic pointer authentication. These capabilities depend upon system support for pointer authentication and VHE mode. The current arm64 KVM partially implements pointer authentication and support of address/generic authentication are tied together. However, separate ABI requirements for both of them is added so that any future isolated implementation will not require any ABI changes.

Amit Daniel Kachhap committed 7 years ago

Commit a243c161 parent a22fa323 files · +17 −4Browse files

Unified · Split

3 files
  1. Documentation/virtual/kvm/api.txt +10 −4
  2. arch/arm64/kvm/reset.c +5 −0
  3. include/uapi/linux/kvm.h +2 −0
Documentation/virtual/kvm/api.txt+10−4
@@ -2763,13 +2763,19 @@ Possible features: · 2762 unmodified lines
27632763
27642764 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication
27652765 for arm64 only.
2766− Both KVM_ARM_VCPU_PTRAUTH_ADDRESS and KVM_ARM_VCPU_PTRAUTH_GENERIC
2767− must be requested or neither must be requested.
2766+ Depends on KVM_CAP_ARM_PTRAUTH_ADDRESS.
2767+ If KVM_CAP_ARM_PTRAUTH_ADDRESS and KVM_CAP_ARM_PTRAUTH_GENERIC are
2768+ both present, then both KVM_ARM_VCPU_PTRAUTH_ADDRESS and
2769+ KVM_ARM_VCPU_PTRAUTH_GENERIC must be requested or neither must be
2770+ requested.
27682771
27692772 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication
27702773 for arm64 only.
2771− Both KVM_ARM_VCPU_PTRAUTH_ADDRESS and KVM_ARM_VCPU_PTRAUTH_GENERIC
2772− must be requested or neither must be requested.
2774+ Depends on KVM_CAP_ARM_PTRAUTH_GENERIC.
2775+ If KVM_CAP_ARM_PTRAUTH_ADDRESS and KVM_CAP_ARM_PTRAUTH_GENERIC are
2776+ both present, then both KVM_ARM_VCPU_PTRAUTH_ADDRESS and
2777+ KVM_ARM_VCPU_PTRAUTH_GENERIC must be requested or neither must be
2778+ requested.
27732779
27742780 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).
27752781 Depends on KVM_CAP_ARM_SVE.
arch/arm64/kvm/reset.c+5−0
@@ -101,6 +101,11 @@ int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 100 unmodified lines
101101 case KVM_CAP_ARM_SVE:
102102 r = system_supports_sve();
103103 break;
104+ case KVM_CAP_ARM_PTRAUTH_ADDRESS:
105+ case KVM_CAP_ARM_PTRAUTH_GENERIC:
106+ r = has_vhe() && system_supports_address_auth() &&
107+ system_supports_generic_auth();
108+ break;
104109 default:
105110 r = 0;
106111 }
include/uapi/linux/kvm.h+2−0
@@ -989,6 +989,8 @@ struct kvm_ppc_resize_hpt { · 988 unmodified lines
989989 #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166
990990 #define KVM_CAP_HYPERV_CPUID 167
991991 #define KVM_CAP_ARM_SVE 168
992+#define KVM_CAP_ARM_PTRAUTH_ADDRESS 169
993+#define KVM_CAP_ARM_PTRAUTH_GENERIC 170
992994
993995 #ifdef KVM_CAP_IRQ_ROUTING
994996