From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ADEEC43381 for ; Sat, 2 Mar 2019 03:39:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0797120838 for ; Sat, 2 Mar 2019 03:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbfCBDi7 (ORCPT ); Fri, 1 Mar 2019 22:38:59 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:53560 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726412AbfCBDi7 (ORCPT ); Fri, 1 Mar 2019 22:38:59 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A4143D35FE599429F0AD; Sat, 2 Mar 2019 11:38:54 +0800 (CST) Received: from HGHY2Y004646261.china.huawei.com (10.184.12.158) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Sat, 2 Mar 2019 11:38:48 +0800 From: Zenghui Yu To: , CC: , , , , , , , Zenghui Yu , Punit Agrawal Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled Date: Sat, 2 Mar 2019 03:35:28 +0000 Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> X-Mailer: git-send-email 2.6.4.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.184.12.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The idea behind this is: we don't want to keep tracking of huge pages when logging_active is true, which will result in performance degradation. We still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it to force a PTE mapping. Cc: Suzuki K Poulose Cc: Punit Agrawal Signed-off-by: Zenghui Yu --- Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the "vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far as I can tell, we used to have "hugetlb" to force the PTE mapping, but we have "vma_pagesize" currently instead. We should set it properly for performance reasons (e.g, in VM migration). Did I miss something important? --- virt/kvm/arm/mmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 30251e2..7d41b16 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) && !force_pte) { gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT; + } else { + /* + * Fallback to PTE if it's not one of the stage2 + * supported hugepage sizes or the corresponding level + * doesn't exist, or logging is enabled. + */ + vma_pagesize = PAGE_SIZE; } up_read(¤t->mm->mmap_sem); -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zenghui Yu Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled Date: Sat, 2 Mar 2019 03:35:28 +0000 Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: linux-kernel-owner@vger.kernel.org To: christoffer.dall@arm.com, marc.zyngier@arm.com Cc: james.morse@arm.com, julien.thierry@arm.com, suzuki.poulose@arm.com, wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Zenghui Yu , Punit Agrawal List-Id: kvmarm@lists.cs.columbia.edu The idea behind this is: we don't want to keep tracking of huge pages when logging_active is true, which will result in performance degradation. We still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it to force a PTE mapping. Cc: Suzuki K Poulose Cc: Punit Agrawal Signed-off-by: Zenghui Yu --- Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the "vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far as I can tell, we used to have "hugetlb" to force the PTE mapping, but we have "vma_pagesize" currently instead. We should set it properly for performance reasons (e.g, in VM migration). Did I miss something important? --- virt/kvm/arm/mmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 30251e2..7d41b16 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) && !force_pte) { gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT; + } else { + /* + * Fallback to PTE if it's not one of the stage2 + * supported hugepage sizes or the corresponding level + * doesn't exist, or logging is enabled. + */ + vma_pagesize = PAGE_SIZE; } up_read(¤t->mm->mmap_sem); -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B5D0C43381 for ; Sat, 2 Mar 2019 03:39:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 088E420838 for ; Sat, 2 Mar 2019 03:39:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vi2hvwN4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 088E420838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IQgv0xFaUVEQbmIYj0fYqV0MnOHLbzgsw1edBCCXpng=; b=Vi2hvwN4F5MaS5 EgVksL0v9A8RKyXcC1W9tYNtfZIe8bv7ioUqSTv0lm0//OXxF4gRo9pWKuGRGIB4KHt4IN1oBHyLO p50R4gvEOImQuBBhriGAZzbWRIOkVLmubeh8o35MEHNcYhwSCj6uzVRbpPZZdfCsOvEJUJjZG98+f u/b6kKTlI1pEMLYgKipQb8HPh/iheT7ogf4J9Pmz/vnGqmTgFDjc8+33rK4hsGzjGc0dyDifnb2c2 NMNjaW76zq/qpGca7y0ni/01rkkG8H1dFBLIJjnZ/mw8W8RprBlgpFM939Fcni5++JAYx6iGIF9Pd 9gsS/hfsiryjagCwvsMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzvUP-00012h-Cf; Sat, 02 Mar 2019 03:39:05 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzvUL-00011X-F1 for linux-arm-kernel@lists.infradead.org; Sat, 02 Mar 2019 03:39:03 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A4143D35FE599429F0AD; Sat, 2 Mar 2019 11:38:54 +0800 (CST) Received: from HGHY2Y004646261.china.huawei.com (10.184.12.158) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Sat, 2 Mar 2019 11:38:48 +0800 From: Zenghui Yu To: , Subject: [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled Date: Sat, 2 Mar 2019 03:35:28 +0000 Message-ID: <1551497728-12576-1-git-send-email-yuzenghui@huawei.com> X-Mailer: git-send-email 2.6.4.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.184.12.158] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_193901_666899_195D346F X-CRM114-Status: GOOD ( 10.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Punit Agrawal , suzuki.poulose@arm.com, julien.thierry@arm.com, linux-kernel@vger.kernel.org, james.morse@arm.com, Zenghui Yu , wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The idea behind this is: we don't want to keep tracking of huge pages when logging_active is true, which will result in performance degradation. We still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it to force a PTE mapping. Cc: Suzuki K Poulose Cc: Punit Agrawal Signed-off-by: Zenghui Yu --- Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the "vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far as I can tell, we used to have "hugetlb" to force the PTE mapping, but we have "vma_pagesize" currently instead. We should set it properly for performance reasons (e.g, in VM migration). Did I miss something important? --- virt/kvm/arm/mmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c index 30251e2..7d41b16 100644 --- a/virt/kvm/arm/mmu.c +++ b/virt/kvm/arm/mmu.c @@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) && !force_pte) { gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT; + } else { + /* + * Fallback to PTE if it's not one of the stage2 + * supported hugepage sizes or the corresponding level + * doesn't exist, or logging is enabled. + */ + vma_pagesize = PAGE_SIZE; } up_read(¤t->mm->mmap_sem); -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel