From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Jason Wang" <jasowangio@gmail.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
qemu-rust@nongnu.org
Subject: Re: [PATCH 6/6] hw/net/pcnet: Use timer_new_ns_guarded()
Date: Sat, 05 Dec 2026 11:53:58 +0200 [thread overview]
Message-ID: <tpkgup.1ftj8jmj3vyiz@linaro.org> (raw)
In-Reply-To: <20261204131946.2175006-7-peter.maydell@linaro.org>
On Fri, 04 Dec 2026 15:19, Peter Maydell <peter.maydell@linaro.org> wrote:
>The pcnet device performs DMA from a QEMU timer callback. To avoid
>the possibility of re-entrancy to the device if the guest arranges
>for this DMA to hit the device's own memory-mapped registers, use
>timer_new_ns_guarded() to enable the reentrancy guard while the timer
>callback is executing.
>
>Cc: qemu-stable@nongnu.org
>Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4748
>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>---
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> hw/net/pcnet.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
>index 0bd7d4314e7..cdbd5372d87 100644
>--- a/hw/net/pcnet.c
>+++ b/hw/net/pcnet.c
>@@ -1706,7 +1706,9 @@ void pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
> int i;
> uint16_t checksum;
>
>- s->poll_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pcnet_poll_timer, s);
>+ s->poll_timer = timer_new_ns_guarded(QEMU_CLOCK_VIRTUAL,
>+ pcnet_poll_timer, s,
>+ &dev->mem_reentrancy_guard);
>
> qemu_macaddr_default_if_unset(&s->conf.macaddr);
> s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
>--
>2.43.0
>
next prev parent reply other threads:[~2026-12-05 9:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 13:19 [PATCH 0/6] util/qemu-timer: Support reentrancy guard and use in pcnet, hcd-xhci Peter Maydell
2026-12-04 13:19 ` [PATCH 1/6] util/qemu-timer: Make timerlist_run_timers() file local Peter Maydell
2026-12-04 14:51 ` Thomas Huth
2026-12-05 9:48 ` Manos Pitsidianakis
2026-12-04 13:19 ` [PATCH 2/6] util/qemu-timer: Add optional reentrancy guard to the timer API Peter Maydell
2026-12-04 15:00 ` Thomas Huth
2026-12-04 15:05 ` Peter Maydell
2026-12-04 15:10 ` Thomas Huth
2026-12-04 13:19 ` [PATCH 3/6] util/qemu-timer: Add MemRentrancyGuard to timer_{init, new}_full() Peter Maydell
2026-12-04 15:22 ` [PATCH 3/6] util/qemu-timer: Add MemRentrancyGuard to timer_{init,new}_full() Thomas Huth
2026-12-05 9:51 ` [PATCH 3/6] util/qemu-timer: Add MemRentrancyGuard to timer_{init, new}_full() Manos Pitsidianakis
2026-12-04 13:19 ` [PATCH 4/6] util/qemu_timer: Add timer_new_ns_guarded() Peter Maydell
2026-12-04 15:26 ` Thomas Huth
2026-12-04 15:52 ` Peter Maydell
2026-12-04 13:19 ` [PATCH 5/6] hw/usb/hcd-xhci: Use timer reentrancy-guard API Peter Maydell
2026-12-04 15:28 ` Thomas Huth
2026-12-04 13:19 ` [PATCH 6/6] hw/net/pcnet: Use timer_new_ns_guarded() Peter Maydell
2026-12-04 15:28 ` Thomas Huth
2026-12-05 9:53 ` Manos Pitsidianakis [this message]
2026-12-04 15:32 ` [PATCH 0/6] util/qemu-timer: Support reentrancy guard and use in pcnet, hcd-xhci Thomas Huth
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=tpkgup.1ftj8jmj3vyiz@linaro.org \
--to=manos.pitsidianakis@linaro.org \
--cc=fam@euphon.net \
--cc=jasowangio@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.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.