From: Itai Handler <itai.handler@gmail.com>
To: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, artem_mygaiev@epam.com,
volodymyr_babchuk@epam.com, peter.maydell@linaro.org,
francisco.iglesias@amd.com, edgar.iglesias@gmail.com,
berrange@redhat.com, eugene@nuvacore.ai,
takahiro.nakata.wr@renesas.com
Subject: Re: [PATCH 00/20] hw/core: Remote Port Memory Master
Date: Sun, 22 Nov 2026 09:31:33 +0200 [thread overview]
Message-ID: <20261122073133.1940537-1-itai.handler@gmail.com> (raw)
In-Reply-To: <20260915160044.345788-1-ruslichenko.r@gmail.com>
Hi Ruslan,
On 9/15/26 16:00, Ruslan Ruslichenko wrote:
> This patch series introduces the Remote Port (RP) subsystem, a framework designed to connect QEMU with external simulation environments (such as SystemC models or RTL simulators).
When a guest performs a memory access larger than 8 bytes through a
MemoryRegion whole max_access_size is greater than 8 (e.g. the Remote
Port memory master with RP_MAX_ACCESS_SIZE=4096), QEMU aborts with:
ERROR:.../include/qemu/bswap.h:487:ldn_he_p: code should not be reached
The root cause is in flatview_write_continue_step() and
flatview_read_continue_step() in system/physmem.c. These functions call
memory_access_size() to determine the access size, which returns
pow2floot(1) - for l=4096 this returns 4096. They then call
ldn_he_p(buf, *l) / stn_he_p(buf, *l, val) with that size.
However, ldb_he_p() and stn_he_p() (defined via DO_STN_LDN_P(he) in
include/qemu/bswap.h) only handle sizes 1, 2, 4 and 9. Any other size
hits g_assert_not_reached() and aborts.
The normal dispatch path (memory_region_dispatch_read/write) does not
hit this because it uses size_memop(op) which is always a power of 2
(1, 2, 4, or 8). But flatview_write_continue_step() and
flatview_read_continue_step() call ldn_he_p()/stn_he_p() directly,
bypassing the dispatch path.
The fix is to limit RP_MAX_ACCESS_SIZE to 8, which is the maximum size
that ldn_he_p()/stn_he_p() can handle. The flatview_write_continue()
and flatview_read_continue() loops will process remaining bytes in
subsequent 8-byte iterations.
The RP_MAX_ACCESS_SIZE definition is currently duplicated in two
patches in this series:
- "hw/core: Add Remote Port Memory Master object skeleton" (06/20)
- "hw/core: Imoplement Remote Port Memory Master bus transactions" (11/20)
I also recommend to move this duplicate definition into a common header.
Itai
prev parent reply other threads:[~2026-11-22 7:33 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 16:00 [PATCH v2 00/20] hw/core: Introduce Remote Port Co-simulation Protocol Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 01/20] hw/core: Add Remote Port protocol packet definition Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 02/20] hw/core: Add Remote Port header helpers Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 03/20] hw/core: Add Remote Port session state and hello protocol Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 04/20] hw/core: Implement Remote Port bus access helpers Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 05/20] hw/core: Implement Remote Port irq, sync and ATS helpers Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 06/20] hw/core: Add Remote Port object skeleton Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 07/20] hw/core: Add Remote Port protocol thread and handshake Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 08/20] hw/core: Implement Remote Port response handling Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 09/20] hw/core: Implement Remote Port time synchronization Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 10/20] hw/core: Add Remote Port Memory Master object skeleton Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 11/20] hw/core: Implement Remote Port Memory Master bus transactions Ruslan Ruslichenko
2026-10-13 16:09 ` Philippe Mathieu-Daudé
2026-10-13 16:10 ` Philippe Mathieu-Daudé
2026-10-14 8:24 ` Ruslan Ruslichenko
2026-11-03 13:55 ` Itai Handler
2026-11-04 18:22 ` Ruslan Ruslichenko
2026-11-05 15:13 ` [RFC PATCH] hw/core: Add a read FIFO to the Remote Port memory master Itai Handler
2026-09-15 16:00 ` [PATCH v2 12/20] system/physmem: Add ats_do_translate helper Ruslan Ruslichenko
2026-10-13 14:27 ` Clément MATHIEU--DRIF
2026-10-14 8:21 ` Ruslan Ruslichenko
2026-10-15 9:40 ` Clément MATHIEU--DRIF
2026-10-16 19:28 ` Ruslan Ruslichenko
2026-10-18 5:14 ` Clément MATHIEU--DRIF
2026-09-15 16:00 ` [PATCH v2 13/20] hw/core: Add Remote Port ATS device skeleton Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 14/20] hw/core: Implement Remote Port ATS logic and cache management Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 15/20] hw/core: Add Remote Port memory slave device Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 16/20] hw/core: Add Remote Port GPIO/Interrupt bridge Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 17/20] hw/core: Add Remote Port Stream device Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 18/20] hw/core: Add Remote Port files to build Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 19/20] hw/core: Add FDT support to Remote Port GPIO Ruslan Ruslichenko
2026-09-15 16:00 ` [PATCH v2 20/20] hw/core: Add FDT support to Remote Port memory master Ruslan Ruslichenko
2026-09-28 7:30 ` [PATCH v2 00/20] hw/core: Introduce Remote Port Co-simulation Protocol Ruslan Ruslichenko
2026-10-13 16:17 ` Philippe Mathieu-Daudé
2026-11-22 7:31 ` Itai Handler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261122073133.1940537-1-itai.handler@gmail.com \
--to=itai.handler@gmail.com \
--cc=Ruslan_Ruslichenko@epam.com \
--cc=artem_mygaiev@epam.com \
--cc=berrange@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=eugene@nuvacore.ai \
--cc=francisco.iglesias@amd.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=takahiro.nakata.wr@renesas.com \
--cc=volodymyr_babchuk@epam.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.