Skip to content

Commit bee3b82

Browse files
committed
tools/include: Sync uapi/linux/kvm.h and asm/kvm.h with the kernel sources
To pick up the changes from: 6bda055 ("KVM: define __KVM_HAVE_GUEST_DEBUG unconditionally") 5d9cb71 ("KVM: arm64: move ARM-specific defines to uapi/asm/kvm.h") 71cd774 ("KVM: s390: move s390-specific structs to uapi/asm/kvm.h") d750951 ("KVM: powerpc: move powerpc-specific structs to uapi/asm/kvm.h") bcac047 ("KVM: x86: move x86-specific structs to uapi/asm/kvm.h") c0a4119 ("KVM: remove more traces of device assignment UAPI") f3c8006 ("KVM: SEV: fix compat ABI for KVM_MEMORY_ENCRYPT_OP") That should be used to beautify the KVM arguments and it addresses these tools/perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h Cc: Paolo Bonzini <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4cfa8a8 commit bee3b82

File tree

5 files changed

+672
-700
lines changed
  • tools
    • arch
      • arm64/include/uapi/asm
      • powerpc/include/uapi/asm
      • s390/include/uapi/asm
      • x86/include/uapi/asm
    • include/uapi/linux

5 files changed

+672
-700
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
#include <asm/ptrace.h>
3838
#include <asm/sve_context.h>
3939

40-
#define __KVM_HAVE_GUEST_DEBUG
4140
#define __KVM_HAVE_IRQ_LINE
42-
#define __KVM_HAVE_READONLY_MEM
4341
#define __KVM_HAVE_VCPU_EVENTS
4442

4543
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -76,11 +74,11 @@ struct kvm_regs {
7674

7775
/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
7876
#define KVM_ARM_DEVICE_TYPE_SHIFT 0
79-
#define KVM_ARM_DEVICE_TYPE_MASK GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
80-
KVM_ARM_DEVICE_TYPE_SHIFT)
77+
#define KVM_ARM_DEVICE_TYPE_MASK __GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
78+
KVM_ARM_DEVICE_TYPE_SHIFT)
8179
#define KVM_ARM_DEVICE_ID_SHIFT 16
82-
#define KVM_ARM_DEVICE_ID_MASK GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
83-
KVM_ARM_DEVICE_ID_SHIFT)
80+
#define KVM_ARM_DEVICE_ID_MASK __GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
81+
KVM_ARM_DEVICE_ID_SHIFT)
8482

8583
/* Supported device IDs */
8684
#define KVM_ARM_DEVICE_VGIC_V2 0
@@ -162,6 +160,11 @@ struct kvm_sync_regs {
162160
__u64 device_irq_level;
163161
};
164162

163+
/* Bits for run->s.regs.device_irq_level */
164+
#define KVM_ARM_DEV_EL1_VTIMER (1 << 0)
165+
#define KVM_ARM_DEV_EL1_PTIMER (1 << 1)
166+
#define KVM_ARM_DEV_PMU (1 << 2)
167+
165168
/*
166169
* PMU filter structure. Describe a range of events with a particular
167170
* action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER.

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#define __KVM_HAVE_PPC_SMT
2929
#define __KVM_HAVE_IRQCHIP
3030
#define __KVM_HAVE_IRQ_LINE
31-
#define __KVM_HAVE_GUEST_DEBUG
3231

3332
/* Not always available, but if it is, this is the correct offset. */
3433
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -733,4 +732,48 @@ struct kvm_ppc_xive_eq {
733732
#define KVM_XIVE_TIMA_PAGE_OFFSET 0
734733
#define KVM_XIVE_ESB_PAGE_OFFSET 4
735734

735+
/* for KVM_PPC_GET_PVINFO */
736+
737+
#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
738+
739+
struct kvm_ppc_pvinfo {
740+
/* out */
741+
__u32 flags;
742+
__u32 hcall[4];
743+
__u8 pad[108];
744+
};
745+
746+
/* for KVM_PPC_GET_SMMU_INFO */
747+
#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
748+
749+
struct kvm_ppc_one_page_size {
750+
__u32 page_shift; /* Page shift (or 0) */
751+
__u32 pte_enc; /* Encoding in the HPTE (>>12) */
752+
};
753+
754+
struct kvm_ppc_one_seg_page_size {
755+
__u32 page_shift; /* Base page shift of segment (or 0) */
756+
__u32 slb_enc; /* SLB encoding for BookS */
757+
struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
758+
};
759+
760+
#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
761+
#define KVM_PPC_1T_SEGMENTS 0x00000002
762+
#define KVM_PPC_NO_HASH 0x00000004
763+
764+
struct kvm_ppc_smmu_info {
765+
__u64 flags;
766+
__u32 slb_size;
767+
__u16 data_keys; /* # storage keys supported for data */
768+
__u16 instr_keys; /* # storage keys supported for instructions */
769+
struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
770+
};
771+
772+
/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */
773+
struct kvm_ppc_resize_hpt {
774+
__u64 flags;
775+
__u32 shift;
776+
__u32 pad;
777+
};
778+
736779
#endif /* __LINUX_KVM_POWERPC_H */

0 commit comments

Comments
 (0)