[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cryptography] Does RISC V solve Spectre ?

At 07:40 PM 3/23/2018, Ray Dillinger wrote:
>From: Ray Dillinger <bear AT sonic.net>
>On 03/23/2018 06:05 PM, Henry Baker wrote:
>> Great idea.
>> Let's see how well it works in practise.
>> # stuff finally shows up at yyyyy in the cache at this point in time
>> # I just received this $$$ box from Amazon that I ordered 5 months ago.
>> # I can't remember what I was doing at the time, or why I ordered it.
>> # Well, gotta go now, so throw it in the trash or give it away.
>You're being facetious of course. Compilers don't need to "remember"
>what they were doing and why they asked for data to be precached; like
>every other instruction, pre-caching instructions are generated in the
>first place from the actions and reasons.
>But obviously you know that.  So you must be making a joke but I don't
>know what you're making a joke about.
>Determining when to undertake these actions is not too hard for the
>logic overhead expressed in silicon which presently runs during the code
>execution. Moving that overhead to the compiler doesn't make it more
>complex than it already is.

Yes, I was being facetious, but there are human analogies to what's
going on in a compiler for a deeply pipelined machine.

Let's talk about the compiler for a moment.

You are correct that it is relatively easy for a compiler to compile
for a pipeline (I've written such a compiler) -- so long as there
aren't any branches or loops.  However, in the presence of branches
or loops, we can no longer predict in advance at what point in
the branch nest or loop body when (or if) a value will be needed.

This is the compiler equivalent of being unable to schedule my
day(s) waiting for the cable guy or the Fedex gal to show up. 
(Yes, the Fedex gal sometimes requires a signature.)

But for the compiler to schedule a value which will show up 200
(or more) instructions in the future is the equivalent of me trying
to schedule a visit 200 days in advance for someone arriving from
Mars.  Or perhaps think of scheduling visits in the 15th Century,
when every trip took days, weeks months or years.

(A modern Army general has commented on the plight of his ancient
Roman counterpart: "When one of your generals goes over the
horizon with his army, you're not going to hear from him for a
number of months.  You have to delegate authority, and you have
to be prepared to send *another general and another army* to
rescue him and/or defeat him if anything goes wrong.)

There's a physics T-shirt that reads "Time is nature's way
to keep everything from happening at once" -- Wheeler.

Perhaps computer architects need their own T-shirt; here
are some suggestions:

"A foolish consistency is the hobgoblin of inorder processors
... With consistency, a great processor simply has nothing to

"We choose mania over boredom every time." -- James Gleick

"Never underestimate the determination of a CPU who is time-rich
and cache-poor"  -- Cory Doctorow

"Boredom, that traitorous devil that possesses us to do things
sometimes useless, and often stupid."  Apol Lejano-Massebleau

"Boredom is what you dread most in the world, and yet, I
assure you, there are worse things." -- Agatha Christie

"When action grows unprofitable, gather information;
when information grows unprofitable; sleep" -- Ursula Le Guin

"Whoever sleeps long, does not sin." -- Martin Luther

The cryptography mailing list
cryptography AT metzdowd.com