From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681209; cv=none; d=zohomail.com; s=zohoarc; b=BuvHgJn7oMJ9pQir4nZXNo7XwmhZuvPCiKbqfymrcdOJhW/yQFSFsLTNzkz+7XTjNwX9DA60cPZtSSzebq5b/a/RgjxR/g6S1bzqg7eKSbnCcVKnL43cT13bT+YTn0iNGdPgPXwb/5ItTfP9Da09FIvA/HV4ZZW5UoixXXzAmio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681209; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OJcE8AaeGgme1cFyhW7S6XSzHys2rlqbG+8+Unty9dI=; b=msyYgt6q+JtkI/ZxMlTslxf+dobsABzedJsHhYcFgxQkeE2ilBFEekQbcfrXfaE7U39eNXYxQlIhqqV69aKivdzc3IeM9r5Me8MURgz1F4uqOw/p07k7MLpkYy2mZznxs6g//d1Ngb7A1EB/SC57AjhcHSO+TRMT1t0qo7sK8yk= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681209322141.3558457479876; Fri, 10 Jul 2026 04:00:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8wz-0006Tv-4R; Fri, 10 Jul 2026 06:59:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wr-0006Rp-Tz for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:14 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wp-0001NN-TU for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:13 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-493c5220cb7so5454125e9.3 for ; Fri, 10 Jul 2026 03:59:11 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681150; x=1784285950; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=OJcE8AaeGgme1cFyhW7S6XSzHys2rlqbG+8+Unty9dI=; b=OHPN2DSKcbVhO94QKPNnU6glmeNrI4ASFGnzX5zVXmsIj1OczKqW1oaPihgmt527Ui t6McKRX83Y69AiImKTpxD6jjYBx9r/urW2xYrlWQgjH7Wdt8UzulHad7yPPzAWKzfcot OOFrhm9OgniTBB6R+1vSex78gyRfOgk7P4FdzDWK0lL+gXUVP4vMVFxw03JMDQIjMG3b 565fRrdi06ddbIQyACng3omPqqkoIzGgBP/xTJxImFuKsdKfS8NhTdo7r0zG4RzdiOC5 g5nglq91/6impBSbHQceAXYP0t0DvBR5ArguAmBA41lkEOqPTiMPNVS8AlEGn+9xwICp 1Llw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681150; x=1784285950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=OJcE8AaeGgme1cFyhW7S6XSzHys2rlqbG+8+Unty9dI=; b=F9CnfzOollTJtNjKA/LST/EfEs41VxgkqTdNXkHexR1KamEyi1HOAZ5qS9ZnkmMZsi 6NWziusWFJjeq3roCkxpKieUt3Ooy6Te8pnpmtIdGG7nPSzuvZjJV92LJ0btZWw0uqpK cY92Fax6rFHhSXNZ2rZ8fFMDzmPs7J7+mxD2gkgIBbnXktTVAOEGV3t3ENSyjJ/67nLY PYSEMjUGM38YZ5VK3S5UGjzmcLOQrSvp/Waq4DJPIiSaZuyy96xvS+H8SwYJysL9+CQx ggO8ziS6rVaU0I19x4iuUPFwEj7jMadK9TeBLsaf3Km367ziU+aR6As4f/ov0hLysiVU Q5FA== X-Forwarded-Encrypted: i=1; AHgh+RoRi3Kv/o0RZIrLShd6GOyyyIn1J9hw2dky0OzwkMEnTmJVv51HviGKlQJz7aWVWFF1xYHxSWErOZjl@nongnu.org X-Gm-Message-State: AOJu0YzkfdruC2KhRGwDHvo8e/pDEL99ByylO/ZzsNHhz5kvKFBjWb4A tX/I8ArffFh5Q1p0GD+RHIiqZrdUKBp6+mk2CkCgdy0IGgaeetKf58+JHBOQshhla0nIexoEYeo 1zSFgjMlzqA== X-Gm-Gg: AfdE7ckGhEhoovYBlp5sW+abM37ZAZTaWXDjsmcPmK+Tzac8sYeyZKdMlrLxh0wdu5d 0yKxSel1ve4GZFWuESc64QZdDbE+bear+skEc3ci7F0enb4XWxPqjM/RgXIfHaXVOrBLmXtoV6d AXElby7Za45hJaG+n5ZcXye2nzB0g2x+eOph2p9MuElsNFB31B1nruubFZC1Sbm3C4GeIkXYSrh 36kZ/+QfQelN54eq7ZiFPa+btfGXxiRu1PZKB/LTVFdXRYpGdDFICRMgkSyKa1/BX2adgDIMND8 qNdTkRyo0rCHagKN5FpH8E5td5NvkaMgIrtUfmXU1zOauX1t7xU7b1zJwUNThEQkCQ1hS+l0EiP 5C/ArJ7Pnscd0dCyMbf2xxniU94wYunb8bYm1LGjtf2JxrKd+mTyuAn8MWdHCcgxTaLH7uyNtN5 VnOj0yXCzXwHoFVYSgM3Av9GdPA+3MsbMbez91l7T8R1k5y5RaEMvOb9z4IcYX/YS6mOsOR0lBz oDZp6Z2LDXdEXdnyLms2g== X-Received: by 2002:a05:600c:1c18:b0:492:7101:3d88 with SMTP id 5b1f17b1804b1-493e68c4ab4mr113887195e9.24.1783681149959; Fri, 10 Jul 2026 03:59:09 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 1/9] hw/dma/soc_dma: Remove soc_dma_port_fifo support Date: Fri, 10 Jul 2026 11:58:59 +0100 Message-ID: <20260710105907.2570621-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681209840158501 Content-Type: text/plain; charset="utf-8" Our current single OMAP SoC doesn't call the soc_dma_port_add_fifo(), soc_dma_port_add_fifo_in() or soc_dma_port_add_fifo_out() functions. Remove them, plus the soc_dma_port_fifo handling that only those functions needed. The motivation for this is that it removes a lot of code that is careless about the fact that the largest possible DMA transfer is more bits than will fit into an "int" variable, and which does direct accesses to host memory pointers into guest backing RAM without doing bounds checks. Deleting this code means we don't have to audit and update it. Signed-off-by: Peter Maydell --- hw/dma/soc_dma.c | 105 +-------------------------------------- include/hw/arm/soc_dma.h | 24 ++------- 2 files changed, 5 insertions(+), 124 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index d5c52b804f..8ba531feea 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -29,33 +29,6 @@ static void transfer_mem2mem(struct soc_dma_ch_s *ch) ch->paddr[1] +=3D ch->bytes; } =20 -static void transfer_mem2fifo(struct soc_dma_ch_s *ch) -{ - ch->io_fn[1](ch->io_opaque[1], ch->paddr[0], ch->bytes); - ch->paddr[0] +=3D ch->bytes; -} - -static void transfer_fifo2mem(struct soc_dma_ch_s *ch) -{ - ch->io_fn[0](ch->io_opaque[0], ch->paddr[1], ch->bytes); - ch->paddr[1] +=3D ch->bytes; -} - -/* This is further optimisable but isn't very important because often - * DMA peripherals forbid this kind of transfers and even when they don't, - * oprating systems may not need to use them. */ -static void *fifo_buf; -static int fifo_size; -static void transfer_fifo2fifo(struct soc_dma_ch_s *ch) -{ - if (ch->bytes > fifo_size) - fifo_buf =3D g_realloc(fifo_buf, fifo_size =3D ch->bytes); - - /* Implement as transfer_fifo2linear + transfer_linear2fifo. */ - ch->io_fn[0](ch->io_opaque[0], fifo_buf, ch->bytes); - ch->io_fn[1](ch->io_opaque[1], fifo_buf, ch->bytes); -} - struct dma_s { struct soc_dma_s soc; int chnum; @@ -67,11 +40,6 @@ struct dma_s { enum soc_dma_port_type type; hwaddr addr; union { - struct { - void *opaque; - soc_dma_io_t fn; - int out; - } fifo; struct { void *base; size_t size; @@ -129,20 +97,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_= type( struct dma_s *dma =3D (struct dma_s *) ch->dma; struct memmap_entry_s *entry =3D soc_dma_lookup(dma, ch->vaddr[port]); =20 - if (entry->type =3D=3D soc_dma_port_fifo) { - while (entry < dma->memmap + dma->memmap_size && - entry->u.fifo.out !=3D port) - entry ++; - if (entry->addr !=3D ch->vaddr[port] || entry->u.fifo.out !=3D por= t) - return soc_dma_port_other; - - if (ch->type[port] !=3D soc_dma_access_const) - return soc_dma_port_other; - - ch->io_fn[port] =3D entry->u.fifo.fn; - ch->io_opaque[port] =3D entry->u.fifo.opaque; - return soc_dma_port_fifo; - } else if (entry->type =3D=3D soc_dma_port_mem) { + if (entry->type =3D=3D soc_dma_port_mem) { if (entry->addr > ch->vaddr[port] || entry->addr + entry->u.mem.size <=3D ch->vaddr[por= t]) return soc_dma_port_other; @@ -173,15 +128,8 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch) } dst =3D soc_dma_ch_update_type(ch, 1); =20 - /* TODO: use src and dst as array indices. */ if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_mem) ch->transfer_fn =3D transfer_mem2mem; - else if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_fifo) - ch->transfer_fn =3D transfer_mem2fifo; - else if (src =3D=3D soc_dma_port_fifo && dst =3D=3D soc_dma_port_mem) - ch->transfer_fn =3D transfer_fifo2mem; - else if (src =3D=3D soc_dma_port_fifo && dst =3D=3D soc_dma_port_fifo) - ch->transfer_fn =3D transfer_fifo2fifo; else ch->transfer_fn =3D ch->dma->transfer_fn; =20 @@ -251,61 +199,10 @@ struct soc_dma_s *soc_dma_init(int n) } =20 soc_dma_reset(&s->soc); - fifo_size =3D 0; =20 return &s->soc; } =20 -void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwaddr virt_base, - soc_dma_io_t fn, void *opaque, int out) -{ - struct memmap_entry_s *entry; - struct dma_s *dma =3D (struct dma_s *) soc; - - dma->memmap =3D g_realloc(dma->memmap, sizeof(*entry) * - (dma->memmap_size + 1)); - entry =3D soc_dma_lookup(dma, virt_base); - - if (dma->memmap_size) { - if (entry->type =3D=3D soc_dma_port_mem) { - if (entry->addr <=3D virt_base && - entry->addr + entry->u.mem.size > virt_base) { - error_report("%s: FIFO at %"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64, __func__, - virt_base, entry->addr, - (entry->addr + entry->u.mem.size)); - exit(-1); - } - - if (entry->addr <=3D virt_base) - entry ++; - } else - while (entry < dma->memmap + dma->memmap_size && - entry->addr <=3D virt_base) { - if (entry->addr =3D=3D virt_base && entry->u.fifo.out =3D= =3D out) { - error_report("%s: FIFO at %"PRIx64 - " collides FIFO at %"PRIx64, - __func__, virt_base, entry->addr); - exit(-1); - } - - entry ++; - } - - memmove(entry + 1, entry, - (uint8_t *) (dma->memmap + dma->memmap_size ++) - - (uint8_t *) entry); - } else - dma->memmap_size ++; - - entry->addr =3D virt_base; - entry->type =3D soc_dma_port_fifo; - entry->u.fifo.fn =3D fn; - entry->u.fifo.opaque =3D opaque; - entry->u.fifo.out =3D out; -} - void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, hwaddr virt_base, size_t size) { diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index bcdb91425a..e1d75bb3ba 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -25,12 +25,10 @@ =20 struct soc_dma_s; struct soc_dma_ch_s; -typedef void (*soc_dma_io_t)(void *opaque, uint8_t *buf, int len); typedef void (*soc_dma_transfer_t)(struct soc_dma_ch_s *ch); =20 enum soc_dma_port_type { soc_dma_port_mem, - soc_dma_port_fifo, soc_dma_port_other, }; =20 @@ -57,8 +55,6 @@ struct soc_dma_ch_s { hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ /* Private */ void *paddr[2]; - soc_dma_io_t io_fn[2]; - void *io_opaque[2]; =20 int running; soc_dma_transfer_t transfer_fn; @@ -82,33 +78,21 @@ struct soc_dma_s { =20 /* Call to activate or stop a DMA channel. */ void soc_dma_set_request(struct soc_dma_ch_s *ch, int level); -/* Call after every write to one of the following fields and before +/* + * Call after every write to one of the following fields and before * calling soc_dma_set_request(ch, 1): * ch->type[0...1], * ch->vaddr[0...1], * ch->paddr[0...1], - * or after a soc_dma_port_add_fifo() or soc_dma_port_add_mem(). */ + * or after a soc_dma_port_add_mem(). + */ void soc_dma_ch_update(struct soc_dma_ch_s *ch); =20 /* The SoC should call this when the DMA module is being reset. */ void soc_dma_reset(struct soc_dma_s *s); struct soc_dma_s *soc_dma_init(int n); =20 -void soc_dma_port_add_fifo(struct soc_dma_s *dma, hwaddr virt_base, - soc_dma_io_t fn, void *opaque, int out); void soc_dma_port_add_mem(struct soc_dma_s *dma, uint8_t *phys_base, hwaddr virt_base, size_t size); =20 -static inline void soc_dma_port_add_fifo_in(struct soc_dma_s *dma, - hwaddr virt_base, soc_dma_io_t fn, void *opaque) -{ - return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 0); -} - -static inline void soc_dma_port_add_fifo_out(struct soc_dma_s *dma, - hwaddr virt_base, soc_dma_io_t fn, void *opaque) -{ - return soc_dma_port_add_fifo(dma, virt_base, fn, opaque, 1); -} - #endif --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681180; cv=none; d=zohomail.com; s=zohoarc; b=bXrcDefCqVnMcxfGgI+TwUOw7RSLdc/GMj67DV+KnuIWNoudIkxH4DoA0s9VmgkzmcRBBfyJp/nWJU0NmhnsLwq9iR61qpiinmFpMnjFCY85fyTfYdZaVKsl7tQLZrfU3ka/cIEk0ClDeJJSCiwEa2qXjI1N6G+R07YfVjRPAAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681180; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q3wpaFTLm6nOZdl3we8uo+58Jj19P/ToBCyD+56rgIM=; b=I9am7zdWcEQy5arVsqa7cM0TRGc8x4hjDuvRxBCUwbaskx0Ea0dXUCal6iM8ZVSvpdk5ySUN9t7ZeTzkBe7u3Q2gXOLVLQDr4+PQRMtLpcggQlq0ZjIZ9Az4UbchvxPAdhqsJ8lnE0qZ2/eL92NApn/wbm0VQNZdxyr+Sgt0CgM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681180830421.4404902766636; Fri, 10 Jul 2026 03:59:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8wz-0006VP-W6; Fri, 10 Jul 2026 06:59:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8ws-0006Rz-Gb for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:14 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wq-0001NW-QQ for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:14 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-493ec555a26so5428175e9.0 for ; Fri, 10 Jul 2026 03:59:12 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681151; x=1784285951; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Q3wpaFTLm6nOZdl3we8uo+58Jj19P/ToBCyD+56rgIM=; b=tEGdPw49XGQpn4yyFflndaJN1jJX1/Nsht7F9N9m+76JsH7z8uWWLEkJUHpvz1sA9y B/t+BawlrksBtuHfm3n8dEdE3oUXrn8ys5ADQQW7jNiLNeYylfq1PRdDYvgoftcYuf8O S70RkUuZNXMVGOEiq260Zcg3TCz7TyqFHeoonSGThAbvSZQiRUIZlXNVuigOX3DBoj6b U+cjY1g+526qxTjG+7pUoZZqrrpiU0lG5GSr2Pb41/pO8KBReROSupQZ2H9z7XHT7rm+ FrX5EKVeXbmReXRYHTqaVin6g6LD8/44YyJUkOZiv71KU8nmjvODSVGqDg7wXmX6KT18 JWsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681151; x=1784285951; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Q3wpaFTLm6nOZdl3we8uo+58Jj19P/ToBCyD+56rgIM=; b=ODsqCz4/qS6JsxFL6DNnkrAiWl7bol6WNd6ol/e6W7UQR+/rRDm+W4zJ+XICv71hUV ZezxP4RuzuAQR+cExRQA4+3Zh1iV+7AY2c/P8MrPEekEJ4dkBvQ/i0OhMmVab1BDhIPW owmRPFOm4hAwVB438oQp6rAEEwuESkVtooGmsoUeQjR62O1sFwUAcnDLoRibUl3tbZae aDGJcaoA5kBODGjitGXsBHfPQuL+JSQWl1mlY/VygZE43nZwQRTnfmpLkc6STbJ7To2w t2MxLaXSC5ya0lBwX1rcG0OHMylRD1W+WclBLr4zrZGSCcmdpBom1JmZk6kD9p6ahAOq czCw== X-Forwarded-Encrypted: i=1; AHgh+RrGTfyt1YlLW0+YCVcViAZaWGsBPEnswDCR8mfT/ZG4+ba3R+VrYV9qLxNjuPLYyzhlnDpO5HdeUpcD@nongnu.org X-Gm-Message-State: AOJu0Yyczw6ZYc20Ey1zuwe55SXwYzkmzF5NsVv6Owo0OL+m9eWZkuAe zzmW9sXeD8ZuAn3xbJSIrGmxxe3zmEJk2q7ditG0a36OOLUD6UX2O+i2BwrAVNqp4qQ= X-Gm-Gg: AfdE7cmh0YHs0D8J+aX0JUrHfYsXbR5KTKi9AyV58EWGRERakKPBF/UAmDLyYfjgiBB CPGy6xdd/8VXV2YLdUYqLdpyBHTYY8ldFMxM9Z0K9f62wqF+8A97Z2Ilw63W8SHn4e3scyNCdEs ECFTbgv9flDPZN03m1/XAWIxBp7G6IlzDzu1NZUEjmfRJFm9Sdw19PZct++EQMZ5k3MrhB1GcuR GU6UqLgiKsr1nuVeVkBE9gg1pEcyTYGtopLUk+KCqLITyHQ8aXqkgf2mLoCatBE5n2Ddv6290yU xBagDOhXVerKOjK7RyXwIGUTWyIB96bOufr270jBYArfA3VyBwTxa1UbodyfBrU9Z3RFVrlNnTQ 21Dg2xr6xrxdErwQ7AJW/K1zC3jRbS8ZGRuYjxziHfjrzj2x7xT4R73YKae4z6+le/Vv42y07Bo c1hasbr4cjTKQ8LqPrgIW5121Ic1MguMiE/lSCN1Urb7uUCktwG8suUXP5qVPp50qRDSTvLW2c5 UXROLlvLeRtqC8uMa92AQ== X-Received: by 2002:a05:600c:3e0c:b0:493:c548:87fb with SMTP id 5b1f17b1804b1-493f536ceb3mr17085525e9.36.1783681150936; Fri, 10 Jul 2026 03:59:10 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 2/9] hw/dma/soc_dma: Simplify soc_dma_ch_update() Date: Fri, 10 Jul 2026 11:59:00 +0100 Message-ID: <20260710105907.2570621-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681181610158500 Content-Type: text/plain; charset="utf-8" Now we only have "mem" and "other" as soc_dma_port_type values, we can simplify soc_dma_ch_update(): either both src and dst are mem, in which case we use transfer_mem2mem and set update to 1 to tell omap_dma_transfer_setup() to update all the guest-visible src/dest/count information to indicate a completed transfer; or else we use the omap_dma_transfer_generic() function, and we set update to 0 to tell omap_dma_transfer_setup() that the transfer function will be updating the src/dest/count. Signed-off-by: Peter Maydell --- hw/dma/soc_dma.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 8ba531feea..ff51338388 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -121,19 +121,14 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch) enum soc_dma_port_type src, dst; =20 src =3D soc_dma_ch_update_type(ch, 0); - if (src =3D=3D soc_dma_port_other) { + dst =3D soc_dma_ch_update_type(ch, 1); + if (src =3D=3D soc_dma_port_other || dst =3D=3D soc_dma_port_other) { ch->update =3D 0; ch->transfer_fn =3D ch->dma->transfer_fn; - return; - } - dst =3D soc_dma_ch_update_type(ch, 1); - - if (src =3D=3D soc_dma_port_mem && dst =3D=3D soc_dma_port_mem) + } else { + ch->update =3D 1; ch->transfer_fn =3D transfer_mem2mem; - else - ch->transfer_fn =3D ch->dma->transfer_fn; - - ch->update =3D (dst !=3D soc_dma_port_other); + } } =20 static void soc_dma_ch_freq_update(struct dma_s *s) --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681180; cv=none; d=zohomail.com; s=zohoarc; b=n3uW2TfGfPXlGYAc+JeaVQ3jdrDIRBZnaWvkQjVylFmxvz1UxoM68c9Dclh/5QuKKcLmn4Q9FJlxi9mQ/inaOQyFa2ifBVchYZYxxg0FMAULy2jGfHRP/m0b3JVnO+D5Pl60U/reWIcKHt93X9PygS6OAeOfsCLUkUYVjyo9ezY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681180; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nAPCdwrWWBDYxeA6TQlHH2OHF4Kfqc3umJBBZYyOgHU=; b=SyPBEZ61UIOciicREoGRWhYUO+Ng1simE8YQI0MymV/gY0XeOqqZgninZ6xvXBvrM9OZWrS/Tlw7ZWn31yNqcopru6/A3PUE4ZNPvrkADRoARXTx9+HmwnIPKfbMxpPjb2XW25WTiDgbPOqUInbREsUMS9IRfptzrYrc2Modswc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681180796232.9623181603597; Fri, 10 Jul 2026 03:59:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x0-0006Xs-N8; Fri, 10 Jul 2026 06:59:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wt-0006Sp-Di for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:15 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wr-0001Nr-Ov for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:15 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so5104815e9.1 for ; Fri, 10 Jul 2026 03:59:13 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681152; x=1784285952; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nAPCdwrWWBDYxeA6TQlHH2OHF4Kfqc3umJBBZYyOgHU=; b=nSa4UfoNF511HvnuoRJEZByq2KMP2fCP9MhbHursags4O3Wc8B8uNWFtCYjUEsK2nv 8t7/snIdWyhmpjTstP8KCwXhXrPZ8/wT510LRGmvuUQPbFqGqX5sT8bx1XjTrelHUlxp daNnfKQP3bivQ3+LMQx/PAi9F85wirGZ7Ta/5mBhXjZpWMv0X5rMLTIOcgK6tU3Fm/G9 U36mwLlK9f50Jom82fwDkLpjQwm1JUFO2OB5nQyv0WAK0cM8RufpAiu1KPlTYIcJo2l7 iJ1Wj+fttkc+WsWjiLAJ+ZS6PrP8NvdkuHRZc+4CIIKgG1hZJzZvKfGs1a8rrrwNAm9V 3hXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681152; x=1784285952; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=nAPCdwrWWBDYxeA6TQlHH2OHF4Kfqc3umJBBZYyOgHU=; b=JL4F4IZlnUU2XusjxXo16ZLzDrLythS/mE8pu+QoISklFLYQvXxsct15La0G0ILKnF QoGwNn13cam6iF37VvRMC6O+NBCkMJR9U6KhOlWqvlxiNBobPTy77FIcovqz9Qw7mb9o XILj6PSfEBuo8wipOvv8V7gUZ0MYSXLFe/JnS699VHZEwAF6YPuQbgjGwDvTY05CS0cG 75y1vuRSuv3x1LqZrTtG6sID35Fn4tYKPp2qtbJHhzh1hGDmv/5B/DHPCMEzKPWA2q6k vbLqgYRCR9Dm13F3DlBE4eEDW/JDvCGK82AVgfhDEdnGIpTNYREPg05+BUEuMh317Dr/ MC7g== X-Forwarded-Encrypted: i=1; AHgh+Roa0XddiVzkLasJ54oDgPSwrWGlUT+qH2t4FRpIa+EjCxwQDOzcWpMSsUq3PVtkKrTVBkjEHvuUWXLD@nongnu.org X-Gm-Message-State: AOJu0Yw5iaNV34457vxBRklzmcVlN9pBuAw8+uidgJ+rrHpSnFNSU6u1 BLsEjsbMEcv0889qpJs7bSVgJXRpLx5NQ6UXfxfMs61Jmo6mou1PqldjWN4rVVOehE0= X-Gm-Gg: AfdE7cmpc7pORWPlJ8lUCHF3xCJ7OwG8j5/7thBx0S1bdLczJiy9v3sOcpEaIhU+qXF x/g21c92DeNj02/QZtKOK8T7hLZ4slV9NkUP/Evx6flHxSvaM7qhQsep33vhc7hO5WQfed27M5g H+txfj4/w5N6yfPcD2mu8yy6cw982YuUhf/JBZ2hTCx7CRtnz0G+yV6NlyzZmzqv6DKSOvSKWc3 S/rdD1WOSMgNbyPNKPm7sqmsw4/uaOOLW+q5d4QWndOK+pnUs4Cxr4fwodH6ARgmCeoecIx3jQ1 vz2ddGU/yy1A/ZziMjYiH2S8ChLrxK44tYnYAsPGEfIwrF/Xug+/9suOitsl1zhv74K2+7veSLN 6W+XJ7C6mFtZAzX3T5qLTZz3OFTkvrgYfRX+THCji1j2PA3QUerf2v+6FLINjU9cOaI62FDr1Fw 3MrgO2G/i1pKV+oLHs/X1iVawbdwGfjb90dNa3fOitGn8udfMqVJYSWEsiQZ2f5Q67SV5N+K9xG gxMviT8HTB8eMKV86TfNg== X-Received: by 2002:a05:600c:630c:b0:492:53e8:3bc1 with SMTP id 5b1f17b1804b1-493e6a4a615mr100164985e9.17.1783681152404; Fri, 10 Jul 2026 03:59:12 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 3/9] hw/dma/soc_dma: Remove union from memmap_entry_s struct Date: Fri, 10 Jul 2026 11:59:01 +0100 Message-ID: <20260710105907.2570621-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681181618158500 Content-Type: text/plain; charset="utf-8" There's only one field in the union inside memmap_entry_s now that we've removed the soc_dma_port_fifo handling. Simplify by removing the union. Signed-off-by: Peter Maydell --- hw/dma/soc_dma.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index ff51338388..bbcd2bdcd5 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -39,12 +39,10 @@ struct dma_s { struct memmap_entry_s { enum soc_dma_port_type type; hwaddr addr; - union { - struct { - void *base; - size_t size; - } mem; - } u; + struct { + void *base; + size_t size; + } mem; } *memmap; int memmap_size; =20 @@ -99,7 +97,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_ty= pe( =20 if (entry->type =3D=3D soc_dma_port_mem) { if (entry->addr > ch->vaddr[port] || - entry->addr + entry->u.mem.size <=3D ch->vaddr[por= t]) + entry->addr + entry->mem.size <=3D ch->vaddr[port]) return soc_dma_port_other; =20 /* TODO: support constant memory address for source port as used f= or @@ -107,7 +105,7 @@ static inline enum soc_dma_port_type soc_dma_ch_update_= type( if (ch->type[port] !=3D soc_dma_access_const) return soc_dma_port_other; =20 - ch->paddr[port] =3D (uint8_t *) entry->u.mem.base + + ch->paddr[port] =3D (uint8_t *) entry->mem.base + (ch->vaddr[port] - entry->addr); /* TODO: save bytes left to the end of the mapping somewhere so we * can check we're not reading beyond it. */ @@ -212,12 +210,12 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint= 8_t *phys_base, if (entry->type =3D=3D soc_dma_port_mem) { if ((entry->addr >=3D virt_base && entry->addr < virt_base + s= ize) || (entry->addr <=3D virt_base && - entry->addr + entry->u.mem.size > virt_base))= { + entry->addr + entry->mem.size > virt_base)) { error_report("%s: RAM at %"PRIx64 "-%"PRIx64 " collides with RAM region at %"PRIx64 "-%"PRIx64, __func__, virt_base, virt_base + size, - entry->addr, entry->addr + entry->u.mem.size); + entry->addr, entry->addr + entry->mem.size); exit(-1); } =20 @@ -246,8 +244,8 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_= t *phys_base, =20 entry->addr =3D virt_base; entry->type =3D soc_dma_port_mem; - entry->u.mem.base =3D phys_base; - entry->u.mem.size =3D size; + entry->mem.base =3D phys_base; + entry->mem.size =3D size; } =20 /* TODO: port removal for ports like PCMCIA memory */ --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681290; cv=none; d=zohomail.com; s=zohoarc; b=YR5rD9GJPifQ12bO8+UiX0pFupMxOkgdLD1PjMGmTGKd636TktA/wGAdTfackiCeHqJVQp/VPRaw1PzYQwgrz8DUgW/1LvoLPqVnX7X0FYiAPDUwNS8JREDYgGf87nnC0exExEjWzcZboRgETyelMrnTh3WeyObr0K60EgxspHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681290; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/ucYtSuy5GlYosuT4raxReezYE6ZXB4/gAcNEyJFOq4=; b=d2ZvsBNXd5AEbAEHYSmYa5gfYID4xR56ItYVYe35Kk+cO1FD+rEL73U+bahD07QNajHPN89DZErKV61xYqlrJiG1wSU1p8ltsudT0/IUF75xzYaMaHuZk2QmeOiidpeLHHV6BbzN7p+AXne1J6z33uY0NRvMqGDcsIqBxYm4x1k= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681290803346.11097419141333; Fri, 10 Jul 2026 04:01:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x1-0006Z5-5D; Fri, 10 Jul 2026 06:59:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wu-0006Sr-Fn for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:18 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8ws-0001OH-Nd for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:16 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-493f60208a5so2683875e9.3 for ; Fri, 10 Jul 2026 03:59:14 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681153; x=1784285953; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/ucYtSuy5GlYosuT4raxReezYE6ZXB4/gAcNEyJFOq4=; b=FX9UWjwjtf32+IdYg/UGroqy4kfKmE1zsqgVXF8x7bXH8FJH7pYdPPh+gaKFTy1UJh r3ag3X4xWUOfjg/cjsbxys7jq/xrR0FmI4HORdPfSsDdBgkqLrLABm+MPno6hzBccs3t WmeZp6B8bhaNWJHkWk2vIVn1ybfjAQjZPPkoQUUUYKNBH00wrmIZVawYDFSq1kL0dZXD mWn5CLChINbkcfAGX0rAS2icZwkbncizG8JzD7SQGWNs4a9bxlyjqAhiYBiM8puA9W6j 2ANCoGScncUfK80yv1rKvo3PzIlz11SBcwyUtGGJkANAmE9zapXq6zvTpuPEbDAFA4D/ gBPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681153; x=1784285953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/ucYtSuy5GlYosuT4raxReezYE6ZXB4/gAcNEyJFOq4=; b=nu+EivKWZSW8YYOYXSl3rHeKGi7BdMUNtkVuFkbUVgcQlIkSNU3NyDbRhP2HJqOpO5 V9XyX60OC0wNzk4HD41nerb+HW6uPsFQTb/ocwE1Qc6tplMWRkMc/kl7zjeDNv9dCCZR 4ZJ/vTTGhxxxQNSkbUj2DrJ7BfArilVU8a8CEcia7KFqQ8nIrftTya2oytdJEt0P8os4 jWoQbca0rAXHAvNUKDIUfTxUCBBRHNklh1TOCAcrqF4oQ2uaJKGJsNBbCH0cg161t/zu lGSALQ6rTozanETur471jFuHPXpfnNXfvYybcGtyDK0F8haFiJJLh6UJM4kAane/8BE3 7K0g== X-Forwarded-Encrypted: i=1; AHgh+RpKMxcqLbV5KdUjyCxO7RONZ2l0LCmUNK1YLIW2UoALoMRyQnzdHhte1lXNqRP8yV/iKBYUyF6pn3VY@nongnu.org X-Gm-Message-State: AOJu0YxErSeJMorSnGJ+mzus3z+v3LLPoVaJ5rkyRRiyyQYQtNVGepZ8 qjN+wAfRPT8ms993JwI0yRRpGQEmYSog501RGpR6m+CR2xWm2qTnPI2RD2rLY0KVh68= X-Gm-Gg: AfdE7cnqIyukUe2EWBfaM4+nCam2kTyuhMMob02sWTL8qB5CSkdOQBMrPXZnxDag2LK W0e2e89pQuqqn09P3Oh+qRo2XOmq2dt0R1GHRSbV8OUnK/A7mLger1qENjcE7L/qEq7WBe9AveS 2ipTi9l6HLDOIGtugmCpCy1Qao3DLsrlbzuFBov9Shx3vagV4hPxHF2l2JgtVYu1TltuI8AeOUn Cok7PKLVEJYKUk1TMR8eF+oc5SNrEve0oKRZ4wykH9eWg5fsbCJmLNcamkncFeJuhWJ+WUXrtww gRkViFDUKWtIY3lXicOHbR30r/UdhpYm7qL8mqA5Pg4k59zvnCa0kBMR+jfwKH9HhvsIRte22Y0 dV6qlDfQhEQwCegKBiGCc8RMjG9EbUYfjr1fLBKey43O4kemoDgMF1x885JvlZTHgTeXU44oajb RO3d1pKezNzJqs27qR30zcDXKlc+nBrDaZy/W4Vnq1F+wMX+18g/yQElhqu0Uc+HSys6I2zrmw/ JUd3tnEa6k6oCZwcIKceA== X-Received: by 2002:a05:600c:8215:b0:493:f278:ba2f with SMTP id 5b1f17b1804b1-493f278c63fmr34038605e9.9.1783681153335; Fri, 10 Jul 2026 03:59:13 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 4/9] hw/dma/omap_dma: Be more careful about overflow in transfer setup Date: Fri, 10 Jul 2026 11:59:02 +0100 Message-ID: <20260710105907.2570621-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681292592158501 Content-Type: text/plain; charset="utf-8" In omap_dma_transfer_setup(), the maximum number of elements we can transfer is 0xffff * 0xffff =3D=3D 0xfffe0001 (because the max frame count and max elements per frame are both 65535). However, we store total element counts in 'int' variables, and use INT_MAX as a "bigger than any valid value" sentinel, and when performing arithmetic with the total count of transferred elements we are not careful about avoiding overflows. Fix these: - use uint32_t rather than int for the local variables tracking various element and frame counts - use UINT_MAX as our sentinel - calculate new packet, element and frame counter values using arithmetic on a local uint32_t, rather than doing it in-place on local variables that are only 'int' because the actual counter registers are 16 bits - use 64-bit arithmetic when calculating how much to advance the source and dest pointers and the total dma->bytes transferred Note that since soc_dma_ch_s::bytes is only 'int' this can still overflow; we'll fix that in a subsequent patch. Signed-off-by: Peter Maydell --- hw/dma/omap_dma.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 77f1441498..14b310bf40 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -391,7 +391,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) struct omap_dma_reg_set_s *a; struct omap_dma_channel_s *ch =3D dma->opaque; struct omap_dma_s *s =3D dma->dma->opaque; - int frames, min_elems, elements[__omap_dma_intr_last]; + uint32_t frames, min_elems, elements[__omap_dma_intr_last]; =20 a =3D &ch->active_set; =20 @@ -403,7 +403,14 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_= s *dma) __func__, dma->num); } =20 - min_elems =3D INT_MAX; + /* + * The maximum frame count and maximum element count are both 0xffff, + * so our worst case possible number of elements to transfer is + * 0xffff * 0xffff =3D=3D 0xfffe0001. We can therefore keep element + * counts in a uint32_t and use UINT_MAX as a sentinel value for + * "not set" / "condition does not occur". + */ + min_elems =3D UINT_MAX; =20 /* Check all the conditions that terminate the transfer starting * with those that can occur the soonest. */ @@ -413,7 +420,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) if (elements[id] < min_elems) \ min_elems =3D elements[id]; \ } else \ - elements[id] =3D INT_MAX; + elements[id] =3D UINT_MAX; =20 /* Elements */ INTR_CHECK( @@ -465,7 +472,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) (a->frames - a->frame - 1) * a->elements + (a->elements - a->element)) =20 - dma->bytes =3D min_elems * ch->data_type; + dma->bytes =3D (uint64_t)min_elems * ch->data_type; =20 /* Set appropriate interrupts and/or deactivate channels */ =20 @@ -528,8 +535,9 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s= *dma) =20 /* Update packet number */ if (ch->fs && ch->bs) { - a->pck_element +=3D min_elems; - a->pck_element %=3D a->pck_elements; + /* Can't overflow: worst case min_elems 0xFFFE0001 + element 0xFFF= F */ + uint32_t new_pck_element =3D a->pck_element + min_elems; + a->pck_element =3D new_pck_element % a->pck_elements; } =20 /* @@ -537,13 +545,15 @@ static void omap_dma_transfer_setup(struct soc_dma_ch= _s *dma) * can skip part of this. */ if (dma->update) { + /* Can't overflow: worst case min_elems 0xFFFE0001 + element 0xFFF= F */ + uint32_t new_element =3D a->element + min_elems; a->element +=3D min_elems; =20 - frames =3D a->element / a->elements; - a->element =3D a->element % a->elements; + frames =3D new_element / a->elements; + a->element =3D new_element % a->elements; a->frame +=3D frames; - a->src +=3D min_elems * a->elem_delta[0] + frames * a->frame_delta= [0]; - a->dest +=3D min_elems * a->elem_delta[1] + frames * a->frame_delt= a[1]; + a->src +=3D (uint64_t)min_elems * a->elem_delta[0] + frames * a->f= rame_delta[0]; + a->dest +=3D (uint64_t)min_elems * a->elem_delta[1] + frames * a->= frame_delta[1]; =20 /* If the channel is async, update cpc */ if (!ch->sync && frames) { --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681263; cv=none; d=zohomail.com; s=zohoarc; b=O0Y7g7hL7+G7vyFq7wC1TvNrIbjkYeL9VW7u/NAiyAitGIdnTYDH9SbxFn+AS9d82/MAjiyhPJ8CTB1QzVx8rkKOwVXOychxl+j+BPJrzJtfjnfK4IxxBkoecLaHQfev2op8ggFxBQ0peuRoDcFx88zdJdXNh9fcEMnNCfMs4IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681263; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=q4Zq1gOCVbComkFhvXEvZvtbK0wUtEYI9Jqh3pC5jWQ=; b=Zk924NajxnIou/RPnwliggHTak8p+Obbq9gz1FUO0Ca8qS8b7+FoAbkNhq1qIpr57+W4s4VEHtEouBHCAxw7lDS+lSXtpPruoApe3AAmp3QOStMtIv7ACuAE9IXzmtBojnhIaFvT4nvmboOXtUKnF5v0I2aVRf9NmjX9wGCeuhc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681263026122.08178639111657; Fri, 10 Jul 2026 04:01:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x2-0006ai-RR; Fri, 10 Jul 2026 06:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wv-0006Sw-I9 for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:18 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wt-0001Oh-OZ for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:17 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-493f45e20cdso3207375e9.2 for ; Fri, 10 Jul 2026 03:59:15 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681154; x=1784285954; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=q4Zq1gOCVbComkFhvXEvZvtbK0wUtEYI9Jqh3pC5jWQ=; b=QwJyHb0L7Nu2UOj+4YxK6WRBgwf7LzPUVqNAZA+zGunmluv1sFVOQav4f0vmgHeypg X0KAyIUopQfv6lYBc/cTBJ3ZdAVyYXS0+uXZKfZ98lQyke5GSMN4VvjQVm1JFstunwGw qGuu9tLHByC093OFF5MyzEUiJ4/8zDpV15SJl3jnmmUIF+qcmbYyaUClQi4d3Y/aLzWN bsKppw6xB/KCbuMz5Z2Eavi6JNShX2zPRgs7n7EJLbfuR6ODGlcMvwE62ZGvdnZwUIf3 CayUSsilo17g3gWdbJvWuu8id61gG9Ff/lSe7HCtrVX4voOm604eD4PT5DOAHOnhWMxV Czvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681154; x=1784285954; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=q4Zq1gOCVbComkFhvXEvZvtbK0wUtEYI9Jqh3pC5jWQ=; b=ZWGs1H3hcZPGx+ul/hBf0l7encGZlnzopxk4Wu5o7QsyStKMdRCHLHT94vKmhJfAjc 0dvPjZSaIyJSzlCJ2TOl+8IObEvAmZ3AmsV21SwCglUTCRidQ6IeZ7ahOdMvsU9lX4Y9 joyl7dQ3Am4buBqtu2XWoJ0rhqvIljCW1QcqhfqgbzeFgLE314q8mQuRKnMGBzoCA8V7 M3+YOq5cV1pJiO74+ZpYHt/vOcT5Vzpx45RgdMLiWk+jXIrB6/JTGWcGHFSQA6tYJ9qg PQvgN/kbxqlXGtsAWwruqKDU1OsuFiiI6/RVBIJI4OPpaoYdvvg3uiG8P24qDfiCpd8S hDBA== X-Forwarded-Encrypted: i=1; AHgh+RrXrdhoPu3pVJADN2ClfnZoNssujwf0wKeZKea5GfWKUK/oeQTKRVHpttcdgPY1mZFR7oiz/8N9+m1I@nongnu.org X-Gm-Message-State: AOJu0Yy0cseGXYbvNXlTOlocYGlQLdKm9tbkN0uOeoq7GUE7jMWRpItG vlz5dtyI+nltZ2itKuJWGaU4RBwBunghFau0xl9UwR6mpESZY4dQ4gRL12bCGv9lWMkE0IqZG5e 68S9jWG3FkQ== X-Gm-Gg: AfdE7clBbzv5eZ93QUygHSYUAzrXT0HVXc1VGQfo4aTvbiyuDE4/wmaVUSuJ909GJIW QR9fCYFscxr2LGaVnkfmMqoziBessmH0Il97T7JbZlJcigVqerr3azFnfZDkzVohKVx7Ixgt5ct 3wJ4I1Yf2qorbVEuwu6BU3Nc8/InaUReLV9HtnGKoudj4AQeGfUAS3f08gyQhuyD5/Y8ZpMPXsz 1qq0OH6l4d2V3udZv4U2bCBAvV2WUNAbmJu1Soy6+5Q/3SLvzU23NeubBWL6IdzEOnmdqdoBlbL C5rJ5VIk95bodnuDojIgrXcWObFaArFMGgPy3Qdn95VKsOtiwO47wCUcxbkqVfvXp2/OwVIXMRF F3fyC8Q4OxVBpfeNdeluwj4bOfGz281fmi8AYMHupjDbxFopS0A7cxF5HQID2+ULuD2gZKwYLph bbFjLV03V19m0j3939fSYO4NtS4prbnscUEEUdoM7GNNcV1RRupPo5yIVy1b/hJE8d1ZDOpOyTf VDsCCj+RXbQ8mQIK5nR4g== X-Received: by 2002:a05:600c:8284:b0:493:b243:8ffc with SMTP id 5b1f17b1804b1-493e68ec789mr111497745e9.35.1783681154261; Fri, 10 Jul 2026 03:59:14 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 5/9] hw/dma/soc_dma: dma bytes is uint64_t Date: Fri, 10 Jul 2026 11:59:03 +0100 Message-ID: <20260710105907.2570621-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.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, 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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681264428158500 Content-Type: text/plain; charset="utf-8" The worst case number of DMA bytes that omap_dma will ask us to transfer is 0xffff * 0xffff * 4 =3D=3D 0x3fff80004, which is slightly larger than fits into a uint32_t. Move the byte count to uint64_t, and adjust code that passes it around to also use uint64_t. Signed-off-by: Peter Maydell --- hw/dma/soc_dma.c | 6 +++++- include/hw/arm/soc_dma.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index bbcd2bdcd5..1b93aaf565 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -49,11 +49,15 @@ struct dma_s { struct soc_dma_ch_s ch[]; }; =20 -static void soc_dma_ch_schedule(struct soc_dma_ch_s *ch, int delay_bytes) +static void soc_dma_ch_schedule(struct soc_dma_ch_s *ch, uint64_t delay_by= tes) { int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); struct dma_s *dma =3D (struct dma_s *) ch->dma; =20 + /* + * Worst case delay bytes is only slightly larger than fits into + * a 32-bit integer, so this won't overflow. + */ timer_mod(ch->timer, now + delay_bytes / dma->channel_freq); } =20 diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index e1d75bb3ba..b5ad9743be 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -49,7 +49,7 @@ struct soc_dma_ch_s { int update; =20 /* This should be set by dma->setup_fn(). */ - int bytes; + uint64_t bytes; /* Initialised by the DMA module, call soc_dma_ch_update after writing= . */ enum soc_dma_access_type type[2]; hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681262; cv=none; d=zohomail.com; s=zohoarc; b=YfVzu6xkh+b4Rl6VayiFcf3X9emTewRZhOtLMJMndmmpbNnRJbqAbDLlHOVFqJEbQNK/RncO6EfVWQPSfqwXKstwiHwVB/dP0JLUhsinTX4YAZqxbFKo9LfYtPmFe0023lW+w1U+DQdxcMjgGW9eS9rwXiMaqsygTBlE3EpXEjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681262; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TwtMnO8OPUvmvUO/Mqi1pAdDOfN8vKq344KVKqtA96Y=; b=eA8oY3Rlap4Ag85PIRIYjBJMGkq/xlk0p4vDVd5g2KZ99voOa7v9dhtgV8Kn0ZnS7Ht2a/6/vEY1U3HQO7JpIYsjT1u4EzKFRGZ0tB1TG9sEoYtlAdK2Fm1ysi/KBkqFmqVazc4ZIVry9w5xmeYC6tgsh7Vk8igXlQN+GYX5eUI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681262793769.7389058937989; Fri, 10 Jul 2026 04:01:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x3-0006ax-1E; Fri, 10 Jul 2026 06:59:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8ww-0006T0-Mi for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:18 -0400 Received: from mail-wm2-x01.google.com ([2a00:1450:4864:31::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wu-0001P7-Qu for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:18 -0400 Received: by mail-wm2-x01.google.com with SMTP id 5b1f17b1804b1-493b567a019so6189225e9.1 for ; Fri, 10 Jul 2026 03:59:16 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681155; x=1784285955; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TwtMnO8OPUvmvUO/Mqi1pAdDOfN8vKq344KVKqtA96Y=; b=uApEtj/al8Mp9tWlqegjtZ8pnI1DRkQtt0gZBhkD4ay3zLtVPUcEw4Ao5CEA4b5Xdf hatN25FSRz5tS2JyHQWn1vJV+Bb+MU4ur3ROV6ag3bQ6ftiRrEr0vhNIYc++SSXCiab0 GdT/2mNsXsaVMNdl0IFVM+hIBih6RCNLg1QyBTRdAJSwKkeNUnFF9fqXxGGTx8H+CZxK QDS0p2gDSxWUtr3+77dHEkNOa/TC1Xdu+FvfqtRSWHqzG1PSJTIuGo/yHDAOFJwhRn/G dBgs7GH8Xk/boaOJ5TsrafVbbI0kfsBAM3hgw0J72+xAwUyWDwMM/rRQNfiuFuEG0cfb ITLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681155; x=1784285955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=TwtMnO8OPUvmvUO/Mqi1pAdDOfN8vKq344KVKqtA96Y=; b=d02Wabm9hwkG8uIL3ijQ2zIRFogJ05+ROEIfxvRWpUbm85P2fYsQ+o+p0BYmcwA4L6 eGS8VO0ksgaylkiPdn5/+KYVLa4pZYdjH2puTHwIqwmco7cGE9OuunYmHjqrWl90qI2Z vwYdTWdPqvGfRM6IeyiOG4tZDo3E9QOF6J1IIg2VGCduCpql0Viegn5mQrjGtSahgkbv rs0z4slIfnmNDRT5gtD/ls/dzJomwScKbhZv2djrfZVBEb1Ihz7xyMSyJ0uv97Ix56rU AplVc3ZpYczMblRZuZSd6IwgzoACirjhB1L5qWLTyTj70jsjPKR/avLionHq/Txpxie9 uneQ== X-Forwarded-Encrypted: i=1; AHgh+Rp697y7UToExAzVDQInHVy2ZLaBiF6OMDLPLIe82lw0eNN+INeKtrwDqavaqcw4M2ae1Id5YN2OWO2C@nongnu.org X-Gm-Message-State: AOJu0YycqdMz/cJykpAxf6vePil/hIh7PdFfI0CsaCTlFt7vv9azNRfu 2mJybCQ3O4unJvhKTllQH+PjdDCZuuPHkDE2ak3lJAwfxkLWdPHyPo00gr745SL4Fjw= X-Gm-Gg: AfdE7cltGO1fMqjBVBKK17h2iI3cj3KDqNZ/jJcIek7sQduEF1zC98I7HUbx+y4Jund kBOFQUbV5/TFD47Wbo16yJtnmdr24BQbMsLHN3jeHpIHB7q6CsvbZKoMVVYqZ2PjGxz6NMb10BI piwheL3gME/QRHkcnyZSuy/cL77s1kvKXUoG7vyt0Qpm03p2cUOA4pRoNOGgwm8dcTu9p5TEVI7 TkWOWZvNLzPgHcNmaMOdEjuqC89xsDRU8Z2fvgzrTqV0SjOV8zjjYLm6tb85ytT6Q+bbmSfnjhh tV5OA39s5Fay9WWI+hj1xViNweSJI6SpkoX7kYHZgU+dniNYe4162FfdpyvzH4ClyLa52lOn8iR ELCc2n6Gi1NtGYVyB9IzMUc8I7+JQlikgkf1RMZ+UQNB51Ngp/lCMaPqufB8R6EQM5Q3V7jsQI0 mI25EMOFhpyiPb2rGIShwJ2ECykNDR4SgDSxwASxcJD1N8h1ioMAuji9zSsUL8+q1y7mFM3FYLG NE+14E7DsTKeqC1nTL+sw== X-Received: by 2002:a05:600c:4743:b0:493:c1a1:68f0 with SMTP id 5b1f17b1804b1-493e68c80b5mr115463735e9.20.1783681155277; Fri, 10 Jul 2026 03:59:15 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 6/9] hw/dma/soc_dma: Use physical_memory_map() for mem2mem transfers Date: Fri, 10 Jul 2026 11:59:04 +0100 Message-ID: <20260710105907.2570621-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:31::1; envelope-from=peter.maydell@linaro.org; helo=mail-wm2-x01.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681264496158500 Content-Type: text/plain; charset="utf-8" The soc_dma code has a fastpath for when DMA transfers are from RAM to RAM. The current implementation of this has the caller of soc_dma_port_add_mem() pass the underlying host address of the RAM block that the DMA port is connected to (obtained via memory_region_get_ram_ptr()). Then the actual transfer function does a simple memcpy(). This has several problems. Most importantly, no bounds checking is done on the address and size passed by the guest, so the memcpy source and destination might be outside the backing host RAM entirely. Secondly, because the DMA access is done via this back door, there is no updating of the dirty region when memory is written this way (there is a TODO comment in omap_dma.c noting this). Fix both of these by making the memory to memory transfer function use physical_memory_map() to get the host addresses for the memory copy. That function will automatically give us the bounds check that we want and return a short length if the transfer would run off the end of the RAM MemoryRegion it starts in. Since the OMAP DMA documentation states that it's a guest error to misprogram the addresses so that they fall outside the range that is valid for the particular DMA port being addressed and that this can result in guest memory corruption , we don't need to loop for short transfers, but can simply log them and continue. Note that we don't need to update addresses or bytecount here in the transfer function, because when soc_dma_ch_update() selects transfer_mem2mem it also sets ch->update to 1, which tells the omap_dma_transfer_setup() code that it is responsible for updating all the guest visible fields to match "transfer completed". (We use physical_memory_map() here to match the use of physical_memory_read() and physical_memory_write() in omap_dma.c; making the DMA controller use an explicit AddressSpace would be a separate cleanup task.) Together with the preceding commits that fixed some integer overflow problems, this fixes the "guest can provoke a bad memcpy() operation" reported in issue #3204. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3204 Signed-off-by: Peter Maydell --- hw/dma/omap_dma.c | 5 ----- hw/dma/soc_dma.c | 51 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 14b310bf40..1a3ae74726 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -559,11 +559,6 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_= s *dma) if (!ch->sync && frames) { ch->cpc =3D a->dest & 0xffff; } - - /* - * TODO: if the destination port is IMIF or EMIFF, set the dirty - * bits on it. - */ } =20 omap_dma_interrupts_update(s); diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 1b93aaf565..6e325122d9 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -20,13 +20,58 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "qemu/log.h" +#include "system/physmem.h" #include "hw/arm/soc_dma.h" =20 static void transfer_mem2mem(struct soc_dma_ch_s *ch) { - memcpy(ch->paddr[0], ch->paddr[1], ch->bytes); - ch->paddr[0] +=3D ch->bytes; - ch->paddr[1] +=3D ch->bytes; + /* + * Memory-to-memory transfer: do the whole thing in one go. The + * hardware spec says that it is invalid to program the OMAP DMA + * controller with addresses that don't match the port (i.e. to + * ask for a transfer to/from a memory port with a physaddr that + * isn't within that port range) and that if you do then the + * transfer continues and memory can be corrupted. So we can map + * both source and destination, and treat short mappings and + * failed mappings as a guest error. + */ + hwaddr srclen =3D ch->bytes; + hwaddr dstlen =3D ch->bytes; + hwaddr srcaddr =3D ch->vaddr[0]; + hwaddr dstaddr =3D ch->vaddr[1]; + void *srcmem, *dstmem; + hwaddr xferlen =3D 0; + + srcmem =3D physical_memory_map(srcaddr, &srclen, false); + if (!srcmem) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not map source; " + "guest error programming source port/address\n"); + return; + } + + dstmem =3D physical_memory_map(dstaddr, &dstlen, true); + if (!dstmem) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not map destination= ; " + "guest error programming destination port/address\n"= ); + goto unmap_src; + } + + xferlen =3D MIN(srclen, dstlen); + if (xferlen < ch->bytes) { + qemu_log_mask(LOG_GUEST_ERROR, + "soc_dma mem2mem transfer: could not transfer all da= ta; " + "guest error programming src or destination addresse= s\n"); + /* Continue to transfer whatever did fit in the port window */ + } + + memmove(dstmem, srcmem, xferlen); + + physical_memory_unmap(dstmem, dstlen, true, xferlen); +unmap_src: + physical_memory_unmap(srcmem, srclen, false, xferlen); } =20 struct dma_s { --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681302; cv=none; d=zohomail.com; s=zohoarc; b=UedHGo53RBZDP24Dj9j3HTAzPgMF1m+JHabRQO7qrL+sOSTcfrqNi8d4t+B1a0sLopDggL/ajqzRQQaoVWeEGrsolVvK6ZWfbfEVzfffaKism6UFIdp9lGTb7NQqjd7DXOFZt+KL3PdIe96eXvCmrqAIjt4W1F61slBUs02fvFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681302; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ihg7vHTyXn0KPCfa4E2cworXVRkER/1mlTfqytBQui8=; b=NsDk7/uAD28VF9UcV5pH72D7vQ2QKX+z/f5Fz4dGlMnV3F/8MkO1LGthXJMOt230h0sKwchB/9dON2NwMtl+SDnm0ORvRupPuRjOIhTZUEQe+kXtgvrbJUTnFW/KmOSWSAj61LiEvCBqi1rLEFz+GuBWoij2FYSUVvpA0OvT86U= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681302115321.6762669874769; Fri, 10 Jul 2026 04:01:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x2-0006aW-GQ; Fri, 10 Jul 2026 06:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wx-0006U0-Ih for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:20 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wv-0001PV-UF for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:19 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-493f738638fso526795e9.1 for ; Fri, 10 Jul 2026 03:59:17 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681156; x=1784285956; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ihg7vHTyXn0KPCfa4E2cworXVRkER/1mlTfqytBQui8=; b=MprzbGI2ORCiJrEPsLcPT5TocSvo3O5mIuj+KHIVm7A8rsYS/Tgx5aIJ1JDDNg84Tn josvBlBZBOQDp+iXzpy+BgVg/goqS7BIyRtwDaMxB651fVnw6bOZ17CkBdORW3SoEa3m 6Vc3aKPi+XcG5j8ZQNAbNYCbWvV5PMKE4/n4cIx9wBBukYcFSvvyfrL9YeVr4DjAAHNZ pCNqlQGAGzKseDccmWXixnhgqOPYdrXveUq9FX7D8oIY9DOlUwUYpGgLx4y3NzYhz8m4 6OySffOPSeeCBUZGEjo9R8jFPhFLq1CuuNacHxJGQZOFJaktD7y6WaQmlTXexZ+pv46m G2xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681156; x=1784285956; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ihg7vHTyXn0KPCfa4E2cworXVRkER/1mlTfqytBQui8=; b=U7WYB4lULwfOqongK+TN2k5qOPpxVnRIAwC9Uf3A45rVyOPjr8EDex9u7oWJIT0E+s CA8c6cU0jbKv1FcWtdU9Y3j54BxSD497VVwXUvWkdL9EcunYMhRXQUsUqD9WHXDKCcqF rbcdfeH/ggPHq9TBgkxogU2V1KeNxbEnq/0CxKn7zFOmqQCeVInmezfEH2VDRxkVNp3v kfATo6UccjJ3Pr60cKQK8+tyGsigHKIGgHNEZKXNPEeki4NIy9oeA0Odd+77ha3yBiHh Ga6kM0rJH1kp68JlkjCEHKjXO8y6EM6TJCYc8B4gPgvDUvGUjLY+LifQHllELRpz2GIx mt0g== X-Forwarded-Encrypted: i=1; AHgh+Rp7xAtDtoRDL3+WnCwyWrUwco1d+mDOAzdSccF/kwc5E8h0/hjfGJGh+hcsY7yL3td4d6ITLjSZX9mH@nongnu.org X-Gm-Message-State: AOJu0YybR55gVtM2L01WHerybLykZZz4zI9vLPkoL89lG+Nq0HGQDWMd kjO2ap4FGbmEeZ4u15x5MXPCW6CpF4hlqjvfoPkn2I+sOtRzIXBQjSRKq6JlAV8fyx4= X-Gm-Gg: AfdE7cliyJ5XhXHkaJFxCXObIJoVjNzUpqp2TrwMkXMIVwDnO3rp3PAlbsWR0EmrDa0 Oj//+Z8fsVXt55ojnrwQH4PdjiGFP2NUJGM8J80uoUd1gdjRRsKaoyRnyE/9SlgWk3gTA6DTysW 6iYTcZTSXuMdsr0zML2VowQgEEBNloeP6wChWTKnonpoc6Jb/xwsHzYQhIiVrayFU9ZjTtFbkIL nlz7eDtlLFnV1DgQThNDtFM34gojcDHxswOGVUZCoxWJzz95iZLhQ+Ephubx0B7F8nRJfl9KI0b lwu4cT7h3shAkNzNIkJaYXLhiu8CdhmT8/G+0qqPZA+LYcVm0c1uJQnpjTQ5lw2l6qKXF9W9mLQ bJ61R5BOrGF1II++woFi5Wa8h20/NitXMc6/RxYNFcf4ewrg5FbKThLZ4NqA0lCIclmQIrpFy6u JYfYBApeO2wuLT+czSy4bUlg9cNpBJLKWnyvxBY0SgEooPQb8jQliRNS/zWlirfVrrzPX5zDs8e V05sV656KwUjr6OCfgT7A== X-Received: by 2002:a05:600c:8a17:20b0:493:f5bf:4deb with SMTP id 5b1f17b1804b1-493f5bf501amr10938975e9.25.1783681156435; Fri, 10 Jul 2026 03:59:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 7/9] hw/dma/soc_dma: Remove unused mem.base, paddr fields Date: Fri, 10 Jul 2026 11:59:05 +0100 Message-ID: <20260710105907.2570621-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681302726158500 Content-Type: text/plain; charset="utf-8" Now that transfer_mem2mem() uses physical_memory_map(), the soc_dma_ch_s::paddr field is unused; remove it, and the code that set it, and the memmap_entry_s::mem.base and the soc_dma_port_add_mem() phys_base argument that were passing around host pointers to use for setting paddr. Signed-off-by: Peter Maydell --- hw/arm/omap1.c | 6 ++---- hw/dma/soc_dma.c | 9 +-------- include/hw/arm/soc_dma.h | 7 ++----- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 44f9dd67c3..9e739a0712 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -3799,10 +3799,8 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegi= on *dram, s->port[tipb_mpui].addr_valid =3D omap_validate_tipb_mpui_addr; =20 /* Register SDRAM and SRAM DMA ports for fast transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(dram), - OMAP_EMIFF_BASE, s->sdram_size); - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->imif_ram), - OMAP_IMIF_BASE, s->sram_size); + soc_dma_port_add_mem(s->dma, OMAP_EMIFF_BASE, s->sdram_size); + soc_dma_port_add_mem(s->dma, OMAP_IMIF_BASE, s->sram_size); =20 s->timer[0] =3D omap_mpu_timer_init(system_memory, 0xfffec500, qdev_get_gpio_in(s->ih[0], OMAP_INT_TIMER1), diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 6e325122d9..ff890149ee 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -85,7 +85,6 @@ struct dma_s { enum soc_dma_port_type type; hwaddr addr; struct { - void *base; size_t size; } mem; } *memmap; @@ -154,10 +153,6 @@ static inline enum soc_dma_port_type soc_dma_ch_update= _type( if (ch->type[port] !=3D soc_dma_access_const) return soc_dma_port_other; =20 - ch->paddr[port] =3D (uint8_t *) entry->mem.base + - (ch->vaddr[port] - entry->addr); - /* TODO: save bytes left to the end of the mapping somewhere so we - * can check we're not reading beyond it. */ return soc_dma_port_mem; } else return soc_dma_port_other; @@ -245,8 +240,7 @@ struct soc_dma_s *soc_dma_init(int n) return &s->soc; } =20 -void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, - hwaddr virt_base, size_t size) +void soc_dma_port_add_mem(struct soc_dma_s *soc, hwaddr virt_base, size_t = size) { struct memmap_entry_s *entry; struct dma_s *dma =3D (struct dma_s *) soc; @@ -293,7 +287,6 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_= t *phys_base, =20 entry->addr =3D virt_base; entry->type =3D soc_dma_port_mem; - entry->mem.base =3D phys_base; entry->mem.size =3D size; } =20 diff --git a/include/hw/arm/soc_dma.h b/include/hw/arm/soc_dma.h index b5ad9743be..fdae7a29c2 100644 --- a/include/hw/arm/soc_dma.h +++ b/include/hw/arm/soc_dma.h @@ -53,8 +53,6 @@ struct soc_dma_ch_s { /* Initialised by the DMA module, call soc_dma_ch_update after writing= . */ enum soc_dma_access_type type[2]; hwaddr vaddr[2]; /* Updated by .transfer_fn(). */ - /* Private */ - void *paddr[2]; =20 int running; soc_dma_transfer_t transfer_fn; @@ -83,7 +81,6 @@ void soc_dma_set_request(struct soc_dma_ch_s *ch, int lev= el); * calling soc_dma_set_request(ch, 1): * ch->type[0...1], * ch->vaddr[0...1], - * ch->paddr[0...1], * or after a soc_dma_port_add_mem(). */ void soc_dma_ch_update(struct soc_dma_ch_s *ch); @@ -92,7 +89,7 @@ void soc_dma_ch_update(struct soc_dma_ch_s *ch); void soc_dma_reset(struct soc_dma_s *s); struct soc_dma_s *soc_dma_init(int n); =20 -void soc_dma_port_add_mem(struct soc_dma_s *dma, uint8_t *phys_base, - hwaddr virt_base, size_t size); +void soc_dma_port_add_mem(struct soc_dma_s *dma, + hwaddr virt_base, size_t size); =20 #endif --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681182; cv=none; d=zohomail.com; s=zohoarc; b=nV2GNrG8/q2wf0/40o84RqR251jew3foqWnT7ErPWDqzUsSl/WrzBmUy3JaxfkR+h4HQ6pXGopy599AmXotaoRUSZ8YI01ZBwAygpQAR4ggAu71zSNQNQRMFWYWnhnoQtjLF+HqH/BJACJBvZgtzbRDYL5bdjV2wl6XwlbNCEa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681182; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PzHxCXsIOILaIZXbiZCOtU/tN9ewAfAvcdvjSx7fAwY=; b=VDkcInHUQ1z92hPBxMz4u7YyUyj8rTU45S+rjLRt833UwEXcW5kTNmP2RrB3Nhhbp7uW1O855ZRplqK1ow1d5ov6rU2N3IGagliHpujmx7A0PqOkt224+IE8fq+oEpfDoB6PvhbZJivcHGP9cGLE1upgGU8I9Uswh32Yw0MUt8w= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681182643949.081729464552; Fri, 10 Jul 2026 03:59:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x3-0006bU-Gv; Fri, 10 Jul 2026 06:59:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8wz-0006U5-28 for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:21 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wx-0001Pw-Fl for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:20 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-493b966dd74so2878265e9.3 for ; Fri, 10 Jul 2026 03:59:19 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681158; x=1784285958; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PzHxCXsIOILaIZXbiZCOtU/tN9ewAfAvcdvjSx7fAwY=; b=Oz9p/VZ7GEk7IZcAViytVng484dusrcF27axUwgHcA2YjbOdumOGMUe2dEBe1U3FdT rNhhMvrqPcE+0rqySJMqhPcUqVwmWUDv30s8FY8jLVAPPq0/2D9w7E3JqpCGLpZ7nOv9 adveexRBGA2SciDjbYa+4z3u3giZ/22/fhNXlApMAV1tFqDIrBq4f1lAbIWGrnoIuJzn 5fM0l8zImqpq9uAcBYVZ9prEAM/1iJOAPHbpoAYG0oz8E2EhamZGEhVkETRCsUJk4+cE Gg09f44+21wl7/1cA61Mi24FGbaRcLDZJtTjRZNJJX1CHM3G7DudJpAm1/P4zF2lC75U 3KYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681158; x=1784285958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=PzHxCXsIOILaIZXbiZCOtU/tN9ewAfAvcdvjSx7fAwY=; b=jeAJ1d4tRDYEoPecFDUCE39qURIgjopG3U4i2ROr2AyZ6Nwu5P6J5Fv09noYKcQkDm haoj8rKJOrAtV6r2Cr23dRSZmC8gSXK5+kE9h7WE5eJoHuJqNkJ8L4yyNpXWJjDDYadV nePNC8sDCvjTu4wrZPBtGwOV6DDE1efGKCLkop4fqqIkcbZu5GTDd446j3O132tm3I6t mKWeqMuRrvq6YmZw5peoE/ziG7UEfFqVWgDlMJNohKHIj2nQHqga0qEu8zjsJZQRfMPT GYodvlyu4+DisY6HD3K56lZoSapPw6QGDwl1bjG9zkl3KSpiInUYof+yO719rbWYNnP7 GFjA== X-Forwarded-Encrypted: i=1; AHgh+RqLpnxg0y5+aJXcfxzp6so1b9BzsORwuPt3JljvsgK317HN4QIrCAtfuwXd3qVXz1FjTOu7C+OLfS25@nongnu.org X-Gm-Message-State: AOJu0Yz2iYSD5BPAfzspfyneeM4rU8O/xi69dbZ9eeipu9UBHLYuO7hC bwdads6zT+qBz91rb7FvKgSL1Julbvw+tY8o7VPeqoFAWwjLn3HZVpLjpJmUJ2vhmcg= X-Gm-Gg: AfdE7cnTKs+T9H/sjwICerzpbMGXYetXmTZdIG5ITTeu+oldgr6NfpsInauB5xam+dt ILzZKkwoOT0FErHUsewbz/F8q1i0WFftNB1+6+9r+xQCp7vN4V2cHQz/GrR1o7gT0nJ1WyNNKOg xYAUm1L+NDWnJgHUU58u+gbCnLdUiXA+eUJ6x6S1/+INMCjdKLnT6FcXzLoKd2EHNfJpTR4+E9a I/V+D2Vyzqt/cvlI81A5wj13PNTCcAdo0uF83wxocZd1MSykGOxVvpojcuxGCzibuLDIkbt5LdS SKsfbLHN2PeUrl9kiwC7XnMvQ6Pi9A+fihMGuEcDaTLlniEAQcAYatNqiToKFXWpj+T1lGs3nEq tWIiszYx+blgcl01WTMq/sMD/b16vsijZFdTreNFdhjwG1ouxJtEdVR14WBsZ7iK/JAQfWh3R3V M7O6R4c7gOL94Ctx3pdKOtf+Vl8MKBQ8+JxxyXamFlShtu+3tPD2VZPH6OcAKxdOnmJt38/3O81 bnImXdzPzdJX/vb0c6xMQ== X-Received: by 2002:a05:600c:3b26:b0:493:e3e9:85fb with SMTP id 5b1f17b1804b1-493e685f1f6mr113555855e9.20.1783681157419; Fri, 10 Jul 2026 03:59:17 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 8/9] include/hw/arm/omap_dma.h: Move to include/hw/dma Date: Fri, 10 Jul 2026 11:59:06 +0100 Message-ID: <20260710105907.2570621-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681183501158500 Content-Type: text/plain; charset="utf-8" omap_dma.h is the header file for hw/dma/omap_dma.c; it fits better to put it in include/hw/dma/ to match where we have the .c file. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/omap1.c | 2 +- hw/dma/omap_dma.c | 2 +- hw/dma/soc_dma.c | 2 +- include/hw/{arm =3D> dma}/soc_dma.h | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename include/hw/{arm =3D> dma}/soc_dma.h (100%) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 9e739a0712..0f78cbd410 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -32,7 +32,7 @@ #include "hw/sd/sd.h" #include "system/blockdev.h" #include "system/system.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" #include "system/qtest.h" #include "system/reset.h" #include "system/runstate.h" diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 1a3ae74726..16575e73b7 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -22,7 +22,7 @@ #include "qemu/timer.h" #include "hw/arm/omap.h" #include "hw/core/irq.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" #include "system/physmem.h" =20 struct omap_dma_channel_s { diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index ff890149ee..4feb22e6ea 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -22,7 +22,7 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "system/physmem.h" -#include "hw/arm/soc_dma.h" +#include "hw/dma/soc_dma.h" =20 static void transfer_mem2mem(struct soc_dma_ch_s *ch) { diff --git a/include/hw/arm/soc_dma.h b/include/hw/dma/soc_dma.h similarity index 100% rename from include/hw/arm/soc_dma.h rename to include/hw/dma/soc_dma.h --=20 2.43.0 From nobody Sun Jul 12 00:42:31 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1783681301; cv=none; d=zohomail.com; s=zohoarc; b=IkzAnwJ/yfWH1kwzqLyIjUx1DVJ07x87jWYMlUKlbKEKrLTgK/1eoGiPBubdJe+gUCG16jHFKrFdwdhUhTabspsQlYBcnt63P03/kiRIZBrLcrIRgyauockroWirPnyOZvBzjgQHh7miHUw2gG1GniN25OMJgKSSfIJ0LwE5VpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783681301; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Dl9JxJv011eBVmZsRV56sHww0Wol1xI1ADK7rHs3if8=; b=M4PZwbXoc/EpM5AOLa8vZArVfhCEYWU3hLP2uU3phj/suET1pFDcNwsHsTqRSABkzR1/9/h7gn7toJuChwwXyBZNZNIofndI1iKXlvVDhWiIiM5b2Pvk6aBY8sVEse29xDuKAg5ZHPsvyChXeMrVqcfXOipektb8Sw0uEwZU5fA= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1783681301750499.54007307281586; Fri, 10 Jul 2026 04:01:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wi8x2-0006aQ-5z; Fri, 10 Jul 2026 06:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wi8x0-0006XC-8E for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:22 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wi8wx-0001Q8-Og for qemu-devel@nongnu.org; Fri, 10 Jul 2026 06:59:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-493e4cccd8dso3177495e9.2 for ; Fri, 10 Jul 2026 03:59:19 -0700 (PDT) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d88698sm51946175e9.1.2026.07.10.03.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2026 03:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1783681158; x=1784285958; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Dl9JxJv011eBVmZsRV56sHww0Wol1xI1ADK7rHs3if8=; b=zmkA/jhgXr/R+BngiIX+c2kBwGfp99YtdNLRWH7kVkK6v0hTCHV+H5KoZmvORgSbS/ NDqo5vRuzuz7NLRLdgiC6tLJSlTFkmgCnTK+BC8bw9uka9DJ4TLbuZTWqdNUJUkL8ahW qPc65AbqgeLH9J201/9KKSvWzdneRQlHl/qlNFrNVuI7gWWnSvS0wkkRtG4LUWtIhZPQ 8YgJWuYKIF56x2uwYFDhkNH3Ys0j/1TqLw8+X3ig1AA9SV97LBW2Za33IK4ygJB8ZVqQ +Imh4XJ1Gs0EsiAvROfZTTDCgx1r/WJV+yoCSKJICtxEbdZZiVD6VUFiuScO6tF5shJP C3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783681158; x=1784285958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Dl9JxJv011eBVmZsRV56sHww0Wol1xI1ADK7rHs3if8=; b=V7d4poR/R4UsankpyJX54i23s2aytNGncuortKp6JrZPq2XvKWpZZ7wb4+cEgTQW2z JYNw943MudOcR+5ZivKsya+yOzHRJpnleADRKoV7VselRjaNok4yrQFuLrsbTBrwq4lK EMMplFhWyGAXXTY3ujaXe4ChPKt6ytLlhPconoygzL6WqpEfyV4Ly3dF0c4o4mTSlYqX QjTda9ck9vgPNU/Dv3MOul5m2EXapZc41Halm7Z9mQxlpnbjTe2K5XsKZe1fzBcr4N+/ UfoxrIKRMYOv09msbjoJ997B5AYQXELGZHovhNo5w19pP3YI79MrGR3T0cGz9RCpOOgT Fi5g== X-Forwarded-Encrypted: i=1; AHgh+RqquYQYWE8jteaOrJwvYcsdG/rkXR7x5VIoEuaMiZwQrReS6/h8o9iOUTUgB1EoK3LC7GrzAZJmFL5u@nongnu.org X-Gm-Message-State: AOJu0Yy2BeHs1FvOQdBKBtpFK92IkwYx6lmLhqABrDbUVUYA3pk5kl2K DcV7/tq7wj0nf6jWh3hWagUaff3kRSNjjSxBM48iz7juCxPF/e4EaQMR9HONcK/Mi3Q= X-Gm-Gg: AfdE7cmvCD+baYD9wCquAN4OEC2hNtVGA5NbL8b6j7tR9zG/aXeKpMCg+WnyNTakauo zMgpaH4zbYuPo63oCqKW3xzUF2JE1FCrAD5RDy9pmVQT4DskfYCv1w08Ps37NHQeCsZSfYQ/JuJ ZldOhRJVrAda8OlaAL2ymmwqz15Md8tTAVCPRHdBVDV04B0husu1WsV0tzgO6/NnGOenBwCHXb6 xuMRhQgcx6m8dS7sAmrnpO/WzPUGCsJ6hvSKQGPkNN7m0Qd0jopg2sUdTeUKEPkF/vtMBtFq1HK AG++SgWC+amIuOOF+Kp81igZ5lrBidzbLqczC0cPoMGpKkMJbmoVKh8JquI73/u4PCYYVhFhVe4 sELWog/DxcDasjo/J7UjH3rj2c/sn22Ygz00snZYqJOccM89OJjQRHDTUHDLhehEtPT+3sGityl XehKpBMsnvAGKlGxD0zIZrX+LlUeZoQcuYcFlEzBAEeaXQGtqymD6PQyMk1nSto4V4lrCTCzdSb ApX0GosPJ75aEoQjCR54g== X-Received: by 2002:a05:600c:3515:b0:493:bc92:2a2f with SMTP id 5b1f17b1804b1-493e6894936mr114992955e9.1.1783681158336; Fri, 10 Jul 2026 03:59:18 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jim MacArthur Subject: [PATCH 9/9] MAINTAINERS: Add soc_dma to OMAP section Date: Fri, 10 Jul 2026 11:59:07 +0100 Message-ID: <20260710105907.2570621-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260710105907.2570621-1-peter.maydell@linaro.org> References: <20260710105907.2570621-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.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, 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 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1783681302692158501 Content-Type: text/plain; charset="utf-8" The hw/dma/soc_dma.c code appears to have been written with the idea that it abstracts out DMA transfer operations from the details of a particular DMA controller device. In practice, it's used only by the omap_dma code and I would not today recommend trying to use it in any new DMA device. Add the files to the OMAP section of MAINTAINERS so that patches can be cc'd to the appropriate places. Signed-off-by: Peter Maydell --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6171cc7494..bf1ef71f24 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2201,7 +2201,9 @@ M: Peter Maydell L: qemu-arm@nongnu.org S: Odd Fixes F: hw/*/omap* +F: hw/dma/soc_dma.c F: include/hw/arm/omap.h +F: include/hw/dma/soc_dma.h F: docs/system/arm/sx1.rst F: tests/functional/arm/test_sx1.py =20 --=20 2.43.0