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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham 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 A98C2C433DB for ; Wed, 10 Feb 2021 08:20:58 +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 C385664E53 for ; Wed, 10 Feb 2021 08:20:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C385664E53 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9kk4-0005WU-Kq for qemu-devel@archiver.kernel.org; Wed, 10 Feb 2021 03:20:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9kia-0004wG-4m for qemu-devel@nongnu.org; Wed, 10 Feb 2021 03:19:24 -0500 Received: from 1.mo52.mail-out.ovh.net ([178.32.96.117]:56892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9kiU-0001bq-IA for qemu-devel@nongnu.org; Wed, 10 Feb 2021 03:19:23 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.109.138.42]) by mo52.mail-out.ovh.net (Postfix) with ESMTPS id D25F323D715; Wed, 10 Feb 2021 09:19:14 +0100 (CET) Received: from kaod.org (37.59.142.106) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 10 Feb 2021 09:19:14 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-106R0063e77de5e-0d06-48db-922a-fabcd627fd6a, CA44D9D1C99DDC6070F74A114A21469C6A1097AD) smtp.auth=groug@kaod.org X-OVh-ClientIp: 78.197.208.248 Date: Wed, 10 Feb 2021 09:19:12 +0100 From: Greg Kurz To: Eric Auger Subject: Re: [PATCH 2/2] spapr_iommu: Fix vhost integration regression Message-ID: <20210210091912.3ea5159d@bahia.lan> In-Reply-To: <20210209213233.40985-3-eric.auger@redhat.com> References: <20210209213233.40985-1-eric.auger@redhat.com> <20210209213233.40985-3-eric.auger@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.106] X-ClientProxiedBy: DAG8EX2.mxp5.local (172.16.2.72) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: bdeef48c-a0f2-48d1-a996-25cc4f54da2f X-Ovh-Tracer-Id: 10881259653352692216 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrheeigdduvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtgfhisehtjeertdertddvnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeefuddtieejjeevheekieeltefgleetkeetheettdeifeffvefhffelffdtfeeljeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepghhrohhugheskhgrohgurdhorhhgpdhrtghpthhtohepphgvthgvrhigsehrvgguhhgrthdrtghomh Received-SPF: pass client-ip=178.32.96.117; envelope-from=groug@kaod.org; helo=1.mo52.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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@linaro.org, mst@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, peterx@redhat.com, eperezma@redhat.com, alex.williamson@redhat.com, qemu-arm@nongnu.org, jean-philippe@linaro.org, david@gibson.dropbear.id.au, eric.auger.pro@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 9 Feb 2021 22:32:33 +0100 Eric Auger wrote: > Previous work on dev-iotlb message broke spapr_iommu/vhost integration > as it did for SMMU and virtio-iommu. The spapr_iommu currently > only sends IOMMU_NOTIFIER_UNMAP notifications. Since commit > 958ec334bca3 ("vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support"), > VHOST first tries to register IOMMU_NOTIFIER_DEVIOTLB_UNMAP notifier > and if it fails, falls back to legacy IOMMU_NOTIFIER_UNMAP. So > spapr_iommu must fail on the IOMMU_NOTIFIER_DEVIOTLB_UNMAP > registration. > > Reported-by: Peter Xu > Fixes: b68ba1ca57677acf870d5ab10579e6105c1f5338 > Signed-off-by: Eric Auger > --- Reviewed-by: Greg Kurz > hw/ppc/spapr_iommu.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > index 30352df00e..24537ffcbd 100644 > --- a/hw/ppc/spapr_iommu.c > +++ b/hw/ppc/spapr_iommu.c > @@ -212,6 +212,11 @@ static int spapr_tce_notify_flag_changed(IOMMUMemoryRegion *iommu, > { > struct SpaprTceTable *tbl = container_of(iommu, SpaprTceTable, iommu); > > + if (new & IOMMU_NOTIFIER_DEVIOTLB_UNMAP) { > + error_setg(errp, "spart_tce does not support dev-iotlb yet"); > + return -EINVAL; > + } > + > if (old == IOMMU_NOTIFIER_NONE && new != IOMMU_NOTIFIER_NONE) { > spapr_tce_set_need_vfio(tbl, true); > } else if (old != IOMMU_NOTIFIER_NONE && new == IOMMU_NOTIFIER_NONE) {