Commit 21be9f71 authored by Will Deacon's avatar Will Deacon
Browse files

arm64: smccc: Reserve block of KVM "vendor" services for pKVM hypercalls



pKVM relies on hypercalls to expose services such as memory sharing to
protected guests. Tentatively allocate a block of 58 hypercalls (i.e.
fill the remaining space in the first 64 function IDs) for pKVM usage,
as future extensions such as pvIOMMU support, range-based memory sharing
and validation of assigned devices will require additional services.

Suggested-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/86a5h5yg5y.wl-maz@kernel.org


Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240830130150.8568-8-will@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 0f126949
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
@@ -115,10 +115,70 @@
/* KVM "vendor specific" services */
#define ARM_SMCCC_KVM_FUNC_FEATURES		0
#define ARM_SMCCC_KVM_FUNC_PTP			1
/* Start of pKVM hypercall range */
#define ARM_SMCCC_KVM_FUNC_HYP_MEMINFO		2
#define ARM_SMCCC_KVM_FUNC_MEM_SHARE		3
#define ARM_SMCCC_KVM_FUNC_MEM_UNSHARE		4
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_5		5
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_6		6
#define ARM_SMCCC_KVM_FUNC_MMIO_GUARD		7
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_8		8
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_9		9
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_10		10
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_11		11
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_12		12
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_13		13
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_14		14
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_15		15
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_16		16
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_17		17
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_18		18
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_19		19
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_20		20
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_21		21
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_22		22
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_23		23
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_24		24
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_25		25
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_26		26
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_27		27
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_28		28
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_29		29
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_30		30
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_31		31
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_32		32
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_33		33
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_34		34
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_35		35
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_36		36
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_37		37
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_38		38
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_39		39
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_40		40
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_41		41
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_42		42
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_43		43
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_44		44
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_45		45
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_46		46
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_47		47
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_48		48
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_49		49
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_50		50
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_51		51
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_52		52
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_53		53
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_54		54
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_55		55
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_56		56
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_57		57
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_58		58
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_59		59
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_60		60
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_61		61
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_62		62
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_63		63
/* End of pKVM hypercall range */
#define ARM_SMCCC_KVM_FUNC_FEATURES_2		127
#define ARM_SMCCC_KVM_NUM_FUNCS			128