mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
tools headers UAPI: Sync kvm.h headers with the kernel sources
To pick the changes in:
fb04a1eddb
("KVM: X86: Implement ring-based dirty memory tracking")
That result in these change in tooling:
$ tools/perf/trace/beauty/kvm_ioctl.sh > before
$ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
$ cp arch/x86/include/uapi/asm/kvm.h tools/arch/x86/include/uapi/asm/kvm.h
$ tools/perf/trace/beauty/kvm_ioctl.sh > after
$ diff -u before after
--- before 2020-12-21 11:55:45.229737066 -0300
+++ after 2020-12-21 11:55:56.379983393 -0300
@@ -90,6 +90,7 @@
[0xc0] = "CLEAR_DIRTY_LOG",
[0xc1] = "GET_SUPPORTED_HV_CPUID",
[0xc6] = "X86_SET_MSR_FILTER",
+ [0xc7] = "RESET_DIRTY_RINGS",
[0xe0] = "CREATE_DEVICE",
[0xe1] = "SET_DEVICE_ATTR",
[0xe2] = "GET_DEVICE_ATTR",
$
Now one can use that string in filters when tracing ioctls, etc.
And silences this perf build warning:
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/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
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
fde668244d
commit
288807fc3a
@ -12,6 +12,7 @@
|
||||
|
||||
#define KVM_PIO_PAGE_OFFSET 1
|
||||
#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
|
||||
#define KVM_DIRTY_LOG_PAGE_OFFSET 64
|
||||
|
||||
#define DE_VECTOR 0
|
||||
#define DB_VECTOR 1
|
||||
|
@ -250,6 +250,7 @@ struct kvm_hyperv_exit {
|
||||
#define KVM_EXIT_ARM_NISV 28
|
||||
#define KVM_EXIT_X86_RDMSR 29
|
||||
#define KVM_EXIT_X86_WRMSR 30
|
||||
#define KVM_EXIT_DIRTY_RING_FULL 31
|
||||
|
||||
/* For KVM_EXIT_INTERNAL_ERROR */
|
||||
/* Emulate instruction failed. */
|
||||
@ -1053,6 +1054,8 @@ struct kvm_ppc_resize_hpt {
|
||||
#define KVM_CAP_X86_USER_SPACE_MSR 188
|
||||
#define KVM_CAP_X86_MSR_FILTER 189
|
||||
#define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190
|
||||
#define KVM_CAP_SYS_HYPERV_CPUID 191
|
||||
#define KVM_CAP_DIRTY_LOG_RING 192
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
@ -1511,7 +1514,7 @@ struct kvm_enc_region {
|
||||
/* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT_2 */
|
||||
#define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log)
|
||||
|
||||
/* Available with KVM_CAP_HYPERV_CPUID */
|
||||
/* Available with KVM_CAP_HYPERV_CPUID (vcpu) / KVM_CAP_SYS_HYPERV_CPUID (system) */
|
||||
#define KVM_GET_SUPPORTED_HV_CPUID _IOWR(KVMIO, 0xc1, struct kvm_cpuid2)
|
||||
|
||||
/* Available with KVM_CAP_ARM_SVE */
|
||||
@ -1557,6 +1560,9 @@ struct kvm_pv_cmd {
|
||||
/* Available with KVM_CAP_X86_MSR_FILTER */
|
||||
#define KVM_X86_SET_MSR_FILTER _IOW(KVMIO, 0xc6, struct kvm_msr_filter)
|
||||
|
||||
/* Available with KVM_CAP_DIRTY_LOG_RING */
|
||||
#define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7)
|
||||
|
||||
/* Secure Encrypted Virtualization command */
|
||||
enum sev_cmd_id {
|
||||
/* Guest initialization commands */
|
||||
@ -1710,4 +1716,52 @@ struct kvm_hyperv_eventfd {
|
||||
#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0)
|
||||
#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1)
|
||||
|
||||
/*
|
||||
* Arch needs to define the macro after implementing the dirty ring
|
||||
* feature. KVM_DIRTY_LOG_PAGE_OFFSET should be defined as the
|
||||
* starting page offset of the dirty ring structures.
|
||||
*/
|
||||
#ifndef KVM_DIRTY_LOG_PAGE_OFFSET
|
||||
#define KVM_DIRTY_LOG_PAGE_OFFSET 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* KVM dirty GFN flags, defined as:
|
||||
*
|
||||
* |---------------+---------------+--------------|
|
||||
* | bit 1 (reset) | bit 0 (dirty) | Status |
|
||||
* |---------------+---------------+--------------|
|
||||
* | 0 | 0 | Invalid GFN |
|
||||
* | 0 | 1 | Dirty GFN |
|
||||
* | 1 | X | GFN to reset |
|
||||
* |---------------+---------------+--------------|
|
||||
*
|
||||
* Lifecycle of a dirty GFN goes like:
|
||||
*
|
||||
* dirtied harvested reset
|
||||
* 00 -----------> 01 -------------> 1X -------+
|
||||
* ^ |
|
||||
* | |
|
||||
* +------------------------------------------+
|
||||
*
|
||||
* The userspace program is only responsible for the 01->1X state
|
||||
* conversion after harvesting an entry. Also, it must not skip any
|
||||
* dirty bits, so that dirty bits are always harvested in sequence.
|
||||
*/
|
||||
#define KVM_DIRTY_GFN_F_DIRTY BIT(0)
|
||||
#define KVM_DIRTY_GFN_F_RESET BIT(1)
|
||||
#define KVM_DIRTY_GFN_F_MASK 0x3
|
||||
|
||||
/*
|
||||
* KVM dirty rings should be mapped at KVM_DIRTY_LOG_PAGE_OFFSET of
|
||||
* per-vcpu mmaped regions as an array of struct kvm_dirty_gfn. The
|
||||
* size of the gfn buffer is decided by the first argument when
|
||||
* enabling KVM_CAP_DIRTY_LOG_RING.
|
||||
*/
|
||||
struct kvm_dirty_gfn {
|
||||
__u32 flags;
|
||||
__u32 slot;
|
||||
__u64 offset;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_KVM_H */
|
||||
|
Loading…
Reference in New Issue
Block a user