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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70BA7C43334 for ; Wed, 8 Jun 2022 18:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbiFHSls (ORCPT ); Wed, 8 Jun 2022 14:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbiFHSlq (ORCPT ); Wed, 8 Jun 2022 14:41:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE45D15735 for ; Wed, 8 Jun 2022 11:41:45 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 60D5361C1A for ; Wed, 8 Jun 2022 18:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C728C34116; Wed, 8 Jun 2022 18:41:41 +0000 (UTC) Date: Wed, 8 Jun 2022 19:41:37 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: Marc Zyngier , Fuad Tabba , Will Deacon , kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Oliver Upton , kernel-team@android.com, kvm@vger.kernel.org, Linux ARM Subject: Re: [PATCH 59/89] KVM: arm64: Do not support MTE for protected VMs Message-ID: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-60-will@kernel.org> <87v8tgltqy.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jun 06, 2022 at 05:20:39PM -0700, Peter Collingbourne wrote: > On Sat, Jun 4, 2022 at 1:26 AM Marc Zyngier wrote: > > But the bigger picture here is what ensures that the host cannot mess > > with the guest tags? I don't think we have a any mechanism to > > guarantee that, specially on systems where the tags are only a memory > > carve-out, which the host could map and change at will. > > Right, I forgot about that. We probably only want to expose MTE to > guests if we have some indication (through the device tree or ACPI) of > how to protect the guest tag storage. I think this would be useful irrespective of MTE. Some SoCs (though I hope very rare these days) may allow for physical aliasing of RAM but if the host stage 2 only protects one of the aliases, it's not of much use. I am yet to fully understand how pKVM works but with the separation of the hyp from the host kernel, it may have to actually parse the DT/ACPI/EFI tables itself if it cannot rely on what the host kernel told it. IIUC currently it creates an idmap at stage 2 for the host kernel, only unmapped if the memory was assigned to a guest. But not sure what happens with the rest of the host physical address space (devices etc.), I presume they are fully accessible by the host kernel in stage 2. -- Catalin 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51EC4C433EF for ; Wed, 8 Jun 2022 18:41:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C6AC14B20A; Wed, 8 Jun 2022 14:41:49 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W2dllxUxl1Jq; Wed, 8 Jun 2022 14:41:48 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 66CC74B271; Wed, 8 Jun 2022 14:41:48 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 44B6A4B20A for ; Wed, 8 Jun 2022 14:41:47 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OtL2TMb79Yn6 for ; Wed, 8 Jun 2022 14:41:46 -0400 (EDT) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 130194A3A5 for ; Wed, 8 Jun 2022 14:41:45 -0400 (EDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 60D6261C1D; Wed, 8 Jun 2022 18:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C728C34116; Wed, 8 Jun 2022 18:41:41 +0000 (UTC) Date: Wed, 8 Jun 2022 19:41:37 +0100 From: Catalin Marinas To: Peter Collingbourne Subject: Re: [PATCH 59/89] KVM: arm64: Do not support MTE for protected VMs Message-ID: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-60-will@kernel.org> <87v8tgltqy.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernel-team@android.com, kvm@vger.kernel.org, Marc Zyngier , Linux ARM , Michael Roth , Chao Peng , Andy Lutomirski , Will Deacon , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, Jun 06, 2022 at 05:20:39PM -0700, Peter Collingbourne wrote: > On Sat, Jun 4, 2022 at 1:26 AM Marc Zyngier wrote: > > But the bigger picture here is what ensures that the host cannot mess > > with the guest tags? I don't think we have a any mechanism to > > guarantee that, specially on systems where the tags are only a memory > > carve-out, which the host could map and change at will. > > Right, I forgot about that. We probably only want to expose MTE to > guests if we have some indication (through the device tree or ACPI) of > how to protect the guest tag storage. I think this would be useful irrespective of MTE. Some SoCs (though I hope very rare these days) may allow for physical aliasing of RAM but if the host stage 2 only protects one of the aliases, it's not of much use. I am yet to fully understand how pKVM works but with the separation of the hyp from the host kernel, it may have to actually parse the DT/ACPI/EFI tables itself if it cannot rely on what the host kernel told it. IIUC currently it creates an idmap at stage 2 for the host kernel, only unmapped if the memory was assigned to a guest. But not sure what happens with the rest of the host physical address space (devices etc.), I presume they are fully accessible by the host kernel in stage 2. -- Catalin _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 C72A6C433EF for ; Wed, 8 Jun 2022 18:43:16 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ECU7FSZewoYhv8nXnw1g84VkPPQRv3JHhFtV9Zz6AOU=; b=uAcJaaylSRx1En jd0EWLHqBy2XGuJmBZ5o27tx6kj2z894zzyBLPX72spT0NOE9V6iR2ToO79l8Mbl7qYjVRaM9Y714 xMXZhX1MFmZ8vcmAsGDkNzTCzz8Pcf4nJEq8fjYKVTckY1eB0AktdbBRL7Tp3sIXgufzRY0cAU7YX GVyPnievGUtcoqQAnPmvsFPOw+YfN6QS7DAHKED1ePCXcDA/jfHhNIrQskfMX9+UYisfnJbhBoStV ZyfNhjHpaAqS3KatJR4O0K/eZS6YT1dQyTtCUVBwCpWeuIrb7IFtMIRxU5UrE1g4SEqkSvQs7yY3g hZgaZG23TiRTN56HtlCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz0cr-00Egqd-NR; Wed, 08 Jun 2022 18:41:53 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz0cm-00EgpY-FC for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 18:41:51 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 60D6261C1D; Wed, 8 Jun 2022 18:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C728C34116; Wed, 8 Jun 2022 18:41:41 +0000 (UTC) Date: Wed, 8 Jun 2022 19:41:37 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: Marc Zyngier , Fuad Tabba , Will Deacon , kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Oliver Upton , kernel-team@android.com, kvm@vger.kernel.org, Linux ARM Subject: Re: [PATCH 59/89] KVM: arm64: Do not support MTE for protected VMs Message-ID: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-60-will@kernel.org> <87v8tgltqy.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_114148_580987_A1D41AE9 X-CRM114-Status: GOOD ( 18.15 ) 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 Mon, Jun 06, 2022 at 05:20:39PM -0700, Peter Collingbourne wrote: > On Sat, Jun 4, 2022 at 1:26 AM Marc Zyngier wrote: > > But the bigger picture here is what ensures that the host cannot mess > > with the guest tags? I don't think we have a any mechanism to > > guarantee that, specially on systems where the tags are only a memory > > carve-out, which the host could map and change at will. > > Right, I forgot about that. We probably only want to expose MTE to > guests if we have some indication (through the device tree or ACPI) of > how to protect the guest tag storage. I think this would be useful irrespective of MTE. Some SoCs (though I hope very rare these days) may allow for physical aliasing of RAM but if the host stage 2 only protects one of the aliases, it's not of much use. I am yet to fully understand how pKVM works but with the separation of the hyp from the host kernel, it may have to actually parse the DT/ACPI/EFI tables itself if it cannot rely on what the host kernel told it. IIUC currently it creates an idmap at stage 2 for the host kernel, only unmapped if the memory was assigned to a guest. But not sure what happens with the rest of the host physical address space (devices etc.), I presume they are fully accessible by the host kernel in stage 2. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel