From nobody Mon Nov 25 00:33:13 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1718725837; cv=none; d=zohomail.com; s=zohoarc; b=IHgNmq8PTL2Ecg7HcVPzuuCfGwQjRkXfQLx4yRd31jUZ+o5eg2pwUKFu+xTEi/cRE57axTnnQEzLgX0e+PO9tiqB9aSoAdHlW+c/3VZueh3P+7di0cL/BkUCDPRHhIl3JAFU9Vyd62Tzgq7uPjNYsAXRqZ28Fiz8Voq+TI4RfDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718725837; 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=8qbMh/+soO3OUYSOJXYHB1YaDc9kxQNjBaN1zGLpxa4=; b=chZX/nKroy3Fhg5gAlsej77kOg4zmbcCCJG0Ux7hsmT1c99TcI1obyiquMGaHARjyC/u/5BrbAYegrhxhKV5lTOvKkqsWQpHQfJsMeT2NayjH5I4ii2BeW0kLELxV5a7vnGeh4peAnWksibh8opNIOhxE1wSD56L9Yy/PWh+H1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718725837687965.5295609494719; Tue, 18 Jun 2024 08:50:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJb5f-0003BZ-2x; Tue, 18 Jun 2024 11:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJb5d-0003AQ-Fq; Tue, 18 Jun 2024 11:49:45 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJb5b-0004sV-O4; Tue, 18 Jun 2024 11:49:45 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2e95a75a90eso60715061fa.2; Tue, 18 Jun 2024 08:49:43 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52ca287241csm1544379e87.172.2024.06.18.08.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 08:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718725781; x=1719330581; 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; bh=8qbMh/+soO3OUYSOJXYHB1YaDc9kxQNjBaN1zGLpxa4=; b=S2kgyG80QXlLs3UaKD+oZNd9jSPxAA5sr6P+XaoseAiApyuHeiBjSbJG6vsd7S4O7n cup7v4bB8/ERYFsILGcz2UnsDv1g7edrtwH8oyUirXUL3Q6vYZpjnvRuX9CR7qNRYnsY dV0p/H/OFKm03UULIMRc6+HL6jgCz14Yc/fet/DFHKhw6Hf+8Z5h2cDiju1B/27g2DdF K7bu2FVFiBHbJO5QA9R7+nRBLvbzIBWkmGm2JJRoM9yoY9qZOtay44yHF8RX0SuqOl4l IfwYhUunmoPbbaGwq5YdPyd+oZEsYqKH+2cJ3KL60CoaDmwBLqKLUhvqIT5DMV78QV6t 9PJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718725781; x=1719330581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8qbMh/+soO3OUYSOJXYHB1YaDc9kxQNjBaN1zGLpxa4=; b=Lxlh8I3TJw2kRLHF17Q2DY30tjDbeV3kqGryn7GmxNUrQDNgoIPefF/QYdrC0pz8Pj kLKpTbjjqECvyrpApzqoUQXQKEwoa0ASWssOtki9688ZFHU0S8TvgcofIImuc4fvbfKT s/d1wHSUf0ms8R56BvFiPGHeeYCZJsRuVaPzD9f51ynQjV3qKWghKEM2CC2GBJvpkvw9 PVfFy5eRvGUJ/QG0n0qNCeo9FJwDjr8TVRN2FXkIVbelZZcsDGz2TuT77FcF/6vk0B3n Fx3bO8PfN3WCFTk1Hj7LRq6MqBAONw1nFvhz10zb+TQQYxmLb7FWuyb3XV2l57E5g3jq UWsQ== X-Forwarded-Encrypted: i=1; AJvYcCWqxT/nNlosj2yIdUZAKuZ5sz/jfwZUdhEd24M9cf/KXUBVGNMkzgyGNMu1a9qIL8ugxnt31cR/IhtylnFCS0ip4N5x X-Gm-Message-State: AOJu0YxxWx2W1PB8iJCAz9CnAGvtqM53iBPPBus7lww0K+uPlnPhMFH5 1kGRawBJmQpX6YpFNUCXFkvGDivvlpmMSnu4HlWGkaQa0m++KQO9i2GQLVG1AReoqw== X-Google-Smtp-Source: AGHT+IHLa+XMKD8+ErNRpBmEquaIZviNOhpOe/BjuQeCZWwsG5l7HIQOSNdlAknoJe5sSUjU3OxKkA== X-Received: by 2002:a05:6512:2209:b0:52c:ae34:26e2 with SMTP id 2adb3069b0e04-52ccaa579a4mr18159e87.48.1718725781019; Tue, 18 Jun 2024 08:49:41 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, edgar.iglesias@amd.com, "Fea.Wang" , Frank Chang , "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , qemu-arm@nongnu.org Subject: [PULL v1 1/3] hw/dma: Enhance error handling in loading description Date: Tue, 18 Jun 2024 17:49:33 +0200 Message-ID: <20240618154935.203544-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618154935.203544-1-edgar.iglesias@gmail.com> References: <20240618154935.203544-1-edgar.iglesias@gmail.com> 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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x22d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1718725838860100003 Content-Type: text/plain; charset="utf-8" From: "Fea.Wang" Loading a description from memory may cause a bus-error. In this case, the DMA should stop working, set the error flag, and return the failure value. When calling the loading a description function, it should be noticed that the function may return a failure value. Breaking the loop in this case is one of the possible ways to handle it. Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- hw/dma/xilinx_axidma.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 0ae056ed06..ad307994c2 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -71,8 +71,11 @@ enum { enum { DMASR_HALTED =3D 1, DMASR_IDLE =3D 2, + DMASR_SLVERR =3D 1 << 5, + DMASR_DECERR =3D 1 << 6, DMASR_IOC_IRQ =3D 1 << 12, DMASR_DLY_IRQ =3D 1 << 13, + DMASR_ERR_IRQ =3D 1 << 14, =20 DMASR_IRQ_MASK =3D 7 << 12 }; @@ -190,17 +193,32 @@ static inline int streamid_from_addr(hwaddr addr) return sid; } =20 -static void stream_desc_load(struct Stream *s, hwaddr addr) +static MemTxResult stream_desc_load(struct Stream *s, hwaddr addr) { struct SDesc *d =3D &s->desc; =20 - address_space_read(&s->dma->as, addr, MEMTXATTRS_UNSPECIFIED, d, sizeo= f *d); + MemTxResult result =3D address_space_read(&s->dma->as, + addr, MEMTXATTRS_UNSPECIFIED, + d, sizeof *d); + if (result !=3D MEMTX_OK) { + if (result =3D=3D MEMTX_DECODE_ERROR) { + s->regs[R_DMASR] |=3D DMASR_DECERR; + } else { + s->regs[R_DMASR] |=3D DMASR_SLVERR; + } + + s->regs[R_DMACR] &=3D ~DMACR_RUNSTOP; + s->regs[R_DMASR] |=3D DMASR_HALTED; + s->regs[R_DMASR] |=3D DMASR_ERR_IRQ; + return result; + } =20 /* Convert from LE into host endianness. */ d->buffer_address =3D le64_to_cpu(d->buffer_address); d->nxtdesc =3D le64_to_cpu(d->nxtdesc); d->control =3D le32_to_cpu(d->control); d->status =3D le32_to_cpu(d->status); + return result; } =20 static void stream_desc_store(struct Stream *s, hwaddr addr) @@ -279,7 +297,9 @@ static void stream_process_mem2s(struct Stream *s, Stre= amSink *tx_data_dev, } =20 while (1) { - stream_desc_load(s, s->regs[R_CURDESC]); + if (MEMTX_OK !=3D stream_desc_load(s, s->regs[R_CURDESC])) { + break; + } =20 if (s->desc.status & SDESC_STATUS_COMPLETE) { s->regs[R_DMASR] |=3D DMASR_HALTED; @@ -336,7 +356,9 @@ static size_t stream_process_s2mem(struct Stream *s, un= signed char *buf, } =20 while (len) { - stream_desc_load(s, s->regs[R_CURDESC]); + if (MEMTX_OK !=3D stream_desc_load(s, s->regs[R_CURDESC])) { + break; + } =20 if (s->desc.status & SDESC_STATUS_COMPLETE) { s->regs[R_DMASR] |=3D DMASR_HALTED; --=20 2.43.0 From nobody Mon Nov 25 00:33:13 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1718725824; cv=none; d=zohomail.com; s=zohoarc; b=UsG/T2TqqUziRC9683cK3ual8DAf1K1MYbCOY4kVAF7IZFLH0rWCRORe29dQWZLYvcva0/iC8/GEOvWiQcsjXe+AhLjDTnU6jwKI8LHUJwRgZ8isjUix9GGdsWDzhL6exud2mQmrm/+Ih/eJLA+VvjL2kOE3m8/YNNnsxlSY3QA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718725824; h=Content-Type: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=AfiianYgOnEkXrIoFJQhOr0kIjrM7N1rg2F+4S9qH8g=; b=dlyNKPxwd5UYf2NEf0/+3WpJwPS76Dwhz9mhPY974rBxDw4eDL9CnfCm4c1K0KADLUDTZKO/gpFQyV0Ro8/scOqLqpCmrkVS+qOSf3cnQ5bcQJr+T+pcF684jjcCWA0hB4trY8l4N76CBotuqJ+mWVDOJHqd35RjAhYOWmyLcc0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718725824018654.9831575385225; Tue, 18 Jun 2024 08:50:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJb5g-0003Cj-Sq; Tue, 18 Jun 2024 11:49:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJb5e-0003BM-JF; Tue, 18 Jun 2024 11:49:46 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJb5c-0004sd-Uf; Tue, 18 Jun 2024 11:49:46 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ec1ac1aed2so43807841fa.3; Tue, 18 Jun 2024 08:49:44 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52ca282567bsm1532581e87.54.2024.06.18.08.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 08:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718725783; x=1719330583; 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; bh=AfiianYgOnEkXrIoFJQhOr0kIjrM7N1rg2F+4S9qH8g=; b=S6sKHu4X6J7Aac17W5ysKe1FdBioZUFoHdVuq7kzhIA+4iJgsEI/1oPhLxfGKN4ztt tjzkgNt7A4AkLEd50qj/hG993n64t8yUljlpAeSApLudfkh6aaPhdpl07tDwjt1a1eo/ x7eAa9U49IGBXHZOHe5COVM9Z+1LG28ZNAiMB316Aou7eRlcq+9B9miRcwziDvdrpM0/ ZwD3RP7Vkjs9qXUkLLyI8BqV5J4rMs8uwJ2nKuLKp7Sxqdl9KS2D/yN1TP1FpsrfJAOC rkOiYB/PwW0sWsQ43GyVa4zzxnRkrWM4BheV1zaSBfZTAeslmLUfafxqK6OOrYvAnxLI EFMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718725783; x=1719330583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AfiianYgOnEkXrIoFJQhOr0kIjrM7N1rg2F+4S9qH8g=; b=GMNgbvWq9Iwp0Mr+2CvyrNvSYuvnQNV/bRqmEfYmhhdN9peRC408xSdvhbZOjXpq8B 4uBMECfgPYUxsy5j8r34XwabkLPSWAx/0Pdfb/O9cwoIXDO/jO8XOKhZbCK9EkksJUMu hrTFQ37X/69tonGxkZ889SNCGOVh4hchfEQIJXRmmYJK60Znq1X8VnbtzgxT+bR9cfVf hW1fXy5+hF4eACbapv6KlovYVeGKtew4HWnzyQifo+X7vhnaSvCsyVaFfpEyBwKTfUdm fa8xh8aLcE0A9IYlXLQWigQ0icjROLu74fAj8k8+r53U5Zp7lKj8ABbyPptMPVfyfBS8 FEfQ== X-Forwarded-Encrypted: i=1; AJvYcCVrWHkl8qyJWaR4DteLaK6G67vjmg/Ru35Zsg+OA3ca2ghirWQWN4AYgNUUBd9sENgAno1RzQ00QwadPOOHThpFfcWu X-Gm-Message-State: AOJu0YxLujgTcabowancOS2huprRvB9uZHp4EgFj4vztG7ScVsuiKmVG vvWwSKemNYWhSx9AcJkEOWVetl39EDv72fQu90V3siCSJC1oJ/dEg8bCrUNaAQ4FtA== X-Google-Smtp-Source: AGHT+IGjmJhwiyiE34mjU/5PYVqhYmAJ/rE5+rK6s0FHX8HgamP3P6dn0evwNxD95uJnWaI+eyKnUQ== X-Received: by 2002:a19:4311:0:b0:51d:4595:3527 with SMTP id 2adb3069b0e04-52ccaa5a38cmr15647e87.61.1718725782569; Tue, 18 Jun 2024 08:49:42 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, edgar.iglesias@amd.com, "Fea.Wang" , Frank Chang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , qemu-arm@nongnu.org Subject: [PULL v1 2/3] hw/dma: Add a trace log for a description loading failure Date: Tue, 18 Jun 2024 17:49:34 +0200 Message-ID: <20240618154935.203544-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618154935.203544-1-edgar.iglesias@gmail.com> References: <20240618154935.203544-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x22d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1718725824859100004 From: "Fea.Wang" Due to a description loading failure, adding a trace log makes observing the DMA behavior easy. Signed-off-by: Fea.Wang Reviewed-by: Edgar E. Iglesias Reviewed-by: Frank Chang Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Edgar E. Iglesias --- hw/dma/trace-events | 3 +++ hw/dma/xilinx_axidma.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hw/dma/trace-events b/hw/dma/trace-events index 3c47df54e4..4c09790f9a 100644 --- a/hw/dma/trace-events +++ b/hw/dma/trace-events @@ -44,3 +44,6 @@ pl330_debug_exec_stall(void) "stall of debug instruction = not implemented" pl330_iomem_write(uint32_t offset, uint32_t value) "addr: 0x%08"PRIx32" da= ta: 0x%08"PRIx32 pl330_iomem_write_clr(int i) "event interrupt lowered %d" pl330_iomem_read(uint32_t addr, uint32_t data) "addr: 0x%08"PRIx32" data: = 0x%08"PRIx32 + +# xilinx_axidma.c +xilinx_axidma_loading_desc_fail(uint32_t res) "error:%u" diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index ad307994c2..c9cfc3169b 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -36,6 +36,7 @@ #include "sysemu/dma.h" #include "hw/stream.h" #include "qom/object.h" +#include "trace.h" =20 #define D(x) =20 @@ -201,6 +202,8 @@ static MemTxResult stream_desc_load(struct Stream *s, h= waddr addr) addr, MEMTXATTRS_UNSPECIFIED, d, sizeof *d); if (result !=3D MEMTX_OK) { + trace_xilinx_axidma_loading_desc_fail(result); + if (result =3D=3D MEMTX_DECODE_ERROR) { s->regs[R_DMASR] |=3D DMASR_DECERR; } else { --=20 2.43.0 From nobody Mon Nov 25 00:33:13 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1718725824; cv=none; d=zohomail.com; s=zohoarc; b=DvFxxn+DJEM32HVavZ2/ZeJcVbSTHxRN1gj47XnG4YA8hNOOa79devxk6cJJYozutdndxAaJbhS0UzBFkdZWks2AlgB3JjtFlms5usHYm43ton4Ef1W6o1jtXrRXbFmJR6sdQyzdsy1gJ84m9of+pVv+XW2ZtVYg9yGX8pENbJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718725824; 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=oPLZtK0QeERyzwGrC6JZXHapbKvTNkLQ3lh1zZectkY=; b=Gwx94OTGilhPxBj7D0Kp8/VrX8b1wYOuJkL5QtCC56izxDuiE5I88eST5uFN3bnrdf9VXTmHk6GKItSN6+D+loDC+risnp3qaTQmJZLI/DxngB2yzRkPOIPrtDkhd3dDDodf98vUMPzBdvUgJ2AVzA8ZARocNeP+deH1IUIA0EI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718725824639573.6574938405126; Tue, 18 Jun 2024 08:50:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJb5j-0003DG-KS; Tue, 18 Jun 2024 11:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJb5h-0003Ct-Pw; Tue, 18 Jun 2024 11:49:49 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJb5f-0004st-2R; Tue, 18 Jun 2024 11:49:49 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-52cc9b887f1so246816e87.3; Tue, 18 Jun 2024 08:49:46 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52ca287240asm1543182e87.177.2024.06.18.08.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 08:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718725784; x=1719330584; 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; bh=oPLZtK0QeERyzwGrC6JZXHapbKvTNkLQ3lh1zZectkY=; b=buszedKbezBEYyFs6Ul7GIxWkaM1cjUsVzZUxDkV+N4ezlmaBCps6Mu1f//J2L+8IY sWeptqhrlu3oINXf+QVo3RMZ8Z3WOl5zZvidvBtfBonrPAO9KWyvxH3P9/zTYbEpBO7y ko40U7KBpvugWhg9MAbnMe7BGYrSi6Uuu3wWf6WMmEMLMoqYBOtU+aoCKFUAFu7FggRY BA/iNmKNWyE/5lV0kL10mx3HE6vpkwVXP16rzoNj6hhsyZE1nykKj00cVOezTZ764AGs Crmy1XLLhAqA2Hc9vyk3EqDTcafMgV7piDg/owQq0iDdJzN6d/6U+t++JWAxNjbChLVm Yo4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718725784; x=1719330584; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oPLZtK0QeERyzwGrC6JZXHapbKvTNkLQ3lh1zZectkY=; b=P8+wRtMyeiw93Go8zTalDP9RK21LWHHHbrQfRAAON3cFiMn1RhV1spsj+3hN/OzBXK vrcCyc0EBqcj73wdvutOP7GTaRVULNZ0zOLEsnmS8S+RlDNfo/GvWypfs85iifBI0nSZ ELl5VBS3eagbSkPxUJ2FzzgeGyZBJMAg0XZu+AgtYuKCupDW2QlZ4xqQKDPXIMUkfWdx nO0h0v2qL03nX/VJRtve26IMbnZKwuK6VyptlwaFx873bXgJ1Dx3fO2OioPnc6PLxuta 6RDmTB8bh2YOP5OsSJrdTd30GVzzZygaAiOG/9OVs2TdIG3tmetbVcGZfFk1qk4oyUk2 EBXQ== X-Forwarded-Encrypted: i=1; AJvYcCX6yx3w//KLhlL/lnEWB+mQPBpxRKLhIUQymVhasL3xQ1+bywA2sK+ZWKW0Km/F0AMKui7htd6nt4our/WEyFyT5vAg X-Gm-Message-State: AOJu0YxRwQBKDlT10FbNxE0mJXV7LqSDDQK7OlaFRyAd60bda+XHzWZ4 3F8uE4xjS80LEfo/U0qvHnacRtEfHnJgf5YERVbKuHwIiftwP8L1rTwb2SNimrx3AQ== X-Google-Smtp-Source: AGHT+IG7YEzuWGosWrlq3mMTt+qdW7+EvYK3ZdhAEPYYxDL0nm+l9m7R5Pvno2weHZ6KQrhGvBAVtw== X-Received: by 2002:a05:6512:3d0b:b0:52c:a8d8:4519 with SMTP id 2adb3069b0e04-52ccaa92680mr5441e87.53.1718725784051; Tue, 18 Jun 2024 08:49:44 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, edgar.iglesias@amd.com, "Fea.Wang" , Frank Chang , "Edgar E. Iglesias" , Alistair Francis , Peter Maydell , Jason Wang , qemu-arm@nongnu.org Subject: [PULL v1 3/3] hw/net: Fix the transmission return size Date: Tue, 18 Jun 2024 17:49:35 +0200 Message-ID: <20240618154935.203544-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618154935.203544-1-edgar.iglesias@gmail.com> References: <20240618154935.203544-1-edgar.iglesias@gmail.com> 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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12c.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1718725824848100003 Content-Type: text/plain; charset="utf-8" From: "Fea.Wang" Fix the transmission return size because not all bytes could be transmitted successfully. So, return a successful length instead of a constant value. Signed-off-by: Fea.Wang Reviewed-by: Edgar E. Iglesias Reviewed-by: Frank Chang Signed-off-by: Edgar E. Iglesias --- hw/net/xilinx_axienet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 7d1fd37b4a..05d41bd548 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -847,7 +847,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t= *buf, size_t size) axienet_eth_rx_notify(s); =20 enet_update_irq(s); - return size; + return s->rxpos; } =20 static size_t --=20 2.43.0