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
2763 2763
2764 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication2764 - KVM_ARM_VCPU_PTRAUTH_ADDRESS: Enables Address Pointer authentication
2765 for arm64 only.2765 for arm64 only.
2766 Both KVM_ARM_VCPU_PTRAUTH_ADDRESS and KVM_ARM_VCPU_PTRAUTH_GENERIC2766 Depends on KVM_CAP_ARM_PTRAUTH_ADDRESS.
2767 must be requested or neither must be requested.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.
2768 2771
2769 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication2772 - KVM_ARM_VCPU_PTRAUTH_GENERIC: Enables Generic Pointer authentication
2770 for arm64 only.2773 for arm64 only.
2771 Both KVM_ARM_VCPU_PTRAUTH_ADDRESS and KVM_ARM_VCPU_PTRAUTH_GENERIC2774 Depends on KVM_CAP_ARM_PTRAUTH_GENERIC.
2772 must be requested or neither must be requested.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.
2773 2779
2774 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).2780 - KVM_ARM_VCPU_SVE: Enables SVE for the CPU (arm64 only).
2775 Depends on KVM_CAP_ARM_SVE.2781 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
101 case KVM_CAP_ARM_SVE:101 case KVM_CAP_ARM_SVE:
102 r = system_supports_sve();102 r = system_supports_sve();
103 break;103 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;
104 default:109 default:
105 r = 0;110 r = 0;
106 }111 }
include/uapi/linux/kvm.h+2−0
@@ -989,6 +989,8 @@ struct kvm_ppc_resize_hpt { · 988 unmodified lines
989#define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166989#define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166
990#define KVM_CAP_HYPERV_CPUID 167990#define KVM_CAP_HYPERV_CPUID 167
991#define KVM_CAP_ARM_SVE 168991#define KVM_CAP_ARM_SVE 168
992#define KVM_CAP_ARM_PTRAUTH_ADDRESS 169
993#define KVM_CAP_ARM_PTRAUTH_GENERIC 170
992 994
993#ifdef KVM_CAP_IRQ_ROUTING995#ifdef KVM_CAP_IRQ_ROUTING
994 996