All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
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>,
	qemu-rust@nongnu.org
Subject: Re: [PATCH 4/6] util/qemu_timer: Add timer_new_ns_guarded()
Date: Fri, 4 Dec 2026 16:26:38 +0100	[thread overview]
Message-ID: <caf4505f-e9fd-426e-bc2d-112b0bc4807b@redhat.com> (raw)
In-Reply-To: <20261204131946.2175006-5-peter.maydell@linaro.org>

Am 04.12.26 um 14:19 schrieb Peter Maydell:
> Add a timer_new_ns_guarded() function which is the same as
> timer_new_ns() but takes a MemReentrancyGuard.
> 
> There are a lot of different sub-flavours of timer_new() and
> timer_init() wrappers which could have _guarded() versions added;
> rather than adding half a dozen functions which have no callers,
> start with just the one we want for the two devices we plan to make
> use it.

"... to make use *of* it" ? (I'm not a native speaker, though, so I might be 
wrong)

> Cc: qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   include/qemu/timer.h | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/include/qemu/timer.h b/include/qemu/timer.h
> index 1287682de61..85504e2bc53 100644
> --- a/include/qemu/timer.h
> +++ b/include/qemu/timer.h
> @@ -562,6 +562,33 @@ static inline QEMUTimer *timer_new_ns(QEMUClockType type, QEMUTimerCB *cb,
>       return timer_new(type, SCALE_NS, cb, opaque);
>   }
>   
> +/**
> + * timer_new_ns_guarded:
> + * @type: the clock type to associate with the timer
> + * @cb: the callback to call when the timer expires
> + * @opaque: the opaque pointer to pass to the callback
> + * @reentrancy_guard: A guard set when entering @cb to prevent

Should be only "guard" instead of "reentrancy_guard" to match the parameter 
list below.

> + *    device-rentrancy issues

Missing "e" again in "rentrancy".

> + * Create a new timer with nanosecond scale on the default timer list
> + * associated with the clock, and a reentrancy guard.
> + * See timer_new_full for details.
> + *
> + * The timer returned must be freed using timer_free().
> + *
> + * The guard is optional, but if you aren't specifying it then
> + * you can just use timer_new_ns() instead.
> + *
> + * Returns: a pointer to the newly created timer
> + */
> +static inline QEMUTimer *timer_new_ns_guarded(QEMUClockType type,
> +                                              QEMUTimerCB *cb,
> +                                              void *opaque,
> +                                              MemReentrancyGuard *guard)
> +{
> +    return timer_new_full(NULL, type, SCALE_NS, 0, cb, opaque, guard);
> +}
With the doc comment fixed:

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2026-12-04 15:27 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 [this message]
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
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=caf4505f-e9fd-426e-bc2d-112b0bc4807b@redhat.com \
    --to=thuth@redhat.com \
    --cc=fam@euphon.net \
    --cc=jasowangio@gmail.com \
    --cc=manos.pitsidianakis@linaro.org \
    --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 \
    /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.