From patchwork Fri Sep 25 16:18:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 50137 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8PGLJbd013319 for ; Fri, 25 Sep 2009 16:21:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208AbZIYQUu (ORCPT ); Fri, 25 Sep 2009 12:20:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753234AbZIYQUt (ORCPT ); Fri, 25 Sep 2009 12:20:49 -0400 Received: from goliath.siemens.de ([192.35.17.28]:21568 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753208AbZIYQUs (ORCPT ); Fri, 25 Sep 2009 12:20:48 -0400 Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n8PGKcoc007721; Fri, 25 Sep 2009 18:20:38 +0200 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n8PGKbEF004507; Fri, 25 Sep 2009 18:20:37 +0200 From: Jan Kiszka Subject: [PATCH 3/9] kvm_vma_kernel_pagesize support To: Avi Kivity Cc: kvm@vger.kernel.org Date: Fri, 25 Sep 2009 18:18:01 +0200 Message-ID: <20090925161801.3328.96058.stgit@mchn012c.ww002.siemens.net> In-Reply-To: <20090925161801.3328.30406.stgit@mchn012c.ww002.siemens.net> References: <20090925161801.3328.30406.stgit@mchn012c.ww002.siemens.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org It was broken for !CONFIG_HUGETLB_PAGE and for kernel 2.6.31. Signed-off-by: Jan Kiszka --- external-module-compat-comm.h | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 -/* 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