Live data from Hacker News

VRoom A high end RISC-V implementation

moonbaseotago.github.io

21–30 of 135 posts

Re: VRoom A high end RISC-V implementation

#21
post #3

The architectural details here were pretty interesting: https://moonbaseotago.github.io/talk/index.html It would be nice to get actual performance numbers rather than just frequency scaled Dhrystone but I suppose we have to be patient.

Dhystone's just a place to start, it helps me make quick tweaks, and I'm at that stage of the process - it's particularly good because it's somewhat at odds with my big wide decoders - VRoom! can decode bundles of up to 8 instructions per clock, while Dhrystone has lots of twisty branches, only decodes ~3.7 instructions per bundle - it's a great test for the architecture by pushing at the things it might not be as good as.

Having said that I'm about reaching the end of the point where it's the only thing - being able to run bigger longer benchmarks is one of the reasons for bringing up linux on the big FPGA on AWS

Re: VRoom A high end RISC-V implementation

#22

> Eventually we'll do some instruction combining using this information (best place may be at entry to I$0 trace cache), or possibly at the rename stage So much for "we will do only simplest of commands and u-op fusing will fix performance". It is why I'm very suspicious about this argument from RISC-V proponents.

I think that we need lots of trace before we decide which ops make sense to combine

Re: VRoom A high end RISC-V implementation

#23
post #9

Any recommendations for resources on learning to makes things like this in general?

Computer Architecture: A Quantitative Approach[1] is the textbook that gets recommended the most on the topic, I believe.

If you're at the point in your career where you're not sure which is the right textbook then "A Quantitative Approach" is likely to be really tough to get through.

Computer Organization and Design, by the same authors, is considered a better choice for a first book. I personally loved it and couldn't put it down the first time I read it.

https://www.elsevier.com/books/computer-organization-and-des...

Re: VRoom A high end RISC-V implementation

#24
post #9

Any recommendations for resources on learning to makes things like this in general?

Computer Architecture: A Quantitative Approach[1] is the textbook that gets recommended the most on the topic, I believe.

Older editions of this are freely available online, and great for learning about microarchitecture.

Re: VRoom A high end RISC-V implementation

#27
The presentation was interesting; but I would like to write an idea that is tangentially related to this CPU.

I noticed that modern CPUs are optimized for legacy monolith OS kernels like Linux or Windows. But having a large, multimegabyte kernel is a bad idea from a security standpoint. A single mistake or intentional error in some rarely used component (like a temperature sensor driver) can get attacker full access to the system. Again, an error in any part of the monolith kernel can cause system failure. And Linux kernel doesn't even use static analysis to find bugs! It is obvious that using microkernels could solve many of the issues above.

But microkernels tend to have poor performance. One of the reasons for this could be high context switch latency. CPUs with high context switch latency are only good for legacy OSes and not ready for better future kernels. Therefore, either we will find a way to make context switches fast or we will have to stay with large, insecure kernels full of vulnerabilities.

So I was thinking what could be done here. For example, one thing that could be improved is to get rid of address space switch. It causes flushes of various caches and it hurts performance. Instead, we could always use the single mapping from virtual to physical addresses, but allocate each process different virtual address range. To implement this, we could add two registers, which would hold minumum and maximum accessible virtual addresses. It should be easy to check the address against them to prevent speculative out of bounds memory accesses.

By the way, 32-bit x86 architecture had segments, that could be used to divide single address space between processes.

Another thing that can take time is saving/restoring registers on context switch. One way to solve the problem could be to use multiple banks (say, 64 banks) of registers that can be quickly switched, another way would be to zero out registers on return from kernel and let processes save them if they need it.

Or am I wrong somewhere and fast context switches cannot be implemented this way?

Re: VRoom A high end RISC-V implementation

#28
post #23

Earlier quoted context omitted.

Computer Architecture: A Quantitative Approach[1] is the textbook that gets recommended the most on the topic, I believe.

If you're at the point in your career where you're not sure which is the right textbook then "A Quantitative Approach" is likely to be really tough to get through. Computer Organization and Design, by the same authors, is considered a better choice for a first book. I personally loved it and couldn't put it down the first time I read it. https://www.elsevier.com/books/computer-organization-and-des...

Any recommendation for books on (System)Verilog

Re: VRoom A high end RISC-V implementation

#29

What does GPL mean for a chip design? I understand how it applies to the HDL, but I doubt that it obligates you have to open your code to users of physical chips.

AFAICS, it is the same as software: you changed and distributed; you have to provide your changes if asked to.

Re: VRoom A high end RISC-V implementation

#30

The presentation was interesting; but I would like to write an idea that is tangentially related to this CPU. I noticed that modern CPUs are optimized for legacy monolith OS kernels like Linux or Windows. But having a large, multimegabyte kernel is a bad idea from a security standpoint. A single mistake or intentional error in some rarely used component (like a temperature sensor driver) can get attacker full access…

Long ago, we in the Newton project at Apple had that idea. We (in conjunction with ARM) were defining the first ARM MMU, so we took the opportunity to implement “domains” of memory protection mappings that could be quickly swapped at a context switch. So you get multiple threads in the same address space, but with independent R/W permission mappings.

I think a few other ARM customers were intrigued by the security possibilities, but the vast majority were more like “what is this bizarre thing, I just want to run Unix”, so the feature disappeared eventually.

Here’s some ARM documentation if you want to pull this thread: https://developer.arm.com/documentation/dui0056'/latest/'cac...

Post reply on HN