Skip to content

Commit 6932704

Browse files
committed
Merge branch 'kvm-uapi'
More cleanups of KVM's main header: * remove thoroughly obsolete APIs * move architecture-dependent stuff to uapi/asm/kvm.h * small cleanups to __KVM_HAVE_* symbols
2 parents 0473719 + db7d6fb commit 6932704

File tree

19 files changed

+672
-714
lines changed

19 files changed

+672
-714
lines changed

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.

arch/arm64/kvm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ menuconfig KVM
3636
select HAVE_KVM_IRQ_ROUTING
3737
select IRQ_BYPASS_MANAGER
3838
select HAVE_KVM_IRQ_BYPASS
39+
select HAVE_KVM_READONLY_MEM
3940
select HAVE_KVM_VCPU_RUN_PID_CHANGE
4041
select SCHED_INFO
4142
select GUEST_PERF_EVENTS if PERF_EVENTS

arch/loongarch/include/uapi/asm/kvm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* Some parts derived from the x86 version of this file.
1515
*/
1616

17-
#define __KVM_HAVE_READONLY_MEM
18-
1917
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
2018
#define KVM_DIRTY_LOG_PAGE_OFFSET 64
2119

arch/loongarch/kvm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config KVM
2828
select KVM_GENERIC_HARDWARE_ENABLING
2929
select KVM_GENERIC_MMU_NOTIFIER
3030
select KVM_MMIO
31+
select HAVE_KVM_READONLY_MEM
3132
select KVM_XFER_TO_GUEST_WORK
3233
help
3334
Support hosting virtualized guest machines using

arch/mips/include/uapi/asm/kvm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
* Some parts derived from the x86 version of this file.
2121
*/
2222

23-
#define __KVM_HAVE_READONLY_MEM
24-
2523
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
2624

2725
/*

arch/mips/kvm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ config KVM
2626
select KVM_MMIO
2727
select KVM_GENERIC_MMU_NOTIFIER
2828
select KVM_GENERIC_HARDWARE_ENABLING
29+
select HAVE_KVM_READONLY_MEM
2930
help
3031
Support for hosting Guest kernels.
3132

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 */

arch/riscv/include/uapi/asm/kvm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <asm/ptrace.h>
1717

1818
#define __KVM_HAVE_IRQ_LINE
19-
#define __KVM_HAVE_READONLY_MEM
2019

2120
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
2221

arch/riscv/kvm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config KVM
2424
select HAVE_KVM_IRQ_ROUTING
2525
select HAVE_KVM_MSI
2626
select HAVE_KVM_VCPU_ASYNC_IOCTL
27+
select HAVE_KVM_READONLY_MEM
2728
select KVM_COMMON
2829
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
2930
select KVM_GENERIC_HARDWARE_ENABLING

0 commit comments

Comments
 (0)