From nobody Tue Feb 10 10:20:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571863444; cv=none; d=zoho.com; s=zohoarc; b=E4XiOgZL7hpwMqAr+4/iImh6/L8W7U32CQF9xsG7uLFnf6VFPbIwGYaPYUmOkcKHS2LCdRuBSFy9qf3OAJexz25sYV1iQcLFm2Kyz66tCY59Fjxpaelvb70OeiaE7cOfotUSY5TdNkG2YuP79uo/SuoT6MtOZeNIMHVgF5F3Eko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571863444; 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=KKxnDtWH+IBHEOp1QyHnSnDFsBZXpz4ihyY+6fCgcJ4=; b=XnRJNG+w7TQJTg9zM/IZhRsWnQzzACAz5Zhm4LHy2qfeNY0w06oWwqvEjfu4f+hqRSqkJKorzLJWA1L6KQfTO2IGRkyufPEqOleeskeUZK3MiYwZlzIJPMSFBadr+LVydgUSdUP8psQqTOhII5v3pIRM8QukzLIuGLQZGUBF8Wc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571863444100764.7956080652185; Wed, 23 Oct 2019 13:44:04 -0700 (PDT) Received: from localhost ([::1]:47422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNNU4-0002LG-B0 for importer@patchew.org; Wed, 23 Oct 2019 16:43:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59775) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNKX9-0005Oz-BZ for qemu-devel@nongnu.org; Wed, 23 Oct 2019 13:34:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNKX8-0002LT-70 for qemu-devel@nongnu.org; Wed, 23 Oct 2019 13:34:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57648 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNKX6-0002Fs-3t for qemu-devel@nongnu.org; Wed, 23 Oct 2019 13:34:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-PXrH0LYxPcmZ4cLupWVLlQ-1; Wed, 23 Oct 2019 13:34:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 036471005512; Wed, 23 Oct 2019 17:34:36 +0000 (UTC) Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C16F5C1D4; Wed, 23 Oct 2019 17:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571852081; 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=KKxnDtWH+IBHEOp1QyHnSnDFsBZXpz4ihyY+6fCgcJ4=; b=SkBwHR71LqOuE+wvx4VH3dTWZInSWL9AoPQLNVqgbiv14asDY4FPWJvuXrRb66nzZGzncI 5a/fSRK7k8VtE5GuOJ9SLY+6EV3ig0v+6ZpEr6CuNzRXRBRW4CarRRdzeYClPFg2N3AJ7G MLab7U5pLPKnUDFbHkn5wPfzkh2cp/4= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PATCH v3 23/33] dp8393x: replace PROP_PTR with PROP_LINK Date: Wed, 23 Oct 2019 19:31:44 +0200 Message-Id: <20191023173154.30051-24-marcandre.lureau@redhat.com> In-Reply-To: <20191023173154.30051-1-marcandre.lureau@redhat.com> References: <20191023173154.30051-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: PXrH0LYxPcmZ4cLupWVLlQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Corey Minyard , Peter Maydell , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Paul Burton , Aleksandar Rikalo , Magnus Damm , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Artyom Tarasenko , Eduardo Habkost , Fabien Chouteau , qemu-arm@nongnu.org, Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-ppc@nongnu.org, Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Link property is the correct way to pass a MemoryRegion to a device for DMA purposes. Sidenote: as a sysbus device, this remains non-usercreatable even though we can drop the specific flag here. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/mips_jazz.c | 3 ++- hw/net/dp8393x.c | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 8d010a0b6e..878925a963 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -284,7 +284,8 @@ static void mips_jazz_init(MachineState *machine, dev =3D qdev_create(NULL, "dp8393x"); qdev_set_nic_properties(dev, nd); qdev_prop_set_uint8(dev, "it_shift", 2); - qdev_prop_set_ptr(dev, "dma_mr", rc4030_dma_mr); + object_property_set_link(OBJECT(dev), OBJECT(rc4030_dma_mr), + "dma_mr", &error_abort); qdev_init_nofail(dev); sysbus =3D SYS_BUS_DEVICE(dev); sysbus_mmio_map(sysbus, 0, 0x80001000); diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index a5678e11fa..946c7a8f64 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -173,7 +173,7 @@ typedef struct dp8393xState { int loopback_packet; =20 /* Memory access */ - void *dma_mr; + MemoryRegion *dma_mr; AddressSpace as; } dp8393xState; =20 @@ -922,7 +922,8 @@ static const VMStateDescription vmstate_dp8393x =3D { =20 static Property dp8393x_properties[] =3D { DEFINE_NIC_PROPERTIES(dp8393xState, conf), - DEFINE_PROP_PTR("dma_mr", dp8393xState, dma_mr), + DEFINE_PROP_LINK("dma_mr", dp8393xState, dma_mr, + TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_UINT8("it_shift", dp8393xState, it_shift, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -936,8 +937,6 @@ static void dp8393x_class_init(ObjectClass *klass, void= *data) dc->reset =3D dp8393x_reset; dc->vmsd =3D &vmstate_dp8393x; dc->props =3D dp8393x_properties; - /* Reason: dma_mr property can't be set */ - dc->user_creatable =3D false; } =20 static const TypeInfo dp8393x_info =3D { --=20 2.23.0.606.g08da6496b6