Skip to content

Commit b1d46bc

Browse files
committed
tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
To pick the changes in: fddd076 ("KVM: x86: Define AMD's #HV, #VC, and #SX exception vectors") f2f5519 ("KVM: x86: Define Control Protection Exception (#CP) vector") 9d6812d ("KVM: x86: Enable guest SSP read/write interface with new uAPIs") 06f2969 ("KVM: x86: Introduce KVM_{G,S}ET_ONE_REG uAPIs support") That just rebuilds kvm-stat.c on x86, no change in functionality. This silences these perf build warning: Warning: Kernel ABI header differences: diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h Please see tools/include/uapi/README for further details. Cc: Sean Christopherson <[email protected]> Cc: Yang Weijiang <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent fde7f62 commit b1d46bc

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

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

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
#define MC_VECTOR 18
3636
#define XM_VECTOR 19
3737
#define VE_VECTOR 20
38+
#define CP_VECTOR 21
39+
40+
#define HV_VECTOR 28
41+
#define VC_VECTOR 29
42+
#define SX_VECTOR 30
3843

3944
/* Select x86 specific features in <linux/kvm.h> */
4045
#define __KVM_HAVE_PIT
@@ -411,6 +416,35 @@ struct kvm_xcrs {
411416
__u64 padding[16];
412417
};
413418

419+
#define KVM_X86_REG_TYPE_MSR 2
420+
#define KVM_X86_REG_TYPE_KVM 3
421+
422+
#define KVM_X86_KVM_REG_SIZE(reg) \
423+
({ \
424+
reg == KVM_REG_GUEST_SSP ? KVM_REG_SIZE_U64 : 0; \
425+
})
426+
427+
#define KVM_X86_REG_TYPE_SIZE(type, reg) \
428+
({ \
429+
__u64 type_size = (__u64)type << 32; \
430+
\
431+
type_size |= type == KVM_X86_REG_TYPE_MSR ? KVM_REG_SIZE_U64 : \
432+
type == KVM_X86_REG_TYPE_KVM ? KVM_X86_KVM_REG_SIZE(reg) : \
433+
0; \
434+
type_size; \
435+
})
436+
437+
#define KVM_X86_REG_ID(type, index) \
438+
(KVM_REG_X86 | KVM_X86_REG_TYPE_SIZE(type, index) | index)
439+
440+
#define KVM_X86_REG_MSR(index) \
441+
KVM_X86_REG_ID(KVM_X86_REG_TYPE_MSR, index)
442+
#define KVM_X86_REG_KVM(index) \
443+
KVM_X86_REG_ID(KVM_X86_REG_TYPE_KVM, index)
444+
445+
/* KVM-defined registers starting from 0 */
446+
#define KVM_REG_GUEST_SSP 0
447+
414448
#define KVM_SYNC_X86_REGS (1UL << 0)
415449
#define KVM_SYNC_X86_SREGS (1UL << 1)
416450
#define KVM_SYNC_X86_EVENTS (1UL << 2)

0 commit comments

Comments
 (0)