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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 BE80EC4361B for ; Tue, 8 Dec 2020 17:22:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B9CE23B09 for ; Tue, 8 Dec 2020 17:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730544AbgLHRW3 (ORCPT ); Tue, 8 Dec 2020 12:22:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:56858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbgLHRW3 (ORCPT ); Tue, 8 Dec 2020 12:22:29 -0500 Date: Tue, 8 Dec 2020 17:21:43 +0000 From: Catalin Marinas To: Marc Zyngier Cc: Steven Price , Peter Maydell , Haibo Xu , lkml - Kernel Mailing List , Juan Quintela , Richard Henderson , QEMU Developers , "Dr. David Alan Gilbert" , Thomas Gleixner , Will Deacon , kvmarm , arm-mail-list , Dave Martin Subject: Re: [PATCH v5 0/2] MTE support for KVM guest Message-ID: <20201208172143.GB13960@gaia> References: <20201119184248.4bycy6ouvaxqdiiy@kamzik.brq.redhat.com> <46fd98a2-ee39-0086-9159-b38c406935ab@arm.com> <0d0eb6da6a11f76d10e532c157181985@kernel.org> <20201207163405.GD1526@gaia> <874kkx5thq.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874kkx5thq.wl-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 07:03:13PM +0000, Marc Zyngier wrote: > On Mon, 07 Dec 2020 16:34:05 +0000, > Catalin Marinas wrote: > > On Mon, Dec 07, 2020 at 04:05:55PM +0000, Marc Zyngier wrote: > > > What I'd really like to see is a description of how shared memory > > > is, in general, supposed to work with MTE. My gut feeling is that > > > it doesn't, and that you need to turn MTE off when sharing memory > > > (either implicitly or explicitly). > > > > The allocation tag (in-memory tag) is a property assigned to a physical > > address range and it can be safely shared between different processes as > > long as they access it via pointers with the same allocation tag (bits > > 59:56). The kernel enables such tagged shared memory for user processes > > (anonymous, tmpfs, shmem). > > I think that's one case where the shared memory scheme breaks, as we > have two kernels in charge of their own tags, and they obviously can't > be synchronised Yes, if you can't trust the other entity to not change the tags, the only option is to do an untagged access. > > What we don't have in the architecture is a memory type which allows > > access to tags but no tag checking. To access the data when the tags > > aren't known, the tag checking would have to be disabled via either a > > prctl() or by setting the PSTATE.TCO bit. > > I guess that's point (3) in Steven's taxonomy. It still a bit ugly to > fit in an existing piece of userspace, specially if it wants to use > MTE for its own benefit. I agree it's ugly. For the device DMA emulation case, the only sane way is to mimic what a real device does - no tag checking. For a generic implementation, this means that such shared memory should not be mapped with PROT_MTE on the VMM side. I guess this leads to your point that sharing doesn't work for this scenario ;). > > The kernel accesses the user memory via the linear map using a match-all > > tag 0xf, so no TCO bit toggling. For user, however, we disabled such > > match-all tag and it cannot be enabled at run-time (at least not easily, > > it's cached in the TLB). However, we already have two modes to disable > > tag checking which Qemu could use when migrating data+tags. > > I wonder whether we will have to have something kernel side to > dump/reload tags in a way that matches the patterns used by live > migration. We have something related - ptrace dumps/resores the tags. Can the same concept be expanded to a KVM ioctl? -- 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 21020C4361B for ; Tue, 8 Dec 2020 17:29:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 A57B220866 for ; Tue, 8 Dec 2020 17:29:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A57B220866 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmgns-0000jX-Rz for qemu-devel@archiver.kernel.org; Tue, 08 Dec 2020 12:29:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmggT-0002Ke-QV for qemu-devel@nongnu.org; Tue, 08 Dec 2020 12:21:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:55900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmggR-0000GW-LD for qemu-devel@nongnu.org; Tue, 08 Dec 2020 12:21:53 -0500 Date: Tue, 8 Dec 2020 17:21:43 +0000 From: Catalin Marinas To: Marc Zyngier Subject: Re: [PATCH v5 0/2] MTE support for KVM guest Message-ID: <20201208172143.GB13960@gaia> References: <20201119184248.4bycy6ouvaxqdiiy@kamzik.brq.redhat.com> <46fd98a2-ee39-0086-9159-b38c406935ab@arm.com> <0d0eb6da6a11f76d10e532c157181985@kernel.org> <20201207163405.GD1526@gaia> <874kkx5thq.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874kkx5thq.wl-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: pass client-ip=198.145.29.99; envelope-from=cmarinas@kernel.org; helo=mail.kernel.org X-Spam_score_int: -66 X-Spam_score: -6.7 X-Spam_bar: ------ X-Spam_report: (-6.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Juan Quintela , QEMU Developers , Dave Martin , Richard Henderson , lkml - Kernel Mailing List , Steven Price , arm-mail-list , Haibo Xu , Thomas Gleixner , Will Deacon , kvmarm , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, Dec 07, 2020 at 07:03:13PM +0000, Marc Zyngier wrote: > On Mon, 07 Dec 2020 16:34:05 +0000, > Catalin Marinas wrote: > > On Mon, Dec 07, 2020 at 04:05:55PM +0000, Marc Zyngier wrote: > > > What I'd really like to see is a description of how shared memory > > > is, in general, supposed to work with MTE. My gut feeling is that > > > it doesn't, and that you need to turn MTE off when sharing memory > > > (either implicitly or explicitly). > > > > The allocation tag (in-memory tag) is a property assigned to a physical > > address range and it can be safely shared between different processes as > > long as they access it via pointers with the same allocation tag (bits > > 59:56). The kernel enables such tagged shared memory for user processes > > (anonymous, tmpfs, shmem). > > I think that's one case where the shared memory scheme breaks, as we > have two kernels in charge of their own tags, and they obviously can't > be synchronised Yes, if you can't trust the other entity to not change the tags, the only option is to do an untagged access. > > What we don't have in the architecture is a memory type which allows > > access to tags but no tag checking. To access the data when the tags > > aren't known, the tag checking would have to be disabled via either a > > prctl() or by setting the PSTATE.TCO bit. > > I guess that's point (3) in Steven's taxonomy. It still a bit ugly to > fit in an existing piece of userspace, specially if it wants to use > MTE for its own benefit. I agree it's ugly. For the device DMA emulation case, the only sane way is to mimic what a real device does - no tag checking. For a generic implementation, this means that such shared memory should not be mapped with PROT_MTE on the VMM side. I guess this leads to your point that sharing doesn't work for this scenario ;). > > The kernel accesses the user memory via the linear map using a match-all > > tag 0xf, so no TCO bit toggling. For user, however, we disabled such > > match-all tag and it cannot be enabled at run-time (at least not easily, > > it's cached in the TLB). However, we already have two modes to disable > > tag checking which Qemu could use when migrating data+tags. > > I wonder whether we will have to have something kernel side to > dump/reload tags in a way that matches the patterns used by live > migration. We have something related - ptrace dumps/resores the tags. Can the same concept be expanded to a KVM ioctl? -- 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 896C6C4361B for ; Tue, 8 Dec 2020 17:21:54 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id DAB5D23B08 for ; Tue, 8 Dec 2020 17:21:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAB5D23B08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4C4A04B272; Tue, 8 Dec 2020 12:21:53 -0500 (EST) 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 qTU11JVw6963; Tue, 8 Dec 2020 12:21:52 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 321024B195; Tue, 8 Dec 2020 12:21:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B97074B0F6 for ; Tue, 8 Dec 2020 12:21:50 -0500 (EST) 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 0OwSdq-Sm4Jy for ; Tue, 8 Dec 2020 12:21:49 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 66F3D4B0F3 for ; Tue, 8 Dec 2020 12:21:49 -0500 (EST) Date: Tue, 8 Dec 2020 17:21:43 +0000 From: Catalin Marinas To: Marc Zyngier Subject: Re: [PATCH v5 0/2] MTE support for KVM guest Message-ID: <20201208172143.GB13960@gaia> References: <20201119184248.4bycy6ouvaxqdiiy@kamzik.brq.redhat.com> <46fd98a2-ee39-0086-9159-b38c406935ab@arm.com> <0d0eb6da6a11f76d10e532c157181985@kernel.org> <20201207163405.GD1526@gaia> <874kkx5thq.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <874kkx5thq.wl-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Juan Quintela , QEMU Developers , Dave Martin , Richard Henderson , lkml - Kernel Mailing List , Steven Price , arm-mail-list , Thomas Gleixner , Will Deacon , kvmarm , "Dr. David Alan Gilbert" 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, Dec 07, 2020 at 07:03:13PM +0000, Marc Zyngier wrote: > On Mon, 07 Dec 2020 16:34:05 +0000, > Catalin Marinas wrote: > > On Mon, Dec 07, 2020 at 04:05:55PM +0000, Marc Zyngier wrote: > > > What I'd really like to see is a description of how shared memory > > > is, in general, supposed to work with MTE. My gut feeling is that > > > it doesn't, and that you need to turn MTE off when sharing memory > > > (either implicitly or explicitly). > > > > The allocation tag (in-memory tag) is a property assigned to a physical > > address range and it can be safely shared between different processes as > > long as they access it via pointers with the same allocation tag (bits > > 59:56). The kernel enables such tagged shared memory for user processes > > (anonymous, tmpfs, shmem). > > I think that's one case where the shared memory scheme breaks, as we > have two kernels in charge of their own tags, and they obviously can't > be synchronised Yes, if you can't trust the other entity to not change the tags, the only option is to do an untagged access. > > What we don't have in the architecture is a memory type which allows > > access to tags but no tag checking. To access the data when the tags > > aren't known, the tag checking would have to be disabled via either a > > prctl() or by setting the PSTATE.TCO bit. > > I guess that's point (3) in Steven's taxonomy. It still a bit ugly to > fit in an existing piece of userspace, specially if it wants to use > MTE for its own benefit. I agree it's ugly. For the device DMA emulation case, the only sane way is to mimic what a real device does - no tag checking. For a generic implementation, this means that such shared memory should not be mapped with PROT_MTE on the VMM side. I guess this leads to your point that sharing doesn't work for this scenario ;). > > The kernel accesses the user memory via the linear map using a match-all > > tag 0xf, so no TCO bit toggling. For user, however, we disabled such > > match-all tag and it cannot be enabled at run-time (at least not easily, > > it's cached in the TLB). However, we already have two modes to disable > > tag checking which Qemu could use when migrating data+tags. > > I wonder whether we will have to have something kernel side to > dump/reload tags in a way that matches the patterns used by live > migration. We have something related - ptrace dumps/resores the tags. Can the same concept be expanded to a KVM ioctl? -- 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B63ADC19437 for ; Tue, 8 Dec 2020 17:23:01 +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 616E023B08 for ; Tue, 8 Dec 2020 17:23:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 616E023B08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=MycCvPzEttwwozYvBsnw3Ge78llKnRHZf944KM8a7Is=; b=Rwa2DuHceeV8STQ9Iour1UVJ1 lKwQR3VwFY0b9xvWeqidvvfzL76idt0lAEgsG9R3DL5LVGOU8y1trSI9KJjMR9UBGeSFVbciVFUi0 +A1EDwg9whwFyJ8aAILFwiElkkNjN/D61JpbP+I90bAzg2wWnRLYhUOQZ27jcSMhbIArMIEaGG3I/ BGFUPgpunhB7GWDSA1Y9vPLtBc5NacdN6XBzfRqVpCvPn7/mdGgWzhTxvmo8uWf52DdtUC6A5wYuP 9t3MkYPZ0f0kJ2tvo7kbdOQFgjO1OtcaP7mSAGDzgZ8YQBeN1AhzfZJqzIxnSJ7ahtTZbXQTMjysD AVOE0mzqw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmggT-0003YV-91; Tue, 08 Dec 2020 17:21:53 +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 1kmggQ-0003Xz-Le for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 17:21:51 +0000 Date: Tue, 8 Dec 2020 17:21:43 +0000 From: Catalin Marinas To: Marc Zyngier Subject: Re: [PATCH v5 0/2] MTE support for KVM guest Message-ID: <20201208172143.GB13960@gaia> References: <20201119184248.4bycy6ouvaxqdiiy@kamzik.brq.redhat.com> <46fd98a2-ee39-0086-9159-b38c406935ab@arm.com> <0d0eb6da6a11f76d10e532c157181985@kernel.org> <20201207163405.GD1526@gaia> <874kkx5thq.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <874kkx5thq.wl-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_122150_804435_6E861D29 X-CRM114-Status: GOOD ( 23.89 ) 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: Peter Maydell , Juan Quintela , QEMU Developers , Dave Martin , Richard Henderson , lkml - Kernel Mailing List , Steven Price , arm-mail-list , Haibo Xu , Thomas Gleixner , Will Deacon , kvmarm , "Dr. David Alan Gilbert" 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, Dec 07, 2020 at 07:03:13PM +0000, Marc Zyngier wrote: > On Mon, 07 Dec 2020 16:34:05 +0000, > Catalin Marinas wrote: > > On Mon, Dec 07, 2020 at 04:05:55PM +0000, Marc Zyngier wrote: > > > What I'd really like to see is a description of how shared memory > > > is, in general, supposed to work with MTE. My gut feeling is that > > > it doesn't, and that you need to turn MTE off when sharing memory > > > (either implicitly or explicitly). > > > > The allocation tag (in-memory tag) is a property assigned to a physical > > address range and it can be safely shared between different processes as > > long as they access it via pointers with the same allocation tag (bits > > 59:56). The kernel enables such tagged shared memory for user processes > > (anonymous, tmpfs, shmem). > > I think that's one case where the shared memory scheme breaks, as we > have two kernels in charge of their own tags, and they obviously can't > be synchronised Yes, if you can't trust the other entity to not change the tags, the only option is to do an untagged access. > > What we don't have in the architecture is a memory type which allows > > access to tags but no tag checking. To access the data when the tags > > aren't known, the tag checking would have to be disabled via either a > > prctl() or by setting the PSTATE.TCO bit. > > I guess that's point (3) in Steven's taxonomy. It still a bit ugly to > fit in an existing piece of userspace, specially if it wants to use > MTE for its own benefit. I agree it's ugly. For the device DMA emulation case, the only sane way is to mimic what a real device does - no tag checking. For a generic implementation, this means that such shared memory should not be mapped with PROT_MTE on the VMM side. I guess this leads to your point that sharing doesn't work for this scenario ;). > > The kernel accesses the user memory via the linear map using a match-all > > tag 0xf, so no TCO bit toggling. For user, however, we disabled such > > match-all tag and it cannot be enabled at run-time (at least not easily, > > it's cached in the TLB). However, we already have two modes to disable > > tag checking which Qemu could use when migrating data+tags. > > I wonder whether we will have to have something kernel side to > dump/reload tags in a way that matches the patterns used by live > migration. We have something related - ptrace dumps/resores the tags. Can the same concept be expanded to a KVM ioctl? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel