Skip to content

Commit 1b8f516

Browse files
committed
tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h
The changes in the 3214d01 ("KVM: PPC: Book3S: Provide information about hardware/firmware CVE workarounds") commit right now will not produce any change in the tools, but that is because we still need to improve tools/perf/trace/beauty/kvm_ioctl.sh to build per arch string tables, so that we avoid assigning multiple times to the same command string entry, i.e. multiple defines, for different arches, have the same value, causing this: In file included from trace/beauty/ioctl.c:82:0: /tmp/build/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c: In function ‘ioctl__scnprintf_kvm_cmd’: /tmp/build/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:76:11: error: initialized field overwritten [-Werror=override-init] /tmp/build/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:88:11: note: (near initialization for ‘kvm_ioctl_cmds[165]’) /tmp/build/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:90:11: error: initialized field overwritten [-Werror=override-init] [0xa6] = "PPC_GET_SMMU_INFO", ^~~~~~~~~~~~~~~~~~~ So the onlye effect of updating the tools/ copy of ppc's kvm.h header is to silence these perf build warnings: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/kvm.h' differs from latest version at 'arch/powerpc/include/uapi/asm/kvm.h' At some point we should do what we did for the errno tables and create per-arch string translation tables for the KVM ioctl commands for the architectures supporting KVM, such as s/390, PowerPC, x86_64 and ARM. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Hendrik Brueckner <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Wang Nan <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 9a38535 commit 1b8f516

File tree

2 files changed

+29
-0
lines changed
  • tools
    • arch/powerpc/include/uapi/asm
    • include/uapi/linux

2 files changed

+29
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,31 @@ struct kvm_ppc_rmmu_info {
443443
__u32 ap_encodings[8];
444444
};
445445

446+
/* For KVM_PPC_GET_CPU_CHAR */
447+
struct kvm_ppc_cpu_char {
448+
__u64 character; /* characteristics of the CPU */
449+
__u64 behaviour; /* recommended software behaviour */
450+
__u64 character_mask; /* valid bits in character */
451+
__u64 behaviour_mask; /* valid bits in behaviour */
452+
};
453+
454+
/*
455+
* Values for character and character_mask.
456+
* These are identical to the values used by H_GET_CPU_CHARACTERISTICS.
457+
*/
458+
#define KVM_PPC_CPU_CHAR_SPEC_BAR_ORI31 (1ULL << 63)
459+
#define KVM_PPC_CPU_CHAR_BCCTRL_SERIALISED (1ULL << 62)
460+
#define KVM_PPC_CPU_CHAR_L1D_FLUSH_ORI30 (1ULL << 61)
461+
#define KVM_PPC_CPU_CHAR_L1D_FLUSH_TRIG2 (1ULL << 60)
462+
#define KVM_PPC_CPU_CHAR_L1D_THREAD_PRIV (1ULL << 59)
463+
#define KVM_PPC_CPU_CHAR_BR_HINT_HONOURED (1ULL << 58)
464+
#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
465+
#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
466+
467+
#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
468+
#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
469+
#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
470+
446471
/* Per-vcpu XICS interrupt controller state */
447472
#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
448473

tools/include/uapi/linux/kvm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,8 @@ struct kvm_ppc_resize_hpt {
932932
#define KVM_CAP_HYPERV_SYNIC2 148
933933
#define KVM_CAP_HYPERV_VP_INDEX 149
934934
#define KVM_CAP_S390_AIS_MIGRATION 150
935+
#define KVM_CAP_PPC_GET_CPU_CHAR 151
936+
#define KVM_CAP_S390_BPB 152
935937

936938
#ifdef KVM_CAP_IRQ_ROUTING
937939

@@ -1261,6 +1263,8 @@ struct kvm_s390_ucas_mapping {
12611263
#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg)
12621264
/* Available with KVM_CAP_PPC_RADIX_MMU */
12631265
#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
1266+
/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
1267+
#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
12641268

12651269
/* ioctl for vm fd */
12661270
#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)

0 commit comments

Comments
 (0)