tools headers UAPI: Sync kvm.h headers with the kernel sources

dd53f6102c30 ("Merge tag 'kvmarm-for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD")
59c5c58c5b93 ("Merge tag 'kvm-ppc-next-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD")
d7547c55cbe7 ("KVM: Introduce KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2")
6520ca64cde7 ("KVM: PPC: Book3S HV: XIVE: Add a mapping for the source ESB pages")
39e9af3de5ca ("KVM: PPC: Book3S HV: XIVE: Add a TIMA mapping")
e4945b9da52b ("KVM: PPC: Book3S HV: XIVE: Add get/set accessors for the VP XIVE state")
e6714bd1671d ("KVM: PPC: Book3S HV: XIVE: Add a control to dirty the XIVE EQ pages")
7b46b6169ab8 ("KVM: PPC: Book3S HV: XIVE: Add a control to sync the sources")
5ca806474859 ("KVM: PPC: Book3S HV: XIVE: Add a global reset control")
13ce3297c576 ("KVM: PPC: Book3S HV: XIVE: Add controls for the EQ configuration")
e8676ce50e22 ("KVM: PPC: Book3S HV: XIVE: Add a control to configure a source")
4131f83c3d64 ("KVM: PPC: Book3S HV: XIVE: add a control to initialize a source")
eacc56bb9de3 ("KVM: PPC: Book3S HV: XIVE: Introduce a new capability KVM_CAP_PPC_IRQ_XIVE")
90c73795afa2 ("KVM: PPC: Book3S HV: Add a new KVM device for the XIVE native exploitation mode")
4f45b90e1c03 ("KVM: s390: add deflate conversion facilty to cpu model")
a243c16d18be ("KVM: arm64: Add capability to advertise ptrauth for guest")
a22fa321d13b ("KVM: arm64: Add userspace flag to enable pointer authentication")
4bd774e57b29 ("KVM: arm64/sve: Simplify KVM_REG_ARM64_SVE_VLS array sizing")
8ae6efdde451 ("KVM: arm64/sve: Clean up UAPI register ID definitions")
173aec2d5a9f ("KVM: s390: add enhanced sort facilty to cpu model")
555f3d03e7fb ("KVM: arm64: Add a capability to advertise SVE support")
9033bba4b535 ("KVM: arm64/sve: Add pseudo-register for the guest's vector lengths")
7dd32a0d0103 ("KVM: arm/arm64: Add KVM_ARM_VCPU_FINALIZE ioctl")
e1c9c98345b3 ("KVM: arm64/sve: Add SVE support to register access ioctl interface")
2b953ea34812 ("KVM: Allow 2048-bit register access via ioctl interface")

None entails changes in tooling, the closest to that were some new arch
specific ioctls, that are still not handled by the tools/perf/trace/beauty/
library, that needs to create per-arch tables to convert ioctl cmd->string (and
back).

From a quick look the arch specific kvm-stat.c files at:

$ ls -1 tools/perf/arch/*/util/kvm-stat.c
tools/perf/arch/powerpc/util/kvm-stat.c
tools/perf/arch/s390/util/kvm-stat.c
tools/perf/arch/x86/util/kvm-stat.c
$

Are not affected.

This silences these perf building warnings:

Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/kvm.h' differs from latest version at 'arch/powerpc/include/uapi/asm/kvm.h'
diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h'
diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Cédric Le Goater <clg@kaod.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Peter Xu <peterx@redhat.com>
Link: https://lkml.kernel.org/n/tip-3msmqjenlmb7eygcdnmlqaq1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Changed files
+105 -3
tools
arch
arm64
include
uapi
asm
powerpc
include
uapi
asm
s390
include
uapi
asm
include
uapi
linux
+43
tools/arch/arm64/include/uapi/asm/kvm.h
··· 35 35 #include <linux/psci.h> 36 36 #include <linux/types.h> 37 37 #include <asm/ptrace.h> 38 + #include <asm/sve_context.h> 38 39 39 40 #define __KVM_HAVE_GUEST_DEBUG 40 41 #define __KVM_HAVE_IRQ_LINE ··· 103 102 #define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */ 104 103 #define KVM_ARM_VCPU_PSCI_0_2 2 /* CPU uses PSCI v0.2 */ 105 104 #define KVM_ARM_VCPU_PMU_V3 3 /* Support guest PMUv3 */ 105 + #define KVM_ARM_VCPU_SVE 4 /* enable SVE for this CPU */ 106 + #define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */ 107 + #define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */ 106 108 107 109 struct kvm_vcpu_init { 108 110 __u32 target; ··· 229 225 #define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \ 230 226 KVM_REG_ARM_FW | ((r) & 0xffff)) 231 227 #define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0) 228 + 229 + /* SVE registers */ 230 + #define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT) 231 + 232 + /* Z- and P-regs occupy blocks at the following offsets within this range: */ 233 + #define KVM_REG_ARM64_SVE_ZREG_BASE 0 234 + #define KVM_REG_ARM64_SVE_PREG_BASE 0x400 235 + #define KVM_REG_ARM64_SVE_FFR_BASE 0x600 236 + 237 + #define KVM_ARM64_SVE_NUM_ZREGS __SVE_NUM_ZREGS 238 + #define KVM_ARM64_SVE_NUM_PREGS __SVE_NUM_PREGS 239 + 240 + #define KVM_ARM64_SVE_MAX_SLICES 32 241 + 242 + #define KVM_REG_ARM64_SVE_ZREG(n, i) \ 243 + (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_ZREG_BASE | \ 244 + KVM_REG_SIZE_U2048 | \ 245 + (((n) & (KVM_ARM64_SVE_NUM_ZREGS - 1)) << 5) | \ 246 + ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1))) 247 + 248 + #define KVM_REG_ARM64_SVE_PREG(n, i) \ 249 + (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_PREG_BASE | \ 250 + KVM_REG_SIZE_U256 | \ 251 + (((n) & (KVM_ARM64_SVE_NUM_PREGS - 1)) << 5) | \ 252 + ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1))) 253 + 254 + #define KVM_REG_ARM64_SVE_FFR(i) \ 255 + (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | KVM_REG_ARM64_SVE_FFR_BASE | \ 256 + KVM_REG_SIZE_U256 | \ 257 + ((i) & (KVM_ARM64_SVE_MAX_SLICES - 1))) 258 + 259 + #define KVM_ARM64_SVE_VQ_MIN __SVE_VQ_MIN 260 + #define KVM_ARM64_SVE_VQ_MAX __SVE_VQ_MAX 261 + 262 + /* Vector lengths pseudo-register: */ 263 + #define KVM_REG_ARM64_SVE_VLS (KVM_REG_ARM64 | KVM_REG_ARM64_SVE | \ 264 + KVM_REG_SIZE_U512 | 0xffff) 265 + #define KVM_ARM64_SVE_VLS_WORDS \ 266 + ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1) 232 267 233 268 /* Device Control API: ARM VGIC */ 234 269 #define KVM_DEV_ARM_VGIC_GRP_ADDR 0
+46
tools/arch/powerpc/include/uapi/asm/kvm.h
··· 482 482 #define KVM_REG_PPC_ICP_PPRI_SHIFT 16 /* pending irq priority */ 483 483 #define KVM_REG_PPC_ICP_PPRI_MASK 0xff 484 484 485 + #define KVM_REG_PPC_VP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x8d) 486 + 485 487 /* Device control API: PPC-specific devices */ 486 488 #define KVM_DEV_MPIC_GRP_MISC 1 487 489 #define KVM_DEV_MPIC_BASE_ADDR 0 /* 64-bit */ ··· 678 676 #define KVM_XICS_PENDING (1ULL << 42) 679 677 #define KVM_XICS_PRESENTED (1ULL << 43) 680 678 #define KVM_XICS_QUEUED (1ULL << 44) 679 + 680 + /* POWER9 XIVE Native Interrupt Controller */ 681 + #define KVM_DEV_XIVE_GRP_CTRL 1 682 + #define KVM_DEV_XIVE_RESET 1 683 + #define KVM_DEV_XIVE_EQ_SYNC 2 684 + #define KVM_DEV_XIVE_GRP_SOURCE 2 /* 64-bit source identifier */ 685 + #define KVM_DEV_XIVE_GRP_SOURCE_CONFIG 3 /* 64-bit source identifier */ 686 + #define KVM_DEV_XIVE_GRP_EQ_CONFIG 4 /* 64-bit EQ identifier */ 687 + #define KVM_DEV_XIVE_GRP_SOURCE_SYNC 5 /* 64-bit source identifier */ 688 + 689 + /* Layout of 64-bit XIVE source attribute values */ 690 + #define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0) 691 + #define KVM_XIVE_LEVEL_ASSERTED (1ULL << 1) 692 + 693 + /* Layout of 64-bit XIVE source configuration attribute values */ 694 + #define KVM_XIVE_SOURCE_PRIORITY_SHIFT 0 695 + #define KVM_XIVE_SOURCE_PRIORITY_MASK 0x7 696 + #define KVM_XIVE_SOURCE_SERVER_SHIFT 3 697 + #define KVM_XIVE_SOURCE_SERVER_MASK 0xfffffff8ULL 698 + #define KVM_XIVE_SOURCE_MASKED_SHIFT 32 699 + #define KVM_XIVE_SOURCE_MASKED_MASK 0x100000000ULL 700 + #define KVM_XIVE_SOURCE_EISN_SHIFT 33 701 + #define KVM_XIVE_SOURCE_EISN_MASK 0xfffffffe00000000ULL 702 + 703 + /* Layout of 64-bit EQ identifier */ 704 + #define KVM_XIVE_EQ_PRIORITY_SHIFT 0 705 + #define KVM_XIVE_EQ_PRIORITY_MASK 0x7 706 + #define KVM_XIVE_EQ_SERVER_SHIFT 3 707 + #define KVM_XIVE_EQ_SERVER_MASK 0xfffffff8ULL 708 + 709 + /* Layout of EQ configuration values (64 bytes) */ 710 + struct kvm_ppc_xive_eq { 711 + __u32 flags; 712 + __u32 qshift; 713 + __u64 qaddr; 714 + __u32 qtoggle; 715 + __u32 qindex; 716 + __u8 pad[40]; 717 + }; 718 + 719 + #define KVM_XIVE_EQ_ALWAYS_NOTIFY 0x00000001 720 + 721 + #define KVM_XIVE_TIMA_PAGE_OFFSET 0 722 + #define KVM_XIVE_ESB_PAGE_OFFSET 4 681 723 682 724 #endif /* __LINUX_KVM_POWERPC_H */
+3 -1
tools/arch/s390/include/uapi/asm/kvm.h
··· 153 153 __u8 ppno[16]; /* with MSA5 */ 154 154 __u8 kma[16]; /* with MSA8 */ 155 155 __u8 kdsa[16]; /* with MSA9 */ 156 - __u8 reserved[1792]; 156 + __u8 sortl[32]; /* with STFLE.150 */ 157 + __u8 dfltcc[32]; /* with STFLE.151 */ 158 + __u8 reserved[1728]; 157 159 }; 158 160 159 161 /* kvm attributes for crypto */
+13 -2
tools/include/uapi/linux/kvm.h
··· 986 986 #define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163 987 987 #define KVM_CAP_EXCEPTION_PAYLOAD 164 988 988 #define KVM_CAP_ARM_VM_IPA_SIZE 165 989 - #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 989 + #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 /* Obsolete */ 990 990 #define KVM_CAP_HYPERV_CPUID 167 991 + #define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 168 992 + #define KVM_CAP_PPC_IRQ_XIVE 169 993 + #define KVM_CAP_ARM_SVE 170 994 + #define KVM_CAP_ARM_PTRAUTH_ADDRESS 171 995 + #define KVM_CAP_ARM_PTRAUTH_GENERIC 172 991 996 992 997 #ifdef KVM_CAP_IRQ_ROUTING 993 998 ··· 1150 1145 #define KVM_REG_SIZE_U256 0x0050000000000000ULL 1151 1146 #define KVM_REG_SIZE_U512 0x0060000000000000ULL 1152 1147 #define KVM_REG_SIZE_U1024 0x0070000000000000ULL 1148 + #define KVM_REG_SIZE_U2048 0x0080000000000000ULL 1153 1149 1154 1150 struct kvm_reg_list { 1155 1151 __u64 n; /* number of regs */ ··· 1217 1211 #define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V3 1218 1212 KVM_DEV_TYPE_ARM_VGIC_ITS, 1219 1213 #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS 1214 + KVM_DEV_TYPE_XIVE, 1215 + #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE 1220 1216 KVM_DEV_TYPE_MAX, 1221 1217 }; 1222 1218 ··· 1442 1434 #define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state) 1443 1435 #define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state) 1444 1436 1445 - /* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT */ 1437 + /* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT_2 */ 1446 1438 #define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log) 1447 1439 1448 1440 /* Available with KVM_CAP_HYPERV_CPUID */ 1449 1441 #define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2) 1442 + 1443 + /* Available with KVM_CAP_ARM_SVE */ 1444 + #define KVM_ARM_VCPU_FINALIZE _IOW(KVMIO, 0xc2, int) 1450 1445 1451 1446 /* Secure Encrypted Virtualization command */ 1452 1447 enum sev_cmd_id {