News for hackers. Stuff that matters.
Re:RISC-V Stumbling Blocks by rwmj on Thursday January 02, 2020 @05:58AM (#21934401)
RISC-V is meant to be a simple, unsurprising, boring architecture, with any clever stuff (such as macro op fusion) being done at the microarchitecture level. It's not a project for researching new architectures.
Re:RISC-V Stumbling Blocks by beefhash on Thursday January 02, 2020 @06:14AM (#21934480)
I really wish it was just one tiny less bit simple. The RISC-V spec doesn't specify that multiplication instructions (if implemented) need to be constant-time. Which means RISC-V cores will need stupid hacks for cryptography like these: https://bearssl.org/ctmul.html
Re:RISC-V Stumbling Blocks by 0xcde4c3db on Thursday January 02, 2020 @09:46AM (#21935707)
A big part of the RISC-V story is the idea that microarchitecture decisions belong to the implementation and not the ISA specification. Specifying that multiplication must be constant-time would effectively be specifying that area-optimized cores aren't allowed to provide the multiplication instructions.
Re:RISC-V Stumbling Blocks by anoncake on Thursday January 02, 2020 @10:30AM (#21936146)
Couldn't this be solved by having constant-time and regular multiplication instructions?
Re:RISC-V Stumbling Blocks by justincormack on Thursday January 02, 2020 @11:04AM (#21936482)
Arm 8.4 has a constant time flag that makes most instructions constant time, without changing the instruction set. You could definitely add this to risc-v. Or just make a constant time implementation.
Re:RISC-V Stumbling Blocks by 0xcde4c3db on Thursday January 02, 2020 @10:33AM (#21936175)
Sure, but the constant-time instructions would presumably be defined in an extension along with other constant-time or crypto-optimized instructions.
Re:RISC-V Stumbling Blocks by rwmj on Thursday January 02, 2020 @06:39AM (#21934576)
It could be added in the future as a simple extension. (In fact I found at least two proposed crypto extensions with a simple search although neither mentions constant-time ops from a quick scan). There's a considerable penalty for all implementations if every multiply implementation has to be constant time.
Re:RISC-V Stumbling Blocks by ncmncm on Thursday January 02, 2020 @06:51AM (#21934629)
That is another problem.

The "optional extensions" have all the useful instructions in them, but typically just a couple of the instructions in each extension would provide most of its value.

So, I don't get popcount because it's in the bitmanip extension along with 10M transistors' worth of clever stuff I don't need. Similarly, each of the other extension sets.

It would be much more useful to define slices through all the defined ones, so you get either the absolute minimum core instructions, or add just the coremost of each extension set, or a more comfortable subset of each, or half of each, spiraling outward as transistor budget grows.

Re:RISC-V Stumbling Blocks by rwmj on Thursday January 02, 2020 @07:10AM (#21934743)
10 million transistors is a tenth of a square millimeter on current nodes, but that aside you really wouldn't want such a complicated system of "sub-extensions" because it would be a nightmare to write software for. Either the software would only work for very specific sub-extension mixes, or would require layers of ifuncs to deal with all combinations of missing sub-extension features.

The current system of fairly granular extensions, a useful base architecture, and profiles defining what extensions are guaranteed for particular application classes (eg "Unix server") is a nice compromise between extensibility and software/distro complexity.

Re:RISC-V Stumbling Blocks by ncmncm on Thursday January 02, 2020 @06:23AM (#21934508)
It is supposed to be the basis for a lot of future work, incorporating what we have learned thus far. But it doesn't, much. It seems not different from anything from the '80s, when we knew less.

If it is supposed to be simple, then great! Actually make it simple, instead of copying old complexities.

Re:RISC-V Stumbling Blocks by Symmetry on Thursday January 02, 2020 @09:21AM (#21935507)
If you're an academic doing research into new techniques for branch prediction or some other topic it can be very useful to have well tested designs as a starting point you can modify to try out your idea which are starting from a very basic place.

It isn't architecturally innovative, isn't meant to be, and isn't a good place to start if you're thinking about doing architectural innovation. A lot of people are talking up RISC-V like it'll solve every problem but there are many problems in both academia and the real world where it represents a solution.

Re:RISC-V Stumbling Blocks by rwmj on Thursday January 02, 2020 @06:36AM (#21934558)
What "old complexities" are you talking about? It's a very simple and clean architecture.
Re:RISC-V Stumbling Blocks by ncmncm on Thursday January 02, 2020 @06:41AM (#21934583)
No: it is just very familiar. It is like architectures we are used to, that we got used to because old designs were like that.