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 BADB8C43334 for ; Thu, 14 Jul 2022 13:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbiGNNbD (ORCPT ); Thu, 14 Jul 2022 09:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbiGNNbB (ORCPT ); Thu, 14 Jul 2022 09:31:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D0F3B01 for ; Thu, 14 Jul 2022 06:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657805458; 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=3A2MgQ6BI+ZOeh/AAU41/XCV92zAyr9BTrgNi4g6/m4=; b=NJ9V6pr7/kJyhMRemq7jCz0bA6twonVXLFZSLAi5src8nlhMJKpL1yCK2RZoJG+IzadVcV aNCMHvu5zvbJ6DDEDpvdCmd8EANHM3D0rzbhGWCo9Qp6frIQWbdbd2MnJ1PQVicjAQ0GkB /GvOgzOt65tk3LdJGk8k/K/8MuMZDGg= 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-349-E8geG59JNpCXsKJ8_zEn6w-1; Thu, 14 Jul 2022 09:30:57 -0400 X-MC-Unique: E8geG59JNpCXsKJ8_zEn6w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4F1F8117B0; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) Received: from localhost (unknown [10.39.193.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F239492C3B; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) From: Cornelia Huck To: Peter Xu Cc: Steven Price , Catalin Marinas , Peter Collingbourne , kvmarm@lists.cs.columbia.edu, Marc Zyngier , kvm@vger.kernel.org, Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Michael Roth , Chao Peng , Will Deacon , Evgenii Stepanov , Jean-Philippe Brucker , Gavin Shan , Eric Auger , "Dr. David Alan Gilbert" Subject: Re: [PATCH] KVM: arm64: permit MAP_SHARED mappings with MTE enabled In-Reply-To: Organization: Red Hat GmbH References: <20220623234944.141869-1-pcc@google.com> <14f2a69e-4022-e463-1662-30032655e3d1@arm.com> <875ykmcd8q.fsf@redhat.com> <7a32fde7-611d-4649-2d74-f5e434497649@arm.com> <871qv12hqj.fsf@redhat.com> <87bktz7o49.fsf@redhat.com> User-Agent: Notmuch/0.36 (https://notmuchmail.org) Date: Thu, 14 Jul 2022 15:30:54 +0200 Message-ID: <87edynizxt.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Jul 08 2022, Peter Xu wrote: > On Fri, Jul 08, 2022 at 03:03:34PM +0200, Cornelia Huck wrote: >> I was thinking about a new flag that implies "copy metadata"; not sure >> how we would get the same atomicity with a separate ioctl. I've only >> just started looking at userfaultfd, though, and I might be on a wrong >> track... One thing I'd like to avoid is having something that is too >> ARM-specific, I think there are other architecture features that might >> have similar issues. > > Agreed, to propose such an interface we'd better make sure it'll be easily > applicable to other similar memory protection mechanisms elsewhere. There's storage keys on s390, although I believe they are considered legacy by now. I dimly recall something in x86 land. > >> >> Maybe someone more familiar with uffd and/or postcopy can chime in? > > Hanving UFFDIO_COPY provide a new flag sounds reasonable to me. I'm > curious what's the maximum possible size of the tags and whether they can > be embeded already into struct uffdio_copy somehow. Each tag is four bits and covers 16 bytes (also see the defs in arch/arm64/include/asm/mte-def.h). 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 04374C433EF for ; Thu, 14 Jul 2022 13:31:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6DA644C5B9; Thu, 14 Jul 2022 09:31:05 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com 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 YWFnHN6-O0BU; Thu, 14 Jul 2022 09:31:04 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F0E604C563; Thu, 14 Jul 2022 09:31:03 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 552E24C4D7 for ; Thu, 14 Jul 2022 09:31:03 -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 7361VSISSzV3 for ; Thu, 14 Jul 2022 09:31:02 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2DA5F4C4CD for ; Thu, 14 Jul 2022 09:31:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657805461; 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=3A2MgQ6BI+ZOeh/AAU41/XCV92zAyr9BTrgNi4g6/m4=; b=iMYkYmwXcXXarM/MU09cnLj279qFG57eqyhNe6PFX77cmYFSq6GRLzBpmxi4AdcesZFoY2 /KESRfo9r/MLJFkd7HD3r/Q5TArEoMd/TFb7eu1Svo1SJ9t5HlgdFVG0BatWLSc9VbdRkL 9/5KNgaJX7slneUM6OUJGhzvSYmtC9w= 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-349-E8geG59JNpCXsKJ8_zEn6w-1; Thu, 14 Jul 2022 09:30:57 -0400 X-MC-Unique: E8geG59JNpCXsKJ8_zEn6w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4F1F8117B0; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) Received: from localhost (unknown [10.39.193.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F239492C3B; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) From: Cornelia Huck To: Peter Xu Subject: Re: [PATCH] KVM: arm64: permit MAP_SHARED mappings with MTE enabled In-Reply-To: Organization: Red Hat GmbH References: <20220623234944.141869-1-pcc@google.com> <14f2a69e-4022-e463-1662-30032655e3d1@arm.com> <875ykmcd8q.fsf@redhat.com> <7a32fde7-611d-4649-2d74-f5e434497649@arm.com> <871qv12hqj.fsf@redhat.com> <87bktz7o49.fsf@redhat.com> User-Agent: Notmuch/0.36 (https://notmuchmail.org) Date: Thu, 14 Jul 2022 15:30:54 +0200 Message-ID: <87edynizxt.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Cc: Jean-Philippe Brucker , kvm@vger.kernel.org, Catalin Marinas , "Dr. David Alan Gilbert" , Steven Price , Will Deacon , Evgenii Stepanov , Michael Roth , Marc Zyngier , Chao Peng , Andy Lutomirski , Peter Collingbourne , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 Fri, Jul 08 2022, Peter Xu wrote: > On Fri, Jul 08, 2022 at 03:03:34PM +0200, Cornelia Huck wrote: >> I was thinking about a new flag that implies "copy metadata"; not sure >> how we would get the same atomicity with a separate ioctl. I've only >> just started looking at userfaultfd, though, and I might be on a wrong >> track... One thing I'd like to avoid is having something that is too >> ARM-specific, I think there are other architecture features that might >> have similar issues. > > Agreed, to propose such an interface we'd better make sure it'll be easily > applicable to other similar memory protection mechanisms elsewhere. There's storage keys on s390, although I believe they are considered legacy by now. I dimly recall something in x86 land. > >> >> Maybe someone more familiar with uffd and/or postcopy can chime in? > > Hanving UFFDIO_COPY provide a new flag sounds reasonable to me. I'm > curious what's the maximum possible size of the tags and whether they can > be embeded already into struct uffdio_copy somehow. Each tag is four bits and covers 16 bytes (also see the defs in arch/arm64/include/asm/mte-def.h). _______________________________________________ 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 088DCC433EF for ; Thu, 14 Jul 2022 13:32:25 +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=zO07bn7t4L0BfFSpek2ma8CWtxMPu3yN6j3Gvgc2iw4=; b=Y35x7ixqKp1f1n Yu8bEpTGNL4UKkALhVq7v0rFaOSl70xozuMp2NqPlwzHmpaz3CiSvU8iOR4/FFlct5Ep5ynzFlhhE Lo7+lJJ75uMyUr1BrzCvDwxDvDx1WdCq1uby3FxbArlfJy8Qsq8rG9jsIgADkZGw+mmNuSy0k2TFi 87IaNrWbzyJ0ynb31euwAIgaWYVq4ZcrfiLKWV9gKDjUgOM9kkbwyFIitIZ5zqQP4UfvOwv9DlPQE TuWC0hQywY3Aryt8oW7P1/+1f4I+Os0IMNpZzFIJ1pEcHkE68DHCG0ekWH0Y4eNGcqsy/+pFZw7z4 r8wmD8Z1RiZV1ewLC99A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oByvt-00EjXc-Ug; Thu, 14 Jul 2022 13:31:10 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oByvq-00EjVF-Vu for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 13:31:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657805463; 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=3A2MgQ6BI+ZOeh/AAU41/XCV92zAyr9BTrgNi4g6/m4=; b=aNy16y5psCYWX6LTg9j4wz5OdvYvBmrlw5+jGTZKv0+14JsgHmTw8A/DFQ97DA2OgWPIt2 QH8lZnl47ZlKRAIoMC6vW8i9MD+wDFHKXGYUT+mXmckGFjfrYivCQP/p7XUpp/YoRli8jK estk2rCjQGdeoojcXfULg+fxs8dzqxU= 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-349-E8geG59JNpCXsKJ8_zEn6w-1; Thu, 14 Jul 2022 09:30:57 -0400 X-MC-Unique: E8geG59JNpCXsKJ8_zEn6w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C4F1F8117B0; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) Received: from localhost (unknown [10.39.193.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F239492C3B; Thu, 14 Jul 2022 13:30:56 +0000 (UTC) From: Cornelia Huck To: Peter Xu Cc: Steven Price , Catalin Marinas , Peter Collingbourne , kvmarm@lists.cs.columbia.edu, Marc Zyngier , kvm@vger.kernel.org, Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Michael Roth , Chao Peng , Will Deacon , Evgenii Stepanov , Jean-Philippe Brucker , Gavin Shan , Eric Auger , "Dr. David Alan Gilbert" Subject: Re: [PATCH] KVM: arm64: permit MAP_SHARED mappings with MTE enabled In-Reply-To: Organization: Red Hat GmbH References: <20220623234944.141869-1-pcc@google.com> <14f2a69e-4022-e463-1662-30032655e3d1@arm.com> <875ykmcd8q.fsf@redhat.com> <7a32fde7-611d-4649-2d74-f5e434497649@arm.com> <871qv12hqj.fsf@redhat.com> <87bktz7o49.fsf@redhat.com> User-Agent: Notmuch/0.36 (https://notmuchmail.org) Date: Thu, 14 Jul 2022 15:30:54 +0200 Message-ID: <87edynizxt.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_063107_138827_F9479766 X-CRM114-Status: GOOD ( 14.52 ) 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 Xu wrote: > On Fri, Jul 08, 2022 at 03:03:34PM +0200, Cornelia Huck wrote: >> I was thinking about a new flag that implies "copy metadata"; not sure >> how we would get the same atomicity with a separate ioctl. I've only >> just started looking at userfaultfd, though, and I might be on a wrong >> track... One thing I'd like to avoid is having something that is too >> ARM-specific, I think there are other architecture features that might >> have similar issues. > > Agreed, to propose such an interface we'd better make sure it'll be easily > applicable to other similar memory protection mechanisms elsewhere. There's storage keys on s390, although I believe they are considered legacy by now. I dimly recall something in x86 land. > >> >> Maybe someone more familiar with uffd and/or postcopy can chime in? > > Hanving UFFDIO_COPY provide a new flag sounds reasonable to me. I'm > curious what's the maximum possible size of the tags and whether they can > be embeded already into struct uffdio_copy somehow. Each tag is four bits and covers 16 bytes (also see the defs in arch/arm64/include/asm/mte-def.h). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel