From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
Thomas Monjalon <thomas@monjalon.net>,
Ravi Kerur <rkerur@brocade.com>
Subject: Re: [PATCH v2] eal: fail initialization if TSC frequency is zero
Date: Tue, 29 Sep 2026 14:57:54 +0100 [thread overview]
Message-ID: <arvD4gDTBcNFAdAh@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260929064208.6c7453bb@phoenix.local>
On Tue, Sep 29, 2026 at 06:42:08AM -0700, Stephen Hemminger wrote:
> On Tue, 29 Sep 2026 09:39:36 +0100
> Bruce Richardson <bruce.richardson@intel.com> wrote:
>
> > On Mon, Sep 28, 2026 at 04:15:58PM -0700, Stephen Hemminger wrote:
> > > Many parts of DPDK will fail with divide by zero and
> > > other errors if the initialization logic ever TSC hz was ever
> > > determined to be zero. This might happen on a broken get_tsc_freq_arch()
> > > or bad emulation in QEMU.
> > >
> > > If TSC hz is zero, log the error and propagate back to
> > > fail rte_eal_init().
> > >
> > > This fix doesn't need to go to stable since it is a purely
> > > theoretical problem; we aren't getting divide by zero reports
> > > from users.
> > >
> >
> > How was this discovered? Is there a coverity issue id, or was it just AI
> > discovered?
>
> It was part of review of pcapng timestamp calculation.
> Kind of funny, AI spotted overflow (which I verified) in the code which
> it had previously helped write. Then it was asking it self,
> "what if TSC was 0". I didn't see how this could happen unless QEMU
> had some broken CPU emulation.
>
> To me it seemed best to fail fast and die in a safer manner.
>
Agreed. You can add my ack, either for this version or a new version with
the "set" function renamed as I suggest.
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
next prev parent reply other threads:[~2026-09-29 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 19:54 [PATCH] eal: fail initialization if TSC frequency is zero Stephen Hemminger
2026-09-27 20:09 ` Stephen Hemminger
2026-09-28 23:15 ` [PATCH v2] " Stephen Hemminger
2026-09-29 8:39 ` Bruce Richardson
2026-09-29 13:42 ` Stephen Hemminger
2026-09-29 13:57 ` Bruce Richardson [this message]
2026-09-29 14:10 ` Stephen Hemminger
2026-09-29 14:13 ` [PATCH v3] " Stephen Hemminger
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=arvD4gDTBcNFAdAh@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=rkerur@brocade.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox