Skip to content

Commit 75143fb

Browse files
author
Jinrong Liang
committed
KVM: x86/PVM: Add pvm_trace.h header files to tools
Add the pvm_trace.h header files to the tools to provide the necessary header files for tools that require PVM support, such as perf. The change should not have any negative impact on the existing tools or the kernel itself, as it simply makes the header files available for use by the tools that need them. Signed-off-by: Jinrong Liang <cloudliang@tencent.com>
1 parent 0051721 commit 75143fb

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#ifndef UAPI_KVM_X86_PVM_TRACE_H
3+
#define UAPI_KVM_X86_PVM_TRACE_H
4+
5+
#include <linux/bitops.h>
6+
7+
#define NMI_VECTOR 0x02
8+
#define PVM_EXIT_REASONS_FAILED_VMENTRY 1025
9+
10+
#define PVM_EXIT_REASONS_SHIFT 16
11+
#define PVM_EXIT_REASONS_SYSCALL BIT(PVM_EXIT_REASONS_SHIFT)
12+
#define PVM_EXIT_REASONS_HYPERCALL (2UL << PVM_EXIT_REASONS_SHIFT)
13+
#define PVM_EXIT_REASONS_ERETU (3UL << PVM_EXIT_REASONS_SHIFT)
14+
#define PVM_EXIT_REASONS_ERETS (4UL << PVM_EXIT_REASONS_SHIFT)
15+
#define PVM_EXIT_REASONS_INTERRUPT (5UL << PVM_EXIT_REASONS_SHIFT)
16+
#define PVM_EXIT_REASONS_INT80 (6UL << PVM_EXIT_REASONS_SHIFT)
17+
18+
#define PVM_EXIT_REASONS_HC_IRQ_WIN (PVM_EXIT_REASONS_HYPERCALL + 1)
19+
#define PVM_EXIT_REASONS_HC_IRQ_HALT (PVM_EXIT_REASONS_HYPERCALL + 2)
20+
#define PVM_EXIT_REASONS_HC_LOAD_PGTBL (PVM_EXIT_REASONS_HYPERCALL + 3)
21+
#define PVM_EXIT_REASONS_HC_TLB_FLUSH (PVM_EXIT_REASONS_HYPERCALL + 4)
22+
#define PVM_EXIT_REASONS_HC_TLB_FLUSH_CURRENT (PVM_EXIT_REASONS_HYPERCALL + 5)
23+
#define PVM_EXIT_REASONS_HC_TLB_INVLPG (PVM_EXIT_REASONS_HYPERCALL + 6)
24+
#define PVM_EXIT_REASONS_HC_LOAD_GS (PVM_EXIT_REASONS_HYPERCALL + 7)
25+
#define PVM_EXIT_REASONS_HC_RDMSR (PVM_EXIT_REASONS_HYPERCALL + 8)
26+
#define PVM_EXIT_REASONS_HC_WRMSR (PVM_EXIT_REASONS_HYPERCALL + 9)
27+
#define PVM_EXIT_REASONS_HC_LOAD_TLS (PVM_EXIT_REASONS_HYPERCALL + 10)
28+
29+
#define PVM_EXIT_REASONS \
30+
{ DE_VECTOR, "DE excp" }, \
31+
{ DB_VECTOR, "DB excp" }, \
32+
{ NMI_VECTOR, "NMI excp" }, \
33+
{ BP_VECTOR, "BP excp" }, \
34+
{ OF_VECTOR, "OF excp" }, \
35+
{ BR_VECTOR, "BR excp" }, \
36+
{ UD_VECTOR, "UD excp" }, \
37+
{ NM_VECTOR, "NM excp" }, \
38+
{ DF_VECTOR, "DF excp" }, \
39+
{ TS_VECTOR, "TS excp" }, \
40+
{ SS_VECTOR, "SS excp" }, \
41+
{ GP_VECTOR, "GP excp" }, \
42+
{ PF_VECTOR, "PF excp" }, \
43+
{ MF_VECTOR, "MF excp" }, \
44+
{ AC_VECTOR, "AC excp" }, \
45+
{ MC_VECTOR, "MC excp" }, \
46+
{ XM_VECTOR, "XM excp" }, \
47+
{ VE_VECTOR, "VE excp" }, \
48+
{ PVM_EXIT_REASONS_SYSCALL, "SYSCALL" }, \
49+
{ PVM_EXIT_REASONS_HYPERCALL, "HYPERCALL" }, \
50+
{ PVM_EXIT_REASONS_ERETU, "ERETU" }, \
51+
{ PVM_EXIT_REASONS_ERETS, "ERETS" }, \
52+
{ PVM_EXIT_REASONS_INTERRUPT, "INTERRUPT" }, \
53+
{ PVM_EXIT_REASONS_INT80, "INT80" }, \
54+
{ PVM_EXIT_REASONS_HC_IRQ_WIN, "HC_IRQ_WIN" }, \
55+
{ PVM_EXIT_REASONS_HC_IRQ_HALT, "HC_IRQ_HALT" }, \
56+
{ PVM_EXIT_REASONS_HC_LOAD_PGTBL, "HC_LOAD_PGTBL" }, \
57+
{ PVM_EXIT_REASONS_HC_TLB_FLUSH, "HC_TLB_FLUSH" }, \
58+
{ PVM_EXIT_REASONS_HC_TLB_FLUSH_CURRENT, "HC_TLB_FLUSH_CURRENT" },\
59+
{ PVM_EXIT_REASONS_HC_TLB_INVLPG, "HC_TLB_INVLPG" }, \
60+
{ PVM_EXIT_REASONS_HC_LOAD_GS, "HC_LOAD_GS" }, \
61+
{ PVM_EXIT_REASONS_HC_RDMSR, "HC_RDMSR" }, \
62+
{ PVM_EXIT_REASONS_HC_WRMSR, "HC_WRMSR" }, \
63+
{ PVM_EXIT_REASONS_HC_LOAD_TLS, "HC_LOAD_TLS" }, \
64+
{ PVM_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }
65+
66+
#endif /* UAPI_KVM_X86_PVM_TRACE_H */

tools/perf/check-headers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ FILES=(
5050
"arch/powerpc/include/uapi/asm/perf_regs.h"
5151
"arch/s390/include/uapi/asm/perf_regs.h"
5252
"arch/x86/include/uapi/asm/perf_regs.h"
53+
"arch/x86/include/uapi/asm/pvm_trace.h"
5354
"arch/x86/include/uapi/asm/kvm.h"
5455
"arch/x86/include/uapi/asm/kvm_perf.h"
5556
"arch/x86/include/uapi/asm/svm.h"

0 commit comments

Comments
 (0)