svn commit: r274739 - head/sys/mips/conf

Warner Losh imp at bsdimp.com
Tue Nov 25 17:11:14 UTC 2014


> On Nov 25, 2014, at 7:23 AM, Ian Lepore <ian at FreeBSD.org> wrote:
> 
> On Tue, 2014-11-25 at 13:15 +0100, Dag-Erling Smørgrav wrote:
>> Ian, please try the attached patch.
>> 
>> The way this is intended to be used is that you set up a system with an
>> /etc/rc that does nothing else than mount the root file system and
>> append the output from "sysctl -b hw.attachtimes" to a log file, then
>> reboot.  You let it run for as long as you wish, then copy the log file
>> to another machine and run the attachtimes utility (source code below)
>> on the log file to extract the data and display either the raw numbers
>> or a histogram showing the distribution.
>> 
>> See freefall:~des/software/attachtimes.tgz for an example of how to set
>> this up.  All you need is the loader and kernel, a minimal /etc, and the
>> tools required by /etc/rc (sh, fsck, mount, df, sysctl, halt, reboot).
>> The example contains quite a bit more than that because I wanted to be
>> able to boot it in single-user mode for debugging.
>> 
>> The patch can easily be modified to record the actual timestamps instead
>> of just the delta, but remember to modify the utility as well, or the
>> output will be complete nonsense.
>> 
>> DES
> 
> Getting the results for this is going to take a while... I can't get the
> system past mountroot right now.  I have no idea why.  It's been months
> since I last successfully booted -current on this old hardware.  I'm
> also very busy with $work.

I have similar hardware on my desk, and I might be able to find a little
time to boot it.

> For the 3 numbers that are identical at the start, I think we're reading
> garbage in binuptime() because the clock driver isn't working yet.  The
> numbers first change with at91_st0, that's the clock driver.  atmelarm0
> is the parent of everything listed between nexus and it, so the large
> number there is probably the subtraction of the post-init clock value
> from the pre-init clock garbage.

Yea, at best this bug is solved by initializing something to zero :)

> In a more general sense, I'm going to repeat a couple things...
> 
> The clock all this is being measured with runs at 32 KHz.  That's 'K’.

Since these systems run at 200MHz or 400MHz, it makes a lot of sense
that we’re seeing the same number. That’s like ~10k instructions between
ticks. And since that is really 32,768Hz, it makes sense that the bottom
15 bits are zeros given how bintime encodes things.

> This output is evidence that the system behaves exactly as I've been
> saying it behaves for a long long while.  You seem convinced, I don't
> understand why, that there must be some error here.  I don't understand
> why you think a system like this would behave any differently each time
> it is powered on.  The only actual entropy involved is whatever minor
> thermal transients may exist in the crystal oscillator.  With 32KHz
> resolution (or even a few MHz) that amounts to not a lot of measurable
> variation at all.

Yes, we’re 4 orders of magnitude above the ‘changes every instruction
or so’ notion that Mark had sent out.

> The repeatability of the boot sequence of hardware like this is nearly
> perfect at the resolution we're measuring.  While that may be bad for
> gathering entropy, it's a wonderful thing when you're debugging, because
> problems that would be almost impossible to nail down on modern complex
> hardware are 100% reproducible by just hitting the reset button.  That
> reproducibility extends all the way into multiuser mode unless there is
> a network connection where packet arrival times start adding
> interrupt-based entropy.

Yea, every boot it is the same registers that are being read, in the
same sequence, resulting in very similar cache patterns and performance
profiles. I’d be surprised if anything apart from the ethernet chip’s
state was different between boots. And even the ethernet’s stuff has
a low variance until interrupts are turned on…

Warner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20141125/cad3dd97/attachment.sig>


More information about the freebsd-arch mailing list