From patchwork Thu Dec 2 17:10:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12694538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25D36C433FE for ; Thu, 2 Dec 2021 17:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=0vcUXQYzVfbuGiOi6q4NCZvHjVTF6RIVYhuEc1jwQi8=; b=H6W05wEAUTxbWo LzPKsnpHAP7tkAWEivqlbhIFBCNICTe2HYDMi8ig6iOq00XXWVtDP5JptWScqnu+7jL/nc/MkbrjZ WF8jAl82Ie/n5BsqRTD5BDr+c5bOZr38VES84F7S1bxvWmi1pU4ZYzIuQJSGE44kokr8NieodY/Jv MM4zMEt/bgjDnaVcixveMGoheC5zd7np8Q1JuKHoNom140wiJO9UVPsd2xJ5fAEYvPulY85kTe7zS 51/k80pp0jlFm/U7BivutSW/htK+7eCD6NtFA53GOgtoT0JDTX/8xTGFhTtyk4ByZD3bBb9i/01zR dUFotrYe1p9sGO6mFvgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mspbo-00D76Q-3V; Thu, 02 Dec 2021 17:11:00 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mspbk-00D75N-Dy for linux-arm-kernel@lists.infradead.org; Thu, 02 Dec 2021 17:10:57 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 20370B823FB; Thu, 2 Dec 2021 17:10:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 238D7C00446; Thu, 2 Dec 2021 17:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638465053; bh=FRmookF9nYEAwWkZ31szXn8ae4AuML7H2xC+7J+E65s=; h=From:To:Cc:Subject:Date:From; b=iv7pD2zcsYSSp9LZtchap81xKi6GfQQM9YZNXP9EyULBnRsMPXrjDhVODSo83Wsbu twYAgkvKVxznULux2k5a1f7M0zxzMFWN1f9wq1SXriwhUCbBxLjn2X+ScJUbkLRkkQ WrRn3IG2YhZOyFb3WW1WNgH7BZozvDSQh/C0TfISIEFAZIDFp7PJA3TJoM7RGObEol qkIHyPzOMypM0wnUl/FMnJTF++zo6f9zDbrYPL3UvGh1tQ8JZ1uUh1AkegIbr54QqJ iTWFTgVS8mt3637jYSh1epQ0y6lgQXjEK+yThCKliIfceoAOg5uJKFvP35q8VX1T6P +70NtTcYTEyQQ== From: Will Deacon To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , Alexandru Elisei , James Morse , Quentin Perret , Suzuki K Poulose , Fuad Tabba , Marc Zyngier Subject: [PATCH 0/3] KVM: arm64: Keep hyp and host headers separate where possible Date: Thu, 2 Dec 2021 17:10:45 +0000 Message-Id: <20211202171048.26924-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-20211202_091056_631261_CF76E71B X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi folks, This series tidies up the header file usage for the nvhe hyp object so that header files under arch/arm64/kvm/hyp/include are not included by host code running at EL1. For definitions that are shared between the host and hypervisor, these are either moved to headers under arch/arm64/include/asm/ or are generated by kbuild along similar lines to asm-offsets.h. For now, this allows us to tidy up some of the pKVM reserved memory handling, but in future this will also allow the pKVM EL2 data structures to avoid polluting the host namespace. Cheers, Will Cc: Alexandru Elisei Cc: James Morse Cc: Quentin Perret Cc: Suzuki K Poulose Cc: Fuad Tabba Cc: Marc Zyngier --->8 Will Deacon (3): arm64: Add missing include of asm/cpufeature.h to asm/mmu.h KVM: arm64: Generate hyp_constants.h for the host KVM: arm64: Move host EL1 code out of hyp/ directory arch/arm64/include/asm/kvm_pkvm.h | 71 +++++++++++++++++++ arch/arm64/include/asm/mmu.h | 1 + arch/arm64/kvm/.gitignore | 2 + arch/arm64/kvm/Makefile | 18 ++++- arch/arm64/kvm/hyp/Makefile | 2 +- arch/arm64/kvm/hyp/hyp-constants.c | 10 +++ arch/arm64/kvm/hyp/include/nvhe/mm.h | 57 --------------- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 1 + arch/arm64/kvm/hyp/nvhe/mm.c | 1 + arch/arm64/kvm/hyp/nvhe/setup.c | 1 + arch/arm64/kvm/{hyp/reserved_mem.c => pkvm.c} | 8 +-- 11 files changed, 109 insertions(+), 63 deletions(-) create mode 100644 arch/arm64/include/asm/kvm_pkvm.h create mode 100644 arch/arm64/kvm/.gitignore create mode 100644 arch/arm64/kvm/hyp/hyp-constants.c rename arch/arm64/kvm/{hyp/reserved_mem.c => pkvm.c} (94%)