Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6456880imd; Wed, 31 Oct 2018 12:01:18 -0700 (PDT) X-Google-Smtp-Source: AJdET5d36r/O6MhLldpI/vUT9Z6GjTfxomXF+EzZaxqM2LnsXlmRvWVYHkZIrxdm44w7B6qcIZQS X-Received: by 2002:a63:1f60:: with SMTP id q32-v6mr4141844pgm.88.1541012478710; Wed, 31 Oct 2018 12:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541012478; cv=none; d=google.com; s=arc-20160816; b=MSGkbSucpfflxdwp6exFaULwAxqMW2AsYbgXm6Kf8bWah3qHRt1MpEagIY3zWl1VcW 41XgMkQjDM4lRDWMXjYtoKNW5SdfdV3ojINJbcH01s2TgoecqfEO7BRzdGjZ9y41s2Yb F1wLFQovzKuTH/Fcd5Pr9OyII5K8ZolS1guJ34phNKZQKokOAsKn3guC7qQzoZ4y2wwk mnVJKlIZbLGjbiBujMphT+rFrL6I/ZUQ2T2GjA4iYpD1qE7CmomqGb+SIu88mQYYcMJi mOCCXIElQLGPpsaVAuUf9PZLIfDLpddUCD6+KxLq7pqnCxIsSPpF8CxZxHM8/lIGTQRr 8zFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vH55khTDRrMOkAoZ9iRtvZCecttXTiC4YL2JCESehJI=; b=VMwO/IiLR2aEanz0VUFQKwtyByeaOtLIGWy58cZoIepnsAQWA5B9dxHpEIEM5e5pk5 YR3RNpXm5o1TobAPYB/Sddih+0WEZWvMPjT1j/F+bsYdAzBITCvZClPXgh+TBtzWiatC fQ7XNtWE+b6bMO4u9H2ohDp5U6PQeF69AkHmUwbVOjXbwY12KBYCCodPaRttFi3Lw0ti OzeqLq4R2OCCe+UgaTgCKqjzs/Tjwqz8h0SNyYMzlFGwyNUm/nFE/cRugHsIiCwz9K1B TVa1gWEFmcmo3zr1t/DQylN1+DXbWn7N1Q+DDkkRgxKWyhQFgbLG/wTUQflAGhjIY2ff +IIA== 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 f31-v6si21920888plb.303.2018.10.31.12.01.02; Wed, 31 Oct 2018 12:01:18 -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 S1729990AbeKAC5F (ORCPT + 99 others); Wed, 31 Oct 2018 22:57:05 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44740 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729737AbeKAC5E (ORCPT ); Wed, 31 Oct 2018 22:57:04 -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 22E3280D; Wed, 31 Oct 2018 10:58:01 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.197.25]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93ABB3F6A8; Wed, 31 Oct 2018 10:58:00 -0700 (PDT) From: Punit Agrawal To: kvmarm@lists.cs.columbia.edu Cc: Punit Agrawal , marc.zyngier@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, punitagrawal@gmail.com Subject: [PATCH v9 0/8] KVM: Support PUD hugepage at stage 2 Date: Wed, 31 Oct 2018 17:57:37 +0000 Message-Id: <20181031175745.18650-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-ARM-No-Footer: FoSSMail Content-Transfer-Encoding: 8bit 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 the latest upstream kernel. The patches have been tested on AMD Seattle system with the following hugepage sizes - 2M and 1G. Thanks, Punit [0] https://patchwork.kernel.org/cover/10622379/ 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.19.1