Development issues regarding the cerowrt test router project
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dave Taht <dave.taht@bufferbloat.net>
Cc: openwrt-devel@lists.openwrt.org, cerowrt-devel@lists.bufferbloat.net
Subject: Re: [Cerowrt-devel] getting more randomness by improving MIPS get_cycles()
Date: Mon, 9 Sep 2013 08:16:45 -0700	[thread overview]
Message-ID: <20130909081645.03610591@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20130908190427.GA14461@lists.bufferbloat.net>

On Sun, 8 Sep 2013 12:04:27 -0700
Dave Taht <dave.taht@bufferbloat.net> wrote:

> In light of the whole nsa hoo-ra (stuff like this)
> 
> https://plus.google.com/u/0/117091380454742934025/posts/SDcoemc9V3J
> 
> Ted Tso has pointed out to me that apparently mips' does not have a working 
> generic get_cycles() call,  but instead returns 0 in all cases.
> 
> e.g: In arch/mips/include/asm/timex.h:
> 
> typedef unsigned int cycles_t;
> 
> static inline cycles_t get_cycles(void)
> {
>         return 0;
> }
> 
> Um.....
> 
> get_cycles() is used in innumerable places in random.c.
> 
> This is double plus ungood... I am REALLY hoping I'm merely misreading 
> the code...
> 
> An example:
> 
> (see drivers/char/random.c for how often it is used)
> 
> /*
>  * Add device- or boot-specific data to the input and nonblocking
>  * pools to help initialize them to unique values.
>  *
>  * None of this adds any entropy, it is meant to avoid the
>  * problem of the nonblocking pool having similar initial state
>  * across largely identical devices.
>  */
> 
> void add_device_randomness(const void *buf, unsigned int size)
> {
>         unsigned long time = get_cycles() ^ jiffies;
> 
> ...
> 
> So, what blocks having a working get_cycles in common mips architectures?

In order to implement get_cycles() a high resolution hardware counter
with quick access is necessary.



      reply	other threads:[~2013-09-09 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-08 19:04 Dave Taht
2013-09-09 15:16 ` Stephen Hemminger [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

  List information: https://lists.bufferbloat.net/postorius/lists/cerowrt-devel.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130909081645.03610591@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=cerowrt-devel@lists.bufferbloat.net \
    --cc=dave.taht@bufferbloat.net \
    --cc=openwrt-devel@lists.openwrt.org \
    /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