Skip to content

Commit d750951

Browse files
committed
KVM: powerpc: move powerpc-specific structs to uapi/asm/kvm.h
While this in principle breaks the appearance of KVM_PPC_* ioctls on architectures other than powerpc, this seems unlikely to be a problem considering that there are already many "struct kvm_ppc_*" definitions in arch/powerpc/include/uapi. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent bcac047 commit d750951

File tree

2 files changed

+44
-44
lines changed
  • arch/powerpc/include/uapi/asm
  • include/uapi/linux

2 files changed

+44
-44
lines changed

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,4 +733,48 @@ struct kvm_ppc_xive_eq {
733733
#define KVM_XIVE_TIMA_PAGE_OFFSET 0
734734
#define KVM_XIVE_ESB_PAGE_OFFSET 4
735735

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

include/uapi/linux/kvm.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -810,50 +810,6 @@ struct kvm_enable_cap {
810810
__u8 pad[64];
811811
};
812812

813-
/* for KVM_PPC_GET_PVINFO */
814-
815-
#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
816-
817-
struct kvm_ppc_pvinfo {
818-
/* out */
819-
__u32 flags;
820-
__u32 hcall[4];
821-
__u8 pad[108];
822-
};
823-
824-
/* for KVM_PPC_GET_SMMU_INFO */
825-
#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
826-
827-
struct kvm_ppc_one_page_size {
828-
__u32 page_shift; /* Page shift (or 0) */
829-
__u32 pte_enc; /* Encoding in the HPTE (>>12) */
830-
};
831-
832-
struct kvm_ppc_one_seg_page_size {
833-
__u32 page_shift; /* Base page shift of segment (or 0) */
834-
__u32 slb_enc; /* SLB encoding for BookS */
835-
struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
836-
};
837-
838-
#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
839-
#define KVM_PPC_1T_SEGMENTS 0x00000002
840-
#define KVM_PPC_NO_HASH 0x00000004
841-
842-
struct kvm_ppc_smmu_info {
843-
__u64 flags;
844-
__u32 slb_size;
845-
__u16 data_keys; /* # storage keys supported for data */
846-
__u16 instr_keys; /* # storage keys supported for instructions */
847-
struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
848-
};
849-
850-
/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */
851-
struct kvm_ppc_resize_hpt {
852-
__u64 flags;
853-
__u32 shift;
854-
__u32 pad;
855-
};
856-
857813
#define KVMIO 0xAE
858814

859815
/* machine type bits, to be used as argument to KVM_CREATE_VM */

0 commit comments

Comments
 (0)