[PATCH 3/9] kvm_vma_kernel_pagesize support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It was broken for !CONFIG_HUGETLB_PAGE and for kernel 2.6.31.

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---

 external-module-compat-comm.h |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index c72fb86..47fdc86 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -954,9 +954,10 @@ static inline int kvm_eventfd_signal(struct eventfd_ctx *ctx, int n)
 
 #include <linux/hugetlb.h>
 
-/* vma_kernel_pagesize, 2.6.29 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+/* vma_kernel_pagesize, exported since 2.6.32 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 
+#ifdef CONFIG_HUGETLB_PAGE
 static inline
 unsigned long kvm_vma_kernel_pagesize(struct vm_area_struct *vma)
 {
@@ -969,8 +970,11 @@ unsigned long kvm_vma_kernel_pagesize(struct vm_area_struct *vma)
 
 	return 1UL << (hstate->order + PAGE_SHIFT);
 }
+#else /* !CONFIG_HUGETLB_SIZE */
+#define kvm_vma_kernel_pagesize(v) PAGE_SIZE
+#endif
 
-#else
+#else /* >= 2.6.32 */
 
 #define kvm_vma_kernel_pagesize vma_kernel_pagesize
 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux