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 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 CB013CCA47F for ; Tue, 19 Jul 2022 14:51:35 +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:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z6DH/Gmy0kz44MAneHS/fUoKuapt0XDC7eJXwAibObs=; b=XPgRrNZYUx9vBX ZLUK5KpYAo+Do5zXgWgzgIIsVq1oDFvNLwbAwYhpXSYFYViaRYRE0aQNDc3v7inyZAsHcTT4AH+NT p2stoyDvLz1v5iCsE+eNW5Sq0J4QL+z4O1k9OBihhCWYVCKQTpQqRaSk3ivo0WlN3s1CNmPn0ut2R 1IwZ8RhR90y+N+Hfd+/YlRUe/HAeF4IoKw/3wb52TRg27Qn0fvznNNdbxjmsJh0ggC2jgSs0yNXH4 mUOkdcrGTuv1nHyivQvMFa8dEOyeGswO3JwI1xqJJQAG7Kla1XUIFYJZAIZw0anpXBkZxdk0of6Z0 gjZHzzt34kYNY2fpgdvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDoYM-009ndf-Uv; Tue, 19 Jul 2022 14:50:27 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDoYJ-009naL-BZ for linux-arm-kernel@lists.infradead.org; Tue, 19 Jul 2022 14:50:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658242219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jctjcs10cXLC6Fgs+ejM2KhG7RRpw0OENqiwSYLGZwM=; b=igz/bprdn0EGgw4vEzeXhl++PB2FmMwsYyqRSGFmlIKn/JmLNJ9qXP/VR7YYXrHw1CN6vf CKJ6eaCU2jt2EqcY8t0IeeQIR4ND/pAVHaRs/WbFVX+e4poPC+8/k+JflJuCl98mCDC6mA d2BW/Up+/tmF9bIhHJcC8q6LUMp20po= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-kkwaFwbkMtGGia0WGtTbbg-1; Tue, 19 Jul 2022 10:50:10 -0400 X-MC-Unique: kkwaFwbkMtGGia0WGtTbbg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5D11811E76; Tue, 19 Jul 2022 14:50:09 +0000 (UTC) Received: from localhost (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63DF040CFD0A; Tue, 19 Jul 2022 14:50:09 +0000 (UTC) From: Cornelia Huck To: Peter Collingbourne , kvmarm@lists.cs.columbia.edu Cc: Peter Collingbourne , Marc Zyngier , kvm@vger.kernel.org, Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Michael Roth , Catalin Marinas , Chao Peng , Will Deacon , Evgenii Stepanov Subject: Re: [PATCH v2 0/3] KVM: arm64: support MTE in protected VMs In-Reply-To: <20220708212106.325260-1-pcc@google.com> Organization: Red Hat GmbH References: <20220708212106.325260-1-pcc@google.com> User-Agent: Notmuch/0.36 (https://notmuchmail.org) Date: Tue, 19 Jul 2022 16:50:08 +0200 Message-ID: <877d49p36n.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220719_075023_508223_BC34F479 X-CRM114-Status: GOOD ( 22.57 ) 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: , 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 On Fri, Jul 08 2022, Peter Collingbourne wrote: > Hi, > > This patch series contains a proposed extension to pKVM that allows MTE > to be exposed to the protected guests. It is based on the base pKVM > series previously sent to the list [1] and later rebased to 5.19-rc3 > and uploaded to [2]. > > This series takes precautions against host compromise of the guests > via direct access to their tag storage, by preventing the host from > accessing the tag storage via stage 2 page tables. The device tree > must describe the physical memory address of the tag storage, if any, > and the memory nodes must declare that the tag storage location is > described. Otherwise, the MTE feature is disabled in protected guests. > > Now that we can easily do so, we also prevent the host from accessing > any unmapped reserved-memory regions without a driver, as the host > has no business accessing that memory. > > A proposed extension to the devicetree specification is available at > [3], a patched version of QEMU that produces the required device tree > nodes is available at [4] and a patched version of the crosvm hypervisor > that enables MTE is available at [5]. I'm unsure how this is supposed to work with QEMU + KVM, as your QEMU patch adds mte-alloc properties to regions that are exposed as a separate address space (which will not work with KVM). Is the magic in that new shared section? > > v2: > - refcount the PTEs owned by NOBODY > > [1] https://lore.kernel.org/all/20220519134204.5379-1-will@kernel.org/ > [2] https://android-kvm.googlesource.com/linux/ for-upstream/pkvm-base-v2 > [3] https://github.com/pcc/devicetree-specification mte-alloc > [4] https://github.com/pcc/qemu mte-shared-alloc > [5] https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3719324 > > Peter Collingbourne (3): > KVM: arm64: add a hypercall for disowning pages > KVM: arm64: disown unused reserved-memory regions > KVM: arm64: allow MTE in protected VMs if the tag storage is known > > arch/arm64/include/asm/kvm_asm.h | 1 + > arch/arm64/include/asm/kvm_host.h | 6 ++ > arch/arm64/include/asm/kvm_pkvm.h | 4 +- > arch/arm64/kernel/image-vars.h | 3 + > arch/arm64/kvm/arm.c | 83 ++++++++++++++++++- > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 1 + > arch/arm64/kvm/hyp/include/nvhe/pkvm.h | 1 + > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 9 ++ > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 11 +++ > arch/arm64/kvm/hyp/nvhe/pkvm.c | 8 +- > arch/arm64/kvm/mmu.c | 4 +- > 11 files changed, 123 insertions(+), 8 deletions(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel