From patchwork Wed Jun 10 06:27:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenwei Tao X-Patchwork-Id: 6576741 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D034F9F74F for ; Wed, 10 Jun 2015 06:33:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0570F20528 for ; Wed, 10 Jun 2015 06:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AEDE205BE for ; Wed, 10 Jun 2015 06:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933320AbbFJGdF (ORCPT ); Wed, 10 Jun 2015 02:33:05 -0400 Received: from mail-pd0-f195.google.com ([209.85.192.195]:35659 "EHLO mail-pd0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933296AbbFJGc7 (ORCPT ); Wed, 10 Jun 2015 02:32:59 -0400 Received: by pdbht2 with SMTP id ht2so7454563pdb.2; Tue, 09 Jun 2015 23:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a23D6DkeNW/3WTylosLln4aTlo3VgzJ+hpVsgJXALnI=; b=xqh74KKYkQJZKF1+H/zZIpJ/PzUpnbahYbqsKXqdvvn4TCQk3EiiFWCC6cqSEZLzoj +J9ULPTJJe3RtBUELRGwgOgYzYdZhaRnVbhj2YQMFR2OfSCMx6aV3Ngy1lVk1gV8Xi+C +nM+2fLlpGUuZMI5cJbGxdX3R7NO6hy2/uDEb+b7FEoQ2YPOHe8+YfjFU4yHmyxP0uYY hN5LWtujHfOI35SsLUWPiGXZVu7kJ3gFePYi1ieZqt26arRI+KHHk1Q+TIGgE9HtHlag 9A6/4fjqG4xbFp3lCW1C5W0gSX5anXlL/AWG9UMCjTcnxab12cJSsuZ1NPXcqpNcNP3g t1Tw== X-Received: by 10.70.40.131 with SMTP id x3mr2896022pdk.83.1433917978859; Tue, 09 Jun 2015 23:32:58 -0700 (PDT) Received: from wenweitao01ubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id ve1sm7425188pbc.52.2015.06.09.23.32.52 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 23:32:57 -0700 (PDT) From: Wenwei Tao To: izik.eidus@ravellosystems.com, aarcange@redhat.com, chrisw@sous-sol.org, hughd@google.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, viro@zeniv.linux.org.uk Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, wenweitaowenwei@gmail.com Subject: [RFC PATCH 6/6] powerpc/kvm: change the condition of identifying hugetlb vm Date: Wed, 10 Jun 2015 14:27:19 +0800 Message-Id: <1433917639-31699-7-git-send-email-wenweitaowenwei@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1433917639-31699-1-git-send-email-wenweitaowenwei@gmail.com> References: <1433917639-31699-1-git-send-email-wenweitaowenwei@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hugetlb VMAs are not mergeable, that means a VMA couldn't have VM_HUGETLB and VM_MERGEABLE been set in the same time. So we use VM_HUGETLB to indicate new mergeable VMAs. Because of that a VMA which has VM_HUGETLB been set is a hugetlb VMA only if it doesn't have VM_MERGEABLE been set in the same time. Signed-off-by: Wenwei Tao --- arch/powerpc/kvm/e500_mmu_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index cc536d4..d76f518 100644 --- a/arch/powerpc/kvm/e500_mmu_host.c +++ b/arch/powerpc/kvm/e500_mmu_host.c @@ -423,7 +423,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, break; } } else if (vma && hva >= vma->vm_start && - (vma->vm_flags & VM_HUGETLB)) { + ((vma->vm_flags & (VM_HUGETLB | VM_MERGEABLE)) == + VM_HUGETLB)) { unsigned long psize = vma_kernel_pagesize(vma); tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>