Skip to content

Commit c499d1f

Browse files
committed
tools arch kvm: Sync kvm headers with the kernel sources
To pick up the changes from: 41040cf ("arm64/sve: Fix missing SVE/FPSIMD endianness conversions") 6ca00df ("KVM: x86: Modify struct kvm_nested_state to have explicit fields for data") None entail changes in tooling. This silences these tools/perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h' diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/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: Dave Martin <Dave.Martin@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Liran Alon <liran.alon@oracle.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Link: https://lkml.kernel.org/n/tip-1cdbq5ulr4d6cx3iv2ye5wdv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 69bf4b6 commit c499d1f

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

  • tools/arch
    • arm64/include/uapi/asm
    • x86/include/uapi/asm

‎tools/arch/arm64/include/uapi/asm/kvm.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ struct kvm_vcpu_events {
260260
KVM_REG_SIZE_U256 | \
261261
((i) & (KVM_ARM64_SVE_MAX_SLICES - 1)))
262262

263+
/*
264+
* Register values for KVM_REG_ARM64_SVE_ZREG(), KVM_REG_ARM64_SVE_PREG() and
265+
* KVM_REG_ARM64_SVE_FFR() are represented in memory in an endianness-
266+
* invariant layout which differs from the layout used for the FPSIMD
267+
* V-registers on big-endian systems: see sigcontext.h for more explanation.
268+
*/
269+
263270
#define KVM_ARM64_SVE_VQ_MIN __SVE_VQ_MIN
264271
#define KVM_ARM64_SVE_VQ_MAX __SVE_VQ_MAX
265272

‎tools/arch/x86/include/uapi/asm/kvm.h‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,24 @@ struct kvm_sync_regs {
383383
#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
384384
#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
385385

386+
#define KVM_STATE_NESTED_FORMAT_VMX 0
387+
#define KVM_STATE_NESTED_FORMAT_SVM 1 /* unused */
388+
386389
#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
387390
#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
388391
#define KVM_STATE_NESTED_EVMCS 0x00000004
389392

390393
#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
391394
#define KVM_STATE_NESTED_SMM_VMXON 0x00000002
392395

393-
struct kvm_vmx_nested_state {
396+
#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
397+
398+
struct kvm_vmx_nested_state_data {
399+
__u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
400+
__u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
401+
};
402+
403+
struct kvm_vmx_nested_state_hdr {
394404
__u64 vmxon_pa;
395405
__u64 vmcs12_pa;
396406

@@ -401,24 +411,25 @@ struct kvm_vmx_nested_state {
401411

402412
/* for KVM_CAP_NESTED_STATE */
403413
struct kvm_nested_state {
404-
/* KVM_STATE_* flags */
405414
__u16 flags;
406-
407-
/* 0 for VMX, 1 for SVM. */
408415
__u16 format;
409-
410-
/* 128 for SVM, 128 + VMCS size for VMX. */
411416
__u32 size;
412417

413418
union {
414-
/* VMXON, VMCS */
415-
struct kvm_vmx_nested_state vmx;
419+
struct kvm_vmx_nested_state_hdr vmx;
416420

417421
/* Pad the header to 128 bytes. */
418422
__u8 pad[120];
419-
};
423+
} hdr;
420424

421-
__u8 data[0];
425+
/*
426+
* Define data region as 0 bytes to preserve backwards-compatability
427+
* to old definition of kvm_nested_state in order to avoid changing
428+
* KVM_{GET,PUT}_NESTED_STATE ioctl values.
429+
*/
430+
union {
431+
struct kvm_vmx_nested_state_data vmx[0];
432+
} data;
422433
};
423434

424435
#endif /* _ASM_X86_KVM_H */

0 commit comments

Comments
 (0)