Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp613812imm; Mon, 9 Jul 2018 07:39:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdoFp9fBJiAnDeqELHSHwP2m5ZVduUr4brOxwExA1yXPLoTh4lUBOc7gFwJaG1mxWeiRNK0 X-Received: by 2002:a17:902:784d:: with SMTP id e13-v6mr20500672pln.197.1531147193949; Mon, 09 Jul 2018 07:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531147193; cv=none; d=google.com; s=arc-20160816; b=H4qTnOXcERnrFDNZbV/qP3a8wIaDq3hws08ejaF/VBe2Xg2pycXRU8rM9LLuay+gtv BoYLnh++PWahcLblR0Ot6nNraPENvDqU4ZnxDcpkNYGZhxEUYeHs74RSM1JTPkubRzfu FM5Iw7vUMSqPxfyTNDuOuDnYT+p70EwsXbkTZsisukPwzibHWW0zyuChOheYRWzPps0X YbOL66gXgf6d7TjbucdVQ21a/CmMpC5WTdPxEo58QFeC4pt7WA+Li60TD2EXAopBBEfE tXd6z2KziyQlzpSIWPO+0k/NQe9Je6QlUg05Qu25vQmH7I/+ur8IIGxivAD8o4IE56tA v9dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=KJdOkEoEuvFGSYqtSTjuc6ft/HYiEb6Eo7eEu/ntrXA=; b=labkENRml8knSYX0JfoOurm/nAKEyAOKgVVauF2lTaJC8t0Dib7TbkJBdJTbbbNkBx B1egfoa7ZrpW+CXdc/xffseV4ZU4Fv20j07HzszYNI+EnakYOnhY9kIkS2sQDGmsS27U icjQWn7I2zTovdiPetXc5gXiCXrazi1ptYnAKryL3ZNxfaBCG9vs3yYn+uz4WoRlVizo 5WxDhqzJfltqFbeUwMaCAnJrfPe4pyDgYwH5F4QAyR+coZHHp9aWoB7NH51efPUa2XCi ub08MN3xU1+FljEgB607AKIXUT/BzVgoGGwnznyDYHV8W3IHYjG7DBems5u9cZtR9Tw0 ULtQ== 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 w5-v6si14080272plz.438.2018.07.09.07.39.39; Mon, 09 Jul 2018 07:39:53 -0700 (PDT) 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 S1754589AbeGIOiu (ORCPT + 99 others); Mon, 9 Jul 2018 10:38:50 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60258 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754517AbeGIOit (ORCPT ); Mon, 9 Jul 2018 10:38:49 -0400 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 B9B7F1682; Mon, 9 Jul 2018 07:38:49 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.206.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3A6F13F589; Mon, 9 Jul 2018 07:38:49 -0700 (PDT) From: Punit Agrawal To: kvmarm@lists.cs.columbia.edu Cc: Punit Agrawal , linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, christoffer.dall@arm.com, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, will.deacon@arm.com Subject: [PATCH v5 0/7] KVM: Support PUD hugepages at stage 2 Date: Mon, 9 Jul 2018 15:38:28 +0100 Message-Id: <20180709143835.28971-2-punit.agrawal@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709143835.28971-1-punit.agrawal@arm.com> References: <20180709143835.28971-1-punit.agrawal@arm.com> X-ARM-No-Footer: FoSSMail 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. This feature is useful on cores that have support for large sized TLB mappings (e.g., 1GB for 4K granule). The biggest change in this version is to replace repeated instances of walking the page tables to get to a leaf-entry with a function to return the appropriate entry. This was suggested by Suzuki and should help reduce the amount of churn resulting from future changes. It also address other feedback on the previous version. Support is added to code that is shared between arm and arm64. Dummy helpers for arm are provided as the port does not support PUD hugepage sizes. The patches have been tested on an A57 based system. The patchset is based on v4.18-rc4. The are a few conflicts with the support for 52 bit IPA[1] due to change in number of parameters for stage2_pmd_offset(). Thanks, Punit 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] [0] https://www.spinics.net/lists/arm-kernel/msg663562.html [1] https://www.spinics.net/lists/kvm/msg171065.html Punit Agrawal (7): KVM: arm/arm64: Share common code in user_mem_abort() KVM: arm/arm64: Introduce helpers to manupulate 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 | 60 +++++ arch/arm64/include/asm/kvm_mmu.h | 47 ++++ arch/arm64/include/asm/pgtable-hwdef.h | 4 + arch/arm64/include/asm/pgtable.h | 9 + virt/kvm/arm/mmu.c | 289 ++++++++++++++++++------- 5 files changed, 330 insertions(+), 79 deletions(-) -- 2.17.1