From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD7BAC2BB84 for ; Mon, 7 Sep 2020 15:25:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6825B21741 for ; Mon, 7 Sep 2020 15:25:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iKAPjsLQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="C5iAuxZR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6825B21741 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=i6A+OQq9yQtqRHmPCOSdPvXdmdWLHM6jrAME3/+ioek=; b=iKAPjsLQDmfbHCYSSYIFcl39g0 BcfA0usAk6N3daghXcZqRCS5TgN4lAF5KfmkLiHLvWGOzfv9bFiZNGUCeqltvcmCe+xv5GW1fuk0n MrBsk5eITCtV4HUDf9QPC4jTutUCXqiWbAHpmlOg32TzmnQWAeLvcsmnDaXxgtv6aK3N9UOVTIddZ 3RZzuWWULGhNK/H1bcGebBqyeU3teswSb6pNjuDZoox37Nkl7va+yXHBuXiLv49eA81QORgpKtTjf yipEfBSJ1zrAikCK5/jsVknpIkm6uV8C62sHHEzCPASzJOR1hhUzX7d8ItOCuEh+SAtea+4hdmpNg MnFRcN0A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFIzt-0005mJ-Pr; Mon, 07 Sep 2020 15:23:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFIzq-0005lh-RX for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 15:23:55 +0000 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D87142078E; Mon, 7 Sep 2020 15:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599492233; bh=p5Snu50moHEQm/YntO7vEHnqsKbUapVwzJQltXVKO4Q=; h=From:To:Cc:Subject:Date:From; b=C5iAuxZRQsuAkd/LZYE9KZb1swcHItJwKtEBdzgWQQGGwu5f3hWVK9S3SOi97pCyw sMZ9W3wTXc5oISK5xI6pw+MDixQPkGnikfUECLqrZA0VJB7n/WEBsjuyAQxN4L22wL eOq1GmjjSwKMM3FP8y3idrSv2zUWo5DQHgmM/Twg= From: Will Deacon To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v4 00/21] KVM: arm64: Rewrite page-table code and fault handling Date: Mon, 7 Sep 2020 16:23:23 +0100 Message-Id: <20200907152344.12978-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_112354_999807_185DA000 X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, Gavin Shan , Suzuki Poulose , Marc Zyngier , Quentin Perret , Alexandru Elisei , James Morse , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, Here's version four of the KVM page-table rework I previously posted here: v1: https://lore.kernel.org/r/20200730153406.25136-1-will@kernel.org v2: https://lore.kernel.org/r/20200818132818.16065-1-will@kernel.org v3: https://lore.kernel.org/r/20200825093953.26493-1-will@kernel.org Changes since v3 include: * Removed some more unused code from the old implementation * Renumbered KVM_PGTABLE_PROT_* to match file permissions in hex dumps * Simplified kvm_granule_shift() and removed kvm_start_level() * Only clear valid bit when invalidating a PTE, leaving phys addr intact * Fail gracefully when attempting to allocate without a memory cache * Rewrote stage2_apply_range() as a function instead of a macro * Fixed fault address rounding with hugetlbfs * Fixed permission fault handling when dirty logging is enabled * Added comments * Added reviewer tags Many thanks to Alex and Gavin for their comments. Will Cc: Marc Zyngier Cc: Quentin Perret Cc: James Morse Cc: Suzuki Poulose Cc: Catalin Marinas Cc: Gavin Shan Cc: Alexandru Elisei Cc: kernel-team@android.com Cc: linux-arm-kernel@lists.infradead.org --->8 Quentin Perret (4): KVM: arm64: Add support for stage-2 write-protect in generic page-table KVM: arm64: Convert write-protect operation to generic page-table API KVM: arm64: Add support for stage-2 cache flushing in generic page-table KVM: arm64: Convert memslot cache-flushing code to generic page-table API Will Deacon (17): KVM: arm64: Remove kvm_mmu_free_memory_caches() KVM: arm64: Add stand-alone page-table walker infrastructure KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables KVM: arm64: Use generic allocator for hyp stage-1 page-tables KVM: arm64: Add support for creating kernel-agnostic stage-2 page tables KVM: arm64: Add support for stage-2 map()/unmap() in generic page-table KVM: arm64: Convert kvm_phys_addr_ioremap() to generic page-table API KVM: arm64: Convert kvm_set_spte_hva() to generic page-table API KVM: arm64: Convert unmap_stage2_range() to generic page-table API KVM: arm64: Add support for stage-2 page-aging in generic page-table KVM: arm64: Convert page-aging and access faults to generic page-table API KVM: arm64: Add support for relaxing stage-2 perms in generic page-table code KVM: arm64: Convert user_mem_abort() to generic page-table API KVM: arm64: Check the pgt instead of the pgd when modifying page-table KVM: arm64: Remove unused page-table code KVM: arm64: Remove unused 'pgd' field from 'struct kvm_s2_mmu' KVM: arm64: Don't constrain maximum IPA size based on host configuration arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/include/asm/kvm_mmu.h | 251 +--- arch/arm64/include/asm/kvm_pgtable.h | 281 ++++ arch/arm64/include/asm/pgtable-hwdef.h | 23 - arch/arm64/include/asm/pgtable-prot.h | 19 - arch/arm64/include/asm/stage2_pgtable.h | 215 --- arch/arm64/kvm/arm.c | 2 +- arch/arm64/kvm/hyp/Makefile | 2 +- arch/arm64/kvm/hyp/pgtable.c | 880 ++++++++++++ arch/arm64/kvm/mmu.c | 1745 ++++------------------- arch/arm64/kvm/reset.c | 38 +- 11 files changed, 1444 insertions(+), 2014 deletions(-) create mode 100644 arch/arm64/include/asm/kvm_pgtable.h create mode 100644 arch/arm64/kvm/hyp/pgtable.c -- 2.28.0.526.ge36021eeef-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel