From nobody Sun Feb 8 17:21:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661279066; cv=none; d=zohomail.com; s=zohoarc; b=RDgvgStT+SdFFxV+hEW4pG4Pfg4CVCanAuYZqeG/5UDRgwcFd/VQyTVwieVGTz+b2aqDq0hEdDzbpF2iUynmoyfwTRG0sS6Vn4y5isBegfTkcPtQQAvkgjCF+JGiY/GLDBQfTR6QINW0s8qa7FWMZn1urTKKSoOyv4A7+wAehus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661279066; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qnVGWjSMIp3mECXi5SalJudL78dZzeCiGZ1sn97SGrQ=; b=U0Q84PtcDAKNX+V8Q4S70WMfDnXKtW9H7/kN8khgKsTJj4acCqM0tyhdB0sJgoEpYltxJTJgGUmFfaQdXWCbPV5ZwjhxszoOuUWePqYiQpqoZoJQEt6pJDePf/xmfxGkPcZHSCUW/8qc+EOyDBIL1h9WzVhIIsebSfdml3la6Lc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166127906696069.61285074167142; Tue, 23 Aug 2022 11:24:26 -0700 (PDT) Received: from localhost ([::1]:33724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQYZc-000832-Gy for importer@patchew.org; Tue, 23 Aug 2022 14:24:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQYVt-0005HU-Tl for qemu-devel@nongnu.org; Tue, 23 Aug 2022 14:20:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQYVe-00032W-Fg for qemu-devel@nongnu.org; Tue, 23 Aug 2022 14:20:20 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-46-l4-ZCZXzMiWT8XV9YY8RLA-1; Tue, 23 Aug 2022 14:20:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68FEE3803903; Tue, 23 Aug 2022 18:20:14 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.195.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99DD040D2830; Tue, 23 Aug 2022 18:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661278817; 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=qnVGWjSMIp3mECXi5SalJudL78dZzeCiGZ1sn97SGrQ=; b=i0OPouDGytmHg0k6iQVF9nrT1IOjQR6RylxPKOBS7P9kAc1LDTFKwRfDtdSgBEvIztxy/r i+seDVkCozdStogCi3KaKU3hWPc8DVKhYBoV0u0uu93hdDTnbcOLV5gY1cBWY0U5v7fjR3 kCgNKbGAWmTDWtNpclAjUqwIvGamzAY= X-MC-Unique: l4-ZCZXzMiWT8XV9YY8RLA-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Jason Wang , Paolo Bonzini , "Michael S. Tsirkin" , Peter Xu , Cindy Lu , Laurent Vivier , Lei Yang , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH v2 1/7] vdpa: Skip the maps not in the iova tree Date: Tue, 23 Aug 2022 20:20:02 +0200 Message-Id: <20220823182008.97141-2-eperezma@redhat.com> In-Reply-To: <20220823182008.97141-1-eperezma@redhat.com> References: <20220823182008.97141-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661279069894100001 Next patch will skip the registering of dma maps that the vdpa device rejects in the iova tree. We need to consider that here or we cause a SIGSEGV accessing result. Reported-by: Lei Yang Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 3ff9ce3501..983d3697b0 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -289,6 +289,10 @@ static void vhost_vdpa_listener_region_del(MemoryListe= ner *listener, }; =20 result =3D vhost_iova_tree_find_iova(v->iova_tree, &mem_region); + if (!result) { + /* The memory listener map wasn't mapped */ + return; + } iova =3D result->iova; vhost_iova_tree_remove(v->iova_tree, result); } --=20 2.31.1