From patchwork Wed May 1 09:44:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zenghui Yu X-Patchwork-Id: 10924735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52E9592A for ; Wed, 1 May 2019 09:48:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3B128BEB for ; Wed, 1 May 2019 09:48:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BB1828C2C; Wed, 1 May 2019 09:48:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 083C328BEB for ; Wed, 1 May 2019 09:48:35 +0000 (UTC) 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=THluHqdKavr3gLMkWnAi2mdAvHMMNDyrK7MYxp5eems=; b=ldtpaiymlYwF/o SAoco1Kf+NqtHT09aJXAj2hG06JxmLVI29zC5ZMVbBxt7+j6FZhKOHvWcwfExrBa2YRe5pzZeBCVd 1LZYCqwNmekAZZET0WElq4zc5ljBkcW2sHQ37hlMS07ADi3k2klxVGrNcL4iFX+qvy0x5oZP55s1V WOsseGILjVSLeKQEq9EALjPYykhETS13Zyo/Xsa5rzpm8h1Y9IQWmXDlPw8q6cREET4dPCs9A7b1x n9RzorpDvqrjhsob9lLPp+0SoRQSey3/+i6GK/ON6PIIJAIuvnV4voWW+xa8sDlhMzXAPyg6vK7Ti VZlXpCvd1WisKm5XB3GQ==; 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 1hLlqp-0005Yu-0M; Wed, 01 May 2019 09:48:31 +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 1hLlqk-0005X7-VZ for linux-arm-kernel@lists.infradead.org; Wed, 01 May 2019 09:48:28 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BC752D90602CEF28528A; Wed, 1 May 2019 17:48:14 +0800 (CST) Received: from HGHY2Y004646261.china.huawei.com (10.184.12.158) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 1 May 2019 17:48:06 +0800 From: Zenghui Yu To: , , , Subject: [RFC PATCH 0/5] KVM: arm64: Add support for contiguous PTE/PMD hugepages at stage2 Date: Wed, 1 May 2019 09:44:22 +0000 Message-ID: <1556703867-22396-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-20190501_024827_194576_82D8CDE8 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. 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: julien.thierry@arm.com, marc.zyngier@arm.com, catalin.marinas@arm.com, suzuki.poulose@arm.com, will.deacon@arm.com, christoffer.dall@arm.com, linux@armlinux.org.uk, james.morse@arm.com, Zenghui Yu , wanghaibin.wang@huawei.com, steve.capper@arm.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, we support the following page sizes at stage2: PTE PMD PUD ----- ----- ----- 4K granule: 4K 2M 1G 16K granule: 16K 32M 64K granule: 64K 512M And we have Contiguous bit[52] in stage2 VMSAv8-64 block and page descriptors. As ARM ARM said, when the value of the Contiguous bit is 1, it indicates that the entry is one of a number of adjacent translation table entries that point to a contiguous output address range. This series add support for contiguous PTE/PMD hugepages at stage2 and then we can create huge mappings with following additional sizes: CONT PTE CONT PMD -------- -------- 4K granule: 64K 32M 16K granule: 2M 1G 64K granule: 2M 16G These patches are based on v5.1.0-rc7 and have been tested on Taishan 2280 server (D05) with 4K and 64K granule. Any comments will be appreciated, thanks! Zenghui Yu (5): KVM: arm/arm64: Introduce helpers for page table enties with contiguous bit KVM: arm/arm64: Re-factor building the stage2 page table entries KVM: arm/arm64: Support dirty page tracking for contiguous hugepages KVM: arm/arm64: Add support for creating PTE contiguous hugepages at stage2 KVM: arm/arm64: Add support for creating PMD contiguous hugepages at stage2 arch/arm/include/asm/kvm_mmu.h | 22 +++ arch/arm/include/asm/pgtable-hwdef.h | 8 + arch/arm64/include/asm/kvm_mmu.h | 20 +++ virt/kvm/arm/mmu.c | 299 ++++++++++++++++++++++++++++++----- 4 files changed, 312 insertions(+), 37 deletions(-)