Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp680773imm; Thu, 5 Jul 2018 07:11:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJ5BuDNsVtu2twRApSEAaUqdAfGJh+HlqyWKDY8D/13XEsTfbbK1zzRnXG+eXLY2qZBRUk X-Received: by 2002:a17:902:b608:: with SMTP id b8-v6mr6418104pls.312.1530799910687; Thu, 05 Jul 2018 07:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530799910; cv=none; d=google.com; s=arc-20160816; b=GOSYM86TkhU7XxhBci0Viq41TCKsELxnQDYShwnEgbpym7V9i1k+6+UAuj1qSbHFmZ Cy1NPPIJbiF9rh5VoIQ+FEqFnb5NKC6HaDawJYu5bSBYk+Jck7XiHNBg/8d+kgjVD9oN 8xagmAZPEil3qjgkHRtJZpVy5CaB4nt80Q9CVSqzlXgY9kDniQdx58HOV2uv9OALN54Y Sp3GM+UJTYnL7gc/1oa7JjSIyuUTzUrEv1D1TJcEKU0GaMUE9UT4uq9jcIlEZbAqw0kw nNkI5pktdquF6+2V86FPldUiFibdWWgKSuvD3ndMXgQtgwyTjEU+y4ZHg5S84DtpUZQ8 yWrA== 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 :arc-authentication-results; bh=+vLB4l4HakokhJulGj3RC8HlI23XU47eyPBRAJVot7E=; b=ous6QoRbwkxuurFqAihl/DEHYvwBbsjVENhQNAU2ZO+OdtHc7wWxEyF865XS9Jvzz4 xwVFi/hVz3V7vIE0xz0oyiFvjTTVfJMxQTXjSPPUeUhIkTtPhRSsaBFz9nh9cnUVV0IN kuCC8mSzHsU3LefWdLGC1vhmkFtEpZ9NXEPZysjej4eQwecwvRTbjTa2PWiQBLEiatn1 jM7y5QOmSNGj0ejvZBib+NkTnW2p9ggI7BLi1yaQD1cNy+V9x68JZ07M4cVEG/wyp8IM y2D9X+XdaJApfGx17JUkZ8e6bKOsNEKVi/GaC3DxsIyd9fd9WE1QqfdL7GDmUs/b7oze y1+w== 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 c12-v6si5721169pga.608.2018.07.05.07.11.35; Thu, 05 Jul 2018 07:11:50 -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 S1753787AbeGEOJN (ORCPT + 99 others); Thu, 5 Jul 2018 10:09:13 -0400 Received: from foss.arm.com ([217.140.101.70]:50230 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753738AbeGEOJK (ORCPT ); Thu, 5 Jul 2018 10:09:10 -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 5D15818A; Thu, 5 Jul 2018 07:09:10 -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 D21A93F5BA; Thu, 5 Jul 2018 07:09:09 -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 Subject: [PATCH v4 0/7] KVM: Support PUD hugepages at stage 2 Date: Thu, 5 Jul 2018 15:08:43 +0100 Message-Id: <20180705140850.5801-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.17.1 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][1][2][3]. 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). There are a three new patches to support PUD hugepages for execute permission faults, access faults and handling aging of PUD page table entries (patches 4-6). This addresses Suzuki's feedback on the previous version. Also, live migration didn't work with earlier versions. This has now been addressed by updating patch 1 & 7 to ensure that hugepages are dissolved correctly when dirty logging is enabled. 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-rc3. The are a few conflicts with the support for 52 bit IPA[4] due to change in number of parameters for stage2_pmd_offset(). Thanks, Punit 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://lkml.org/lkml/2018/5/14/907 [1] https://www.spinics.net/lists/arm-kernel/msg628053.html [2] https://lkml.org/lkml/2018/4/20/566 [3] https://lkml.org/lkml/2018/5/1/133 [4] 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 | 214 ++++++++++++++++++++----- 5 files changed, 291 insertions(+), 43 deletions(-) -- 2.17.1