History

KVM: PPC: Book3S HV: HPT resizing documentation and reserved numbers

This adds a new powerpc-specific KVM_CAP_SPAPR_RESIZE_HPT capability to advertise whether KVM is capable of handling the PAPR extensions for resizing the hashed page table during guest runtime. It also adds definitions for two new VM ioctl()s to implement this extension, and documentation of the same. Note that, HPT resizing is already possible with KVM PR without kernel modification, since the HPT is managed within userspace (qemu). The capability defined here will only be set where an in-kernel implementation of resizing is necessary, i.e. for KVM HV. To determine if the userspace resize implementation can be used, it's necessary to check KVM_CAP_PPC_ALLOC_HTAB. Unfortunately older kernels incorrectly set KVM_CAP_PPC_ALLOC_HTAB even with KVM PR. If userspace it want to support resizing with KVM PR on such kernels, it will need a workaround.

David Gibson committed 9 years ago

Commit ef1ead01 parent ccc4df42 files · +106 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+11−0
@@ -685,6 +685,13 @@ struct kvm_ppc_smmu_info { · 684 unmodified lines
685685 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
686686 };
687687
688+/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */
689+struct kvm_ppc_resize_hpt {
690+ __u64 flags;
691+ __u32 shift;
692+ __u32 pad;
693+};
694+
688695 #define KVMIO 0xAE
689696
690697 /* machine type bits, to be used as argument to KVM_CREATE_VM */
@@ -871,6 +878,7 @@ struct kvm_ppc_smmu_info { · 180 unmodified lines
871878 #define KVM_CAP_S390_USER_INSTR0 130
872879 #define KVM_CAP_MSI_DEVID 131
873880 #define KVM_CAP_PPC_HTM 132
881+#define KVM_CAP_SPAPR_RESIZE_HPT 133
874882 #define KVM_CAP_PPC_MMU_RADIX 134
875883 #define KVM_CAP_PPC_MMU_HASH_V3 135
876884
@@ -1189,6 +1197,9 @@ struct kvm_s390_ucas_mapping { · 312 unmodified lines
11891197 #define KVM_ARM_SET_DEVICE_ADDR _IOW(KVMIO, 0xab, struct kvm_arm_device_addr)
11901198 /* Available with KVM_CAP_PPC_RTAS */
11911199 #define KVM_PPC_RTAS_DEFINE_TOKEN _IOW(KVMIO, 0xac, struct kvm_rtas_token_args)
1200+/* Available with KVM_CAP_SPAPR_RESIZE_HPT */
1201+#define KVM_PPC_RESIZE_HPT_PREPARE _IOR(KVMIO, 0xad, struct kvm_ppc_resize_hpt)
1202+#define KVM_PPC_RESIZE_HPT_COMMIT _IOR(KVMIO, 0xae, struct kvm_ppc_resize_hpt)
11921203 /* Available with KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3 */
11931204 #define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg)
11941205 /* Available with KVM_CAP_PPC_RADIX_MMU */