Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp906508imu; Tue, 11 Dec 2018 09:21:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjUQOK81Qyd1MTNNNf3QBB0DGrA+GfE1s8UdkR95lL/E1raSdp9YDA35rBp7xhv6HG9INt X-Received: by 2002:a63:ac46:: with SMTP id z6mr15314134pgn.162.1544548892732; Tue, 11 Dec 2018 09:21:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548892; cv=none; d=google.com; s=arc-20160816; b=RL+Fj3plPyx9+gMhPgcZ1wBlsKQniXYp7RLk+65HPrMCmq7QO3EE4XUXMfeMXxKkeK QaQuqjh+pKWfAlyaWWj9w0ihI+mYjaptRakpZPjwbrp3pz1s9Gag4pGFGIRVjLKcENxD EWOyD9xsTyLcTkEJ5+T5J91aZeK1BzM2H6Xa/8kyod8aEZwCCRs2UunceQefwFtAaRNU lQa5t2H4hyD83NP80spP+QnipMgeNM3zlwTccHrXhA6t6MnuuouEDWoXPFTLluOlcL0R AFwDIaSDftl47VUd7kXUc7qjoQofFHZYgtkgCQLwBiJz8DG17kxW7CBi4/mUYOcvCIuY 3jww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=0gsOFq8fAQXJuSGc/wYyY4hrIuURVOSfpxQyTO/8lm0=; b=nTtuhlgXjEv8VEwM/BiW+SaKK3Abyt5dC3M249Ls8p5GvILJH8Mz+d0CJNsCz4I4zB +Mai6KHlO7hTftzDDHkrRslIZxukfaDfBpMkJ4p02ePcheof2K8hKASc8fPyMt87qYaq a6X3tzD3A5bjdpVMZc53x8DglZrZhenGQnTgemcG45j0m86OAVpvYVxHD10OFAOukzzx 8aEHSuCGtEN+4jdRLBndr3B/ZewJb8UJTnENGSztU50YpETXUqSaVW7oWnV6NzPnWn+a Wuv7j2vjvH82CJzA6V4Ah2gyPUtvWnvCf+uDM3vQf2utQDMl7DQe1jN6yMphRscbRLev u0aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si13348993plh.385.2018.12.11.09.21.18; Tue, 11 Dec 2018 09:21:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbeLKRMH (ORCPT + 99 others); Tue, 11 Dec 2018 12:12:07 -0500 Received: from foss.arm.com ([217.140.101.70]:53536 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726170AbeLKRMG (ORCPT ); Tue, 11 Dec 2018 12:12:06 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1C65D1596; Tue, 11 Dec 2018 09:12:06 -0800 (PST) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4E9E23F6A8; Tue, 11 Dec 2018 09:12:04 -0800 (PST) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: suzuki.poulose@arm.com, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, marc.zyngier@arm.com, christoffer.dall@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, anshuman.khandual@arm.com Subject: [PATCH v10 0/8] kvm: arm64: Support PUD hugepage at stage 2 Date: Tue, 11 Dec 2018 17:10:33 +0000 Message-Id: <1544548241-6417-1-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series is an update to the PUD hugepage support previously posted at [0]. This patchset adds support for PUD hugepages at stage 2 a feature that is useful on cores that have support for large sized TLB mappings (e.g., 1GB for 4K granule). The patches are based on v4.20-rc4 The patches have been tested on AMD Seattle system with the following hugepage sizes - 2M and 1G. Right now the PUD hugepage for stage2 is only supported if the stage2 has 4 levels. i.e, with an IPA size of minimum 44bits with 4K pages. This could be relaxed to stage2 with 3 levels, with the stage1 PUD huge page mapped in the entry level of the stage2 (i.e, pgd). I have not added the change here to keep this version stable w.r.t the previous version. I could post a patch later after further discussions in the list. [0] https://patchwork.kernel.org/cover/10622379/ v9 -> v10 * Address comments on v9. Mainly converting BUG() => WARN_ON(1) in arm32 for PUD helpers. * Dropped Suzuki's "Review" tags from the patches which were modified. v8 -> v9 * Dropped bugfix patch 1 which has been merged v7 -> v8 * Add kvm_stage2_has_pud() helper on arm32 * Rebased to v6 of 52bit dynamic IPA support v6 -> v7 * Restrict thp check to exclude hugetlbfs pages - Patch 1 * Don't update PUD entry if there's no change - Patch 9 * Add check for PUD level in stage 2 - Patch 9 v5 -> v6 * Split Patch 1 to move out the refactoring of exec permissions on page table entries. * Patch 4 - Initialise p*dpp pointers in stage2_get_leaf_entry() * Patch 5 - Trigger a BUG() in kvm_pud_pfn() on arm v4 -> v5: * Patch 1 - Drop helper stage2_should_exec() and refactor the condition to decide if a page table entry should be marked executable * Patch 4-6 - Introduce stage2_get_leaf_entry() and use it in this and latter patches * Patch 7 - Use stage 2 accessors instead of using the page table helpers directly * Patch 7 - Add a note to update the PUD hugepage support when number of levels of stage 2 tables differs from stage 1 v3 -> v4: * Patch 1 and 7 - Don't put down hugepages pte if logging is enabled * Patch 4-5 - Add PUD hugepage support for exec and access faults * Patch 6 - PUD hugepage support for aging page table entries v2 -> v3: * Update vma_pagesize directly if THP [1/4]. Previsouly this was done indirectly via hugetlb * Added review tag [4/4] v1 -> v2: * Create helper to check if the page should have exec permission [1/4] * Fix broken condition to detect THP hugepage [1/4] * Fix in-correct hunk resulting from a rebase [4/4] Punit Agrawal (8): KVM: arm/arm64: Share common code in user_mem_abort() KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault KVM: arm/arm64: Introduce helpers to manipulate page table entries KVM: arm64: Support dirty page tracking for PUD hugepages KVM: arm64: Support PUD hugepage in stage2_is_exec() KVM: arm64: Support handling access faults for PUD hugepages KVM: arm64: Update age handlers to support PUD hugepages KVM: arm64: Add support for creating PUD hugepages at stage 2 arch/arm/include/asm/kvm_mmu.h | 61 +++++++ arch/arm/include/asm/stage2_pgtable.h | 5 + arch/arm64/include/asm/kvm_mmu.h | 48 +++++ arch/arm64/include/asm/pgtable-hwdef.h | 4 + arch/arm64/include/asm/pgtable.h | 9 + virt/kvm/arm/mmu.c | 312 ++++++++++++++++++++++++--------- 6 files changed, 360 insertions(+), 79 deletions(-) -- 2.7.4