Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp989739rda; Sun, 22 Oct 2023 20:52:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIrDE/0XYMiQH8TwvrzavWhO2UDgjPc9iQ9QsD3lYGAR2WIJpzdzqI4cMOUgiKUfxWeDiz X-Received: by 2002:a05:6870:1216:b0:1e9:e0d7:3663 with SMTP id 22-20020a056870121600b001e9e0d73663mr9360258oan.49.1698033179807; Sun, 22 Oct 2023 20:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698033179; cv=none; d=google.com; s=arc-20160816; b=sqcn6P9BHiPWk8X8BRmy5h2VxiKRnhlNThtnU7/a/kV1GNI5GJDoY4I9QlCr9cPLqD xXUPerPzBVc/qprYUPaKoRST5QJxP1QczMxu94rKSVpyLHkgwnKdGubGn+52hyO8j8M0 ZW0rgOcPQ3eT4+KiQ8ST0uuwXIcwmPJRYz2MBhXjSnGBFuMWSYXSi+69mllzg68q2iKH YbZxV6xpP7fa03kpMSwUGGGcy+lQcsxGNHYdYeV7I1xREV+Q3i7Vk+FS7osiLRlhMVmk AWWQQrPY+uJq0LJ6Qs/Em1n+6mlSqT6fgFMJ67acarn69/EA0dkiQ+76KmtU+93R+XqM 8XLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+V7BmlRiz3EwuPt7UOzQq7qzRqObgsoG0aaVO3Q641Q=; fh=Udn3Za/qdmvQqx4jjAPZRfOL+XNi1gAYaT34mhOs9Zg=; b=EQM5Dd1A4Nf0PFmfvwbmB8rqZZLp7fCVP2A6j6lxPZom+9mL4j6jQyALqW8wGFJzNq ZcEdkSDrW9dFlJHANKzbE95ePbuSM634KkQqQ1p8FksJEsrjNoim/aTIZpf6Sd9tOYWc Zp8EnCvHY+tXsqdAhr6RfVx2b7QgXfKMaA7We6kxQJrLcqMF7hUVjMCc5RFOO6fT1hkW aQrD45dXwQcIbPLcPzR1jD4dfYrXXgJPlAQeoS2ru5jAKPhnwH17s1yWTfC0gft+v52q YmjpK7EdOeQwXedAbdYYb6LkG7rGFt3LQ7FCp8MOQj3UWnbJranIz5OQll50NToRbwo7 NIgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IoUpiP8d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s132-20020a63778a000000b005ab74d58e01si5504153pgc.439.2023.10.22.20.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 20:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IoUpiP8d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C3EB6808D2AC; Sun, 22 Oct 2023 20:52:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbjJWDw3 (ORCPT + 99 others); Sun, 22 Oct 2023 23:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJWDw2 (ORCPT ); Sun, 22 Oct 2023 23:52:28 -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 ESMTPS id 1BD43188 for ; Sun, 22 Oct 2023 20:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698033099; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+V7BmlRiz3EwuPt7UOzQq7qzRqObgsoG0aaVO3Q641Q=; b=IoUpiP8d80kDQpkXzK5vK6Zyo9ctiSrpjIoDPOzB25V4w/ufnQ717XeTYjQrCLZmdVTjmT 3UTSYRGtrwCORhvaGtqrSQ5qTsobe+8vyNfATLp3vjUmSsVu+d3ux2vxEMgsaUtNSue2+n kdcafocQBlnP5k1cAmUxau9x68SdcO8= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529--OAKnr4LOA-hT-F-qfynHw-1; Sun, 22 Oct 2023 23:51:32 -0400 X-MC-Unique: -OAKnr4LOA-hT-F-qfynHw-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5079fe7cc7cso2855184e87.2 for ; Sun, 22 Oct 2023 20:51:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698033090; x=1698637890; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+V7BmlRiz3EwuPt7UOzQq7qzRqObgsoG0aaVO3Q641Q=; b=rSF3WjZ23gmDcrMfuaeAed5h078nUDm/DePcCDvfniSr2t/MgJJuXSoOl/tiLZD39W az4KjCbV/aOtQbqHNelIPeYPcq89Tjz/wV3DLErZdLuEULdFxQ0XzEu8HXhRFdXcGKEg nl4VIcMIqlN6Ra/+ZUQBtHNJapN2oHY+hY5JLlLKavLjCdQxlPKj2FmrVanlHAC/hODy x8ney0KIH2km2UA5DCK15/zAnHmCl/PtrhcJiapBotAvD5jHJReZ9HGGvgfjTlIzeMXg RyFDJEtA2yQ4sKm9N1B2u41EVgxLq4yK2AryVx0GCmYC9ASAdIGXh7WQvSUoN4K41NsJ 9fHQ== X-Gm-Message-State: AOJu0YyZ27fX9OqUD/a983pEeR51c3CPZSJ07q7Ub1nZ4G31MGIz2bRb QefX0mKEUzgfVEcwusLJHyilc5kbpItCBcx5urlnYnzoG5UnlTPJNXneG3kRUUChJirU27tBHZK CreCblBPb8HY/z3UjeGZfjQWzerZPFpUp2whfYqgGdM3vFhCCIKU= X-Received: by 2002:ac2:4911:0:b0:500:7a21:3e78 with SMTP id n17-20020ac24911000000b005007a213e78mr5226118lfi.55.1698033090739; Sun, 22 Oct 2023 20:51:30 -0700 (PDT) X-Received: by 2002:ac2:4911:0:b0:500:7a21:3e78 with SMTP id n17-20020ac24911000000b005007a213e78mr5226109lfi.55.1698033090354; Sun, 22 Oct 2023 20:51:30 -0700 (PDT) MIME-Version: 1.0 References: <1697880319-4937-1-git-send-email-si-wei.liu@oracle.com> In-Reply-To: <1697880319-4937-1-git-send-email-si-wei.liu@oracle.com> From: Jason Wang Date: Mon, 23 Oct 2023 11:51:19 +0800 Message-ID: Subject: Re: [PATCH v4 0/7] vdpa: decouple reset of iotlb mapping from device reset To: Si-Wei Liu Cc: mst@redhat.com, eperezma@redhat.com, sgarzare@redhat.com, dtatulea@nvidia.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 22 Oct 2023 20:52:57 -0700 (PDT) Hi Si-Wei: On Sat, Oct 21, 2023 at 5:28=E2=80=AFPM Si-Wei Liu = wrote: > > In order to reduce needlessly high setup and teardown cost > of iotlb mapping during live migration, it's crucial to > decouple the vhost-vdpa iotlb abstraction from the virtio > device life cycle, i.e. iotlb mappings should be left > intact across virtio device reset [1]. For it to work, the > on-chip IOMMU parent device could implement a separate > .reset_map() operation callback to restore 1:1 DMA mapping > without having to resort to the .reset() callback, the > latter of which is mainly used to reset virtio device state. > This new .reset_map() callback will be invoked only before > the vhost-vdpa driver is to be removed and detached from > the vdpa bus, such that other vdpa bus drivers, e.g. > virtio-vdpa, can start with 1:1 DMA mapping when they > are attached. For the context, those on-chip IOMMU parent > devices, create the 1:1 DMA mapping at vdpa device creation, > and they would implicitly destroy the 1:1 mapping when > the first .set_map or .dma_map callback is invoked. > > This patchset is rebased on top of the latest vhost tree. > > [1] Reducing vdpa migration downtime because of memory pin / maps > https://www.mail-archive.com/qemu-devel@nongnu.org/msg953755.html > > --- > v4: > - Rework compatibility using new .compat_reset driver op I still think having a set_backend_feature() or reset_map(clean=3Dtrue) might be better. As it tries hard to not introduce new stuff on the bus. But we can listen to others for sure. Thanks