mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-kernel@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH v3] random: unify cycles_t and jiffies usage and types
Date: Fri, 25 Feb 2022 15:16:34 +0100	[thread overview]
Message-ID: <Yhjkwg6s8BP7xdaR@owl.dominikbrodowski.net> (raw)
In-Reply-To: <20220225134408.933305-1-Jason@zx2c4.com>

Am Fri, Feb 25, 2022 at 02:44:08PM +0100 schrieb Jason A. Donenfeld:
> random_get_entropy() returns a cycles_t, not an unsigned long, which is
> sometimes 64 bits on various 32-bit platforms, including x86.
> Conversely, jiffies is always unsigned long. This commit fixes things to
> use cycles_t for fields that use random_get_entropy(), named "cycles",
> and unsigned long for fields that use jiffies, named "now". It's also
> good to mix in a cycles_t and a jiffies in the same way for both
> add_device_randomness and add_timer_randomness, rather than using xor in
> one case. Finally, we unify the order of these volatile reads, always
> reading the more precise cycles counter, and then jiffies, so that the
> cycle counter is as close to the event as possible.
> 
> Cc: Theodore Ts'o <tytso@mit.edu>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

	Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>

Thanks,
	Dominik

      reply	other threads:[~2022-02-25 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 17:39 [PATCH] random: use proper cycle_t type for random_get_entropy() Jason A. Donenfeld
2022-02-24 21:30 ` [PATCH v2] random: unify cycles_t and jiffies usage and types Jason A. Donenfeld
2022-02-25  6:58   ` Dominik Brodowski
2022-02-25 13:39     ` Jason A. Donenfeld
2022-02-25 13:44       ` [PATCH v3] " Jason A. Donenfeld
2022-02-25 14:16         ` Dominik Brodowski [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=Yhjkwg6s8BP7xdaR@owl.dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®